Grafana 9.0.4 installed.
Using Grafana Alertmanager
Relatively need in Grafana
I have a single Alert rule I want to apply on multiple Notification policies:
e.g. a Prometheus alert on a disk -
I want to send the notification to two separate groups that relay on the disk.
Trying to set two different labels on the rule with two notification policies one set with each label didn’t send it to both.
Actually my question is more general - what is the AND OR relationship between Alert rules and Notification policies - I was having hard time to understand it from the documentation.
For example If I have an alert rule with two labels and two notification policies where each is matching one of the labels (name and value)- will Grafana execute the notification to both ?
The notification policy is a tree structure. So, imagine we have an alert with two labels:
{tomato: red} {avocado:green}
Then, in the policy tree, we have this structure:
default policy (where all the alerts that not match anything in this tree would go)
|---- policy1 {tomato:red}
|---- policy2 {avocado:green}
The alert when is firing would go first to the first child from default policy that is policy1, as it matches…then the alert would go to this policy1.
But, in case you want the algorithm continue matching subsequent sibling nodes, you can do it by enabling it in the policy1 (you have an option for doing this), and then the alert will be sent to policy1 and policy2.
For more information Docs