Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

route matching multiple labels

I am not getting alertmanager to send alerts based on multiple labels.

In general sending e-mails on alerts is working. But only if there is a simple match on one label. E.g. teamB route is working. teamA route is not.

route:
  receiver: default-receiver
  routes:
  - receiver: teamA
    match:
      environment: production
    match_re:
      job: ^(?:app2| app3)$
  - receiver: teamB
    match:
      application: app1
      environment: production
receivers:
- name: default-receiver 
- name: teamA
- name: teamB

The syntax seems correct as there is no error message on loading alertmanager:

019-07-24T08:03:59.242791707Z level=info ts=2019-07-24T08:03:59.242607527Z caller=main.go:334 msg="Loading configuration file" file=/etc/alertmanager/config.yml

What's wrong with the teamA route?

I am using https://prometheus.io/webtools/alerting/routing-tree-editor/ to analyze the issue. The code above can simply be copied over to that editor to visualize the results of given label sets.

like image 265
Christian Schyma Avatar asked Oct 27 '25 18:10

Christian Schyma


1 Answers

{environment="production", job="app2"} goes to teamA as I'd expect, I suspect the issue is the leading space before app3.

like image 161
brian-brazil Avatar answered Oct 29 '25 07:10

brian-brazil



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!