alertsfilteredbbynamespace

14 views
Skip to first unread message

Bohr Zhong

unread,
Jan 14, 2021, 2:27:41 PM1/14/21
to Prometheus Users
Anyone knows how to configure alermanager routing to filter the alerts from different namespace into different targets?

something like:
   match:
         namespace: teamA
   receiver: teamA-pagerduty
        continue: true

But namespace is not part of alert labels. Alerts are created from kube-state-metrics but we would like to group the alerts based on the namespace. and route to a different pager duty endpoint.



Julius Volz

unread,
Jan 17, 2021, 4:33:53 AM1/17/21
to Bohr Zhong, Prometheus Users
Hi Bohr,

Alertmanager can only group and route on labels that are part of the alert labels. It has no other concept of "namespaces" or such, it just knows about arbitrary labels that are attached to the incoming alerts. So you will need to ensure on the Prometheus side that your alerting rules preserve the "namespace" label everywhere if you want to route alerts based on it in Alertmanager. In general it's a good practice to not aggregate away any labels in alerting rules that you don't want to explicitly get rid of, so that you still have that information in Alertmanager.

Regards,
Julius

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/e673ac15-59bd-422f-bd07-d22b534d67b7o%40googlegroups.com.


--
Julius Volz
PromLabs - promlabs.com
Reply all
Reply to author
Forward
0 new messages