Notification policies
You can configure Grafana managed notification policies as well as notification policies for an external Alertmanager data source. For more information, see .
- In the Grafana menu, click the Alerting (bell) icon to open the Alerting page listing existing alerts.
- Click Notification policies.
- From the Alertmanager dropdown, select an external Alertmanager. By default, the Grafana Alertmanager is selected.
- In the Root policy section, click Edit (pen icon).
- In Default contact point, update the to whom notifications should be sent for rules when alert rules do not match any specific policy.
- In Group by, choose labels to group alerts by. If multiple alerts are matched for this policy, then they are grouped by these labels. A notification is sent per group. If the field is empty (default), then all notifications are sent in a single group. Use a special label
...
to group alerts by all labels (which effectively disables grouping). - In Timing options, select from the following options:
- Group wait Time to wait to buffer alerts of the same group before sending an initial notification. Default is 30 seconds.
- Repeat interval Minimum time interval for re-sending a notification if no new alerts were added to the group. Default is 4 hours.
- Click Save to save your changes.
Add new specific policy
- In the Grafana menu, click the Alerting (bell) icon to open the Alerting page listing existing alerts.
- Click Notification policies.
- From the Alertmanager dropdown, select an Alertmanager. By default, the Grafana Alertmanager is selected.
- To add a top level specific policy, go to the Specific routing section and click New specific policy.
- In Matching labels section, add one or more rules for matching alert labels. For more information, see .
- In Contact point, add the contact point to send notification to if alert matches only this specific policy and not any of the nested policies.
- Optionally, enable Continue matching subsequent sibling nodes to continue matching nested policies even after the alert matched the parent policy. When this option is enabled, you can get more than one notification. Use it to send notification to a catch-all contact point as well as to one of more specific contact points handled by nested policies.
- Optionally, enable Override grouping to specify the same grouping as the root policy. If this option is not enabled, the root policy grouping is used.
- Optionally, enable Override general timings to override the timing options configured in the group notification policy.
- Click Save policy to save your changes.
- Expand the specific policy you want to update.
- Click Add nested policy, then add the details using information in Add new specific policy.
Edit specific policy
- In the Alerting page, click Notification policies to open the page listing existing policies.
- Find the policy you want to edit, then click Edit (pen icon).
- Make any changes using instructions in Add new specific policy.
- Click Save policy.
The Label field is the name of the label to match. It must exactly match the label name.
The Operator field is the operator to match against the label value. The available operators are:
=
: Select labels that are exactly equal to the provided string.- : Select labels that are not equal to the provided string.
=~
: Select labels that regex-match the provided string.!~
: Select labels that do not regex-match the provided string.
- The Value field matches against the corresponding value for the specified Label name. How it matches depends on the Operator value.
Example
- Create a “default” contact point for slack notifications, and set it on root policy.
- Edit the root policy grouping to group alerts by ,
namespace
andseverity
so that you get a notification per alert rule and specific kubernetes cluster and namespace. - Create specific route for alerts coming from the development cluster with an appropriate contact point.
Create specific routes for particular teams that handle their own onduty rotations.