2022-05-26 23:06:25 +08:00
---
aliases:
2024-03-14 23:58:18 +08:00
- ../notifications/ # /docs/grafana/< GRAFANA_VERSION > /alerting/notifications/
- ../unified-alerting/notifications/ # /docs/grafana/< GRAFANA_VERSION > /alerting/unified-alerting/notifications/
- ../alerting-rules/create-notification-policy/ # /docs/grafana/< GRAFANA_VERSION > /alerting/alerting-rules/create-notification-policy/
- ../manage-notifications/create-notification-policy/ # /docs/grafana/< GRAFANA_VERSION > /alerting/manage-notifications/create-notification-policy/
2024-02-27 18:56:11 +08:00
canonical: https://grafana.com/docs/grafana/latest/alerting/configure-notifications/create-notification-policy/
2023-12-12 18:05:20 +08:00
description: Configure notification policies to determine how alerts are routed to contact points
2022-05-26 23:06:25 +08:00
keywords:
- grafana
- alerting
- guide
- notification policies
- routes
Explicitly set all front matter labels in the source files (#71548)
* Set every page to have defaults of 'Enterprise' and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration pages to have of 'Cloud', 'Enterprise', and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/enterprise-licensing pages to have 'Enterprise' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/organization-management pages to have 'Enterprise' and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/provisioning pages to have 'Enterprise' and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/recorded-queries pages to have labels cloud,enterprise
* Set administration/roles-and-permissions/access-control pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/stats-and-license pages to have labels cloud,enterprise
* Set alerting pages to have labels cloud,enterprise,oss
* Set breaking-changes pages to have labels cloud,enterprise,oss
* Set dashboards pages to have labels cloud,enterprise,oss
* Set datasources pages to have labels cloud,enterprise,oss
* Set explore pages to have labels cloud,enterprise,oss
* Set fundamentals pages to have labels cloud,enterprise,oss
* Set introduction/grafana-cloud pages to have labels cloud
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Fix introduction pages products
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set panels-visualizations pages to have labels cloud,enterprise,oss
* Set release-notes pages to have labels cloud,enterprise,oss
* Set search pages to have labels cloud,enterprise,oss
* Set setup-grafana/configure-security/audit-grafana pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set setup-grafana/configure-security/configure-authentication pages to have labels cloud,enterprise,oss
* Set setup-grafana/configure-security/configure-authentication/enhanced-ldap pages to have labels cloud,enterprise
* Set setup-grafana/configure-security/configure-authentication/saml pages to have labels cloud,enterprise
* Set setup-grafana/configure-security/configure-database-encryption/encrypt-secrets-using-hashicorp-key-vault pages to have labels cloud,enterprise
* Set setup-grafana/configure-security/configure-request-security pages to have labels cloud,enterprise,oss
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set setup-grafana/configure-security/configure-team-sync pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set setup-grafana/configure-security/export-logs pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set troubleshooting pages to have labels cloud,enterprise,oss
* Set whatsnew pages to have labels cloud,enterprise,oss
* Apply updated labels from review
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
---------
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
2023-07-18 16:10:12 +08:00
labels:
products:
- cloud
- enterprise
- oss
2023-06-20 17:43:12 +08:00
title: Configure notification policies
2024-02-28 16:10:19 +08:00
weight: 420
2024-05-21 20:43:21 +08:00
refs:
notification-policies:
- pattern: /docs/grafana/
destination: /docs/grafana/< GRAFANA_VERSION > /alerting/fundamentals/notifications/notification-policies/
- pattern: /docs/grafana-cloud/
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/notifications/notification-policies/
2022-05-26 23:06:25 +08:00
---
2021-06-03 02:28:24 +08:00
2023-06-20 17:43:12 +08:00
# Configure notification policies
2021-06-03 02:28:24 +08:00
2023-05-31 20:19:33 +08:00
Notification policies determine how alerts are routed to contact points.
2021-06-03 02:28:24 +08:00
2024-06-06 20:59:04 +08:00
Policies have a tree structure and each policy can have one or more child policies. Each policy, except for the default policy, can also match specific alert labels.
2021-06-03 02:28:24 +08:00
2024-06-06 20:59:04 +08:00
Each alert is evaluated by the default policy and subsequently by each child policy.
2021-12-02 23:51:49 +08:00
2024-06-06 20:59:04 +08:00
If the **Continue matching subsequent sibling nodes** option is enabled for a child policy, evaluation continues even after one or more matches. A parent policy’ s configuration settings and contact point information govern the behavior of an alert that does not match any of the child policies. A default policy governs any alert that does not match a child policy.
2021-12-02 23:51:49 +08:00
2023-05-31 20:19:33 +08:00
You can configure Grafana-managed notification policies as well as notification policies for an external Alertmanager data source.
2021-12-02 23:51:49 +08:00
2024-05-21 20:43:21 +08:00
For more information on notification policies, refer to [fundamentals of Notification Policies ](ref:notification-policies ).
2021-12-02 23:51:49 +08:00
2024-06-06 20:59:04 +08:00
## Edit the default notification policy
2021-06-03 02:28:24 +08:00
2023-03-31 16:40:06 +08:00
1. In the left-side menu, click **Alerts & IRM** and then **Alerting** .
2021-10-28 04:57:54 +08:00
1. Click **Notification policies** .
2023-03-24 04:26:16 +08:00
1. From the **Choose Alertmanager** dropdown, select an external Alertmanager. By default, the **Grafana Alertmanager** is selected.
2023-11-08 20:43:46 +08:00
1. In the Default policy section, click ** ...** -> **Edit** .
2024-05-21 20:26:40 +08:00
1. In **Default contact point** , update the contact point for where to send notifications when alert rules do not match any specific policy.
2021-10-28 04:57:54 +08:00
1. 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).
1. 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.
- **Group interval** Minimum time interval between two notifications for a group. Default is 5 minutes.
- **Repeat interval** Minimum time interval for re-sending a notification if no new alerts were added to the group. Default is 4 hours.
1. Click **Save** to save your changes.
2021-06-03 02:28:24 +08:00
2024-06-06 20:59:04 +08:00
## Add a child policy
2021-06-03 02:28:24 +08:00
2024-06-06 20:59:04 +08:00
You can create a child policy under a default policy or under an existing child policy.
If you want to choose where to position your policy, see the section on **Add a sibling policy** .
2023-09-29 00:31:24 +08:00
2023-03-31 16:40:06 +08:00
1. In the left-side menu, click **Alerts & IRM** and then **Alerting** .
2024-05-21 20:26:40 +08:00
2. Click **Notification policies** .
3. From the **Choose Alertmanager** dropdown, select an Alertmanager. By default, the **Grafana Alertmanager** is selected.
2024-06-06 20:59:04 +08:00
4. Click ** +New child policy** from the default policy.
2024-05-21 20:26:40 +08:00
5. In the Matching labels section, add one or more rules for matching alert labels.
2024-06-06 20:59:04 +08:00
6. In the **Contact point** dropdown, select the contact point to send notification to if alert matches only this specific policy and not any of the child policies.
2024-05-21 20:26:40 +08:00
7. Optionally, enable **Continue matching subsequent sibling nodes** to continue matching sibling policies even after the alert matched the current policy. When this option is enabled, you can get more than one notification for one alert.
8. Optionally, enable **Override grouping** to specify the same grouping as the default policy. If this option is not enabled, the default policy grouping is used.
9. Optionally, enable **Override general timings** to override the timing options configured in the group notification policy.
10. Click **Save policy** to save your changes.
2021-06-03 02:28:24 +08:00
2024-06-06 20:59:04 +08:00
## Add a sibling policy
2021-06-03 02:28:24 +08:00
2023-03-31 16:40:06 +08:00
1. In the left-side menu, click **Alerts & IRM** and then **Alerting** .
2023-03-24 04:26:16 +08:00
1. Click **Notification policies** .
2024-06-06 20:59:04 +08:00
1. Find the child policy you want to create a sibling for.
1. Click **Add new policy** -> **New sibling above** or **New sibling below** .
2021-06-03 02:28:24 +08:00
2024-06-06 20:59:04 +08:00
Notification policies are evaluated from top to bottom, so it is key to be able to choose which notification policy receives alerts first. Adding sibling notification policies instead of always inserting a child policy as well as being able to choose where to insert is key to managing where your alerts go.
2021-06-03 02:28:24 +08:00
2024-06-06 20:59:04 +08:00
1. Click **Save policy** to save your changes.
2021-06-03 02:28:24 +08:00
2024-06-06 20:59:04 +08:00
## Search for policies
2023-03-09 00:18:17 +08:00
Grafana allows you to search within the tree of policies by the following:
- **Label matchers**
- **Contact Points**
2024-05-21 20:26:40 +08:00
To search by contact point simply select a contact point from the **Search by contact point** dropdown. The policies that use that contact point are highlighted in the user interface.
2023-03-09 00:18:17 +08:00
To search by label matchers simply enter a valid matcher in the **Search by matchers** input field. Multiple matchers can be combined with a comma (`,`).
2024-06-06 20:59:04 +08:00
It is important to note that all matched policies are **exact** matches. Grafana supports regular expressions for creating label matchers. It does not support regular expression or partial matching in the search for policies.
2023-03-09 00:18:17 +08:00
2024-06-06 20:59:04 +08:00
## Mute timings
2024-04-23 16:27:24 +08:00
2024-06-06 20:59:04 +08:00
Mute timings are not inherited from a parent notification policy. They have to be configured in full on each level.
2024-04-23 16:27:24 +08:00
2021-10-28 04:57:54 +08:00
## Example
2021-06-03 02:28:24 +08:00
2021-10-28 04:57:54 +08:00
An example of an alert configuration.
2021-06-03 02:28:24 +08:00
2023-03-09 00:18:17 +08:00
- Create a "default" contact point for slack notifications, and set it on the default policy.
2024-05-21 20:26:40 +08:00
- Edit the default policy grouping to group alerts by `cluster` , `namespace` and `severity` so that you get a notification per alert rule and specific Kubernetes cluster and namespace.
2021-10-28 04:57:54 +08:00
- Create specific route for alerts coming from the development cluster with an appropriate contact point.
2022-12-15 04:50:36 +08:00
- Create a specific route for alerts with "critical" severity with a more invasive contact point integration, like pager duty notification.
2023-03-09 00:18:17 +08:00
- Create specific routes for particular teams that handle their own on-call rotations.