Negative Match In Alertmanager Routing

33 views
Skip to first unread message

Sakshi Bansal

unread,
Jul 30, 2020, 3:03:50 AM7/30/20
to Prometheus Users
Hello,

Currently we have match and match_re keys to enable matching for alert routing. Is there an option to enable 'negative match' in alert routing. For e.g., the alert does not match a specific value and only then it should get routed. 

Brian Candler

unread,
Jul 30, 2020, 3:43:42 AM7/30/20
to Prometheus Users
Routing rules nest, so creative use of the routes tree will probably do what you need:

routes:
- match_re:
    foo: 'abc.*'
  routes:
    - match_re:
        bar: 'def.*'
      receiver: null
    - receiver: someone

Aleksandar Ilic

unread,
Sep 18, 2020, 9:24:13 AM9/18/20
to Prometheus Users
Hi,

Looking at this post i have one more question how could you go about sending one specific alert only to one receiver even if its matched for both of them?

Brian Candler

unread,
Sep 18, 2020, 1:44:56 PM9/18/20
to Prometheus Users
I don't understand what you mean by "matched for both of them".  The first routing rule to match wins, unless you set "continue: true" on that rule.

If you want to send a specific alert to one receiver, then make a rule which matches that alert and sends it to only that receiver.
Reply all
Reply to author
Forward
0 new messages