Alert Manager notification by label

506 views
Skip to first unread message

sunils...@gmail.com

unread,
Nov 16, 2020, 10:08:51 AM11/16/20
to Prometheus Users
Hi , 

I have configured Prometheus Alert Manager for dev, qa and prod env. 
But I want to send notification mail for only prod environment . However,  I want to see dev and uat also in Alert Manager portal . 

Below are the labels I have :

alertname
env
host
severity=mail

Configuration at Alert Manager : 
route:
  group_by: ['alertname']
  group_wait: 5m
  group_interval: 5m
  repeat_interval: 24h
  receiver: 'email-me'

receivers:
- name: 'email-me'
  email_configs:
  -to : 'em...@domain.com'
   from: someid
   smarthost: mail_server
inhibit_rules:
  - source_match:
       env: 'prod'
     target_match:
       severity:  'warning'
    equal: ['alertname', 'dev', 'instance']


Even though I am setting source_match , env=prod . I am receiving alert for dev and qa env . 

Thanks, 

Matthias Rampke

unread,
Nov 16, 2020, 10:34:08 AM11/16/20
to sunils...@gmail.com, Prometheus Users
I think this is a misunderstanding about inhibit rules, they will not help with your use case. Use an additional route to match the environment and send dev/qa to a different receiver (which may not have any configs, so go nowhere).

Inhibit rules specify how one *alert* can inhibit (~silence) another – say, you have an alert that says "the whole datacenter is down", you can use inhibit rules to prevent all other alerts from notifying.

/MR


--
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/b1eac291-5fd9-4e70-89ce-225929625da2n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages