路线匹配多个标签

时间:2019-07-24 08:27:49

标签: prometheus prometheus-alertmanager

我没有让Alertmanager根据多个标签发送警报。

通常,可以发送有关警报的电子邮件。但前提是一个标签上有简单的匹配项。例如。 teamB路由正在运行。 teamA路线不是。

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

语法似乎正确,因为在加载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

teamA路线出了什么问题?

我正在使用https://prometheus.io/webtools/alerting/routing-tree-editor/来分析问题。可以将上面的代码简单地复制到该编辑器中,以可视化给定标签集的结果。

1 个答案:

答案 0 :(得分:1)

{environment="production", job="app2"}进入了teamA,我怀疑问题是app3之前的领先地位。

相关问题