How can I send alerts with different labels to the same receiver in prometheus alert manager config?

638 views Asked by At

I need to route the alert to dev-receiver if it has the label dbinstance_identifier: '^(dev-db)$' or namespace: '^(dev)$. I don't think the below one works as the bottom one may override the top one. Can I put some or operator b/w two labels or something? Thanks in advance.

-receiver: 'dev-receiver'
    match_re:
       dbinstance_identifier: '^(dev-db)$'
- receiver: 'dev-receiver'
     match_re:
       namespace: '^(dev)$

1

There are 1 answers

0
bobs On

match_re and match are deprecated in newer version. Use matchers instead as follows:

- receiver: 'dev-receiver'
  matchers:
    - dbinstance_identifier =~ "^(dev-db)$"
- receiver: 'dev-receiver'
  matchers:
    - namespace =~ "^(dev)$"

You can use continue: true as stated in the comment of your question.