We have a large number of Alert Rules.
It looks like there should be a way to search by “Contact Point” and there is an option (example: _contact_ = Slack #… ).
The tagging/labeling is not sufficient to map Alert Rule to Notification Endpoint (i.e. values marked “@ Delivered to…” in “5. Configure notifications” section in the edit screen of an Alert Rule).
Unless an Alert has been sent out at some point in the past, the only option is to edit each rule and look where it is delivered to.
Can anyone advise? Is there an existing/upcoming feature that would make this easier?
Yes, there is a Contact point filter now: Alert rules → Filter → Contact point.
Try it against a rule you know is routed via notification policies → if it correctly returns that rule then the filter already solves this for you in bulk.
If it doesn’t then →
Use Preview routing in the rule editor per rule, or script it by exporting
alert rules (GET /api/v1/provisioning/alert-rules) and the policy tree
(GET /api/v1/provisioning/policies), then match each rule labels against notification policy matchers.
It seems to be broken in that case.
The Contact Point is listed in the dropdown but when selected I get:
“No matching rules found
No alert or recording rules matched your current set of filters.”
Is there any reason it might not show up?
I see “Filters alert rules which route directly to the selected contact point. Alert rules routed to notification policies will not be displayed.” under the information pupup, but I am assuming this is unrelated because the contact point is explicitly listed in the dropdown.
By “Use Preview routing in the rule editor per rule” do you mean open each rule’s edit and then check for routing there? Checking each rule one by one is a bit too labour-intensive.
Also, I don’t know if the provisioning endpoint is the appropriate API endpoint, since we are just querying endpoints, not creating them. Am I mistaken here?
I also checked Notification Configuration and it says “0 attempts” for the specified Contact Point, though we have had alerts sent in the past.
Is this expected?
Based on the tooltip , Contact point filter only matches rules with direct routing (contact point set on the rule itself). It does not match rules routed via notification policies → that’s what the tooltip is saying and that is why you get no results even though the contact point is valid and listed.
For policy-routed rules →
Preview routing → per rule, in the rule editor. One at a time, not aware of a bulk version.
For a bulk view, the Provisioning API is probably your best option. → GET /api/v1/provisioning/alert-rules and GET /api/v1/provisioning/policies let you export the alerting configuration. You can then match each rule’s labels against the notification policy matchers to determine the effective contact point.
On “0 attempts”, check that you’re viewing the same Alertmanager (Grafana-managed vs. external) that actually sent those past alerts, as notification counts are scoped per Alertmanager.
A recent update to the alert rule list page introduced Contact point and Notification policy filters in the left sidebar.
Note that there are two ways to configure notifications for an alert rule:
- Contact points can be assigned directly to the alert rule.
- Notification policies are applied dynamically when an alert fires, based on the alert’s label key-value pairs matching the configured routing policies.
More details about notification in Docs: Notifications | Grafana documentation