add-alerting-target.sh Advanced Usage Information and Examples
View content for :
Platform:

add-alerting-target.sh Advanced Usage Information and Examples

The following explains some advanced
add-alerting-target.sh
usage information and some examples that show how to run the script in different advanced scenarios.
For more information, refer to the Prometheus AlertManager documentation.

Alert Timing Explained

AlertManager uses several timing parameters to control when and how often notifications are sent:
Timing diagram
Timing diagram.
Parameter
Description
When to Adjust
--group-wait
Initial delay before sending first notification.
Decrease for more urgent alerts. Increase to collect more alerts in a group.
--group-interval
Delay before sending updated notifications for the same group.
Decrease for frequently changing alerts. Increase to reduce notification frequency.
--repeat-interval
Delay before resending an unresolved alert.
Decrease for critical alerts that need attention. Increase to reduce alert fatigue.

Custom Grouping

Group alerts by specific labels to combine related alerts into a single notification:
./add-alerting-target.sh \ --type webhook \ --name grouped-alerts \ --group-by severity,instance \ --webhook-url https://webhook.example.com

Multiple Matchers

You can specify multiple matchers to filter alerts:
./add-alerting-target.sh \ --type webhook \ --name specific-alerts \ --matchers "severity=critical,instance=~prod.*,alertname!=TestAlert" \ --webhook-url https://webhook.example.com

Customizing Alert Timing

Adjust how alerts are grouped and repeated:
./add-alerting-target.sh \ --type webhook \ --name custom-timing-alerts \ --group-wait 10s \ --group-interval 1m \ --repeat-interval 30m \ --webhook-url https://webhook.example.com