我是Prometheus ms-teams警报管理员的新手。我想将警报发送到多个渠道。下面是我的代码供参考:
receivers:
- name: default-receiver
# slack_configs:
# - channel: '@you'
# send_resolved: true
- name: prometheus-msteams
webhook_configs:
- url: "http://prometheus-msteams.monitoring:2000/alertmanager"
send_resolved: true
- name: prometheus-msteams_1
webhook_configs:
- url: "http://prometheus-msteams.monitoring:2000/alertmanager_1"
send_resolved: true
route:
group_by: ['alertname']
group_interval: 5m
repeat_interval: 15m
group_wait: 30s
receiver: 'prometheus-msteams'
routes:
- receiver: prometheus-msteams
- receiver: prometheus-msteams_1
此处它仅向路由中首先写入的一个通道发送警报。在这种情况下,向 prometheus-msteams 频道发送警报。
预先感谢, -同样。
答案 0 :(得分:0)
默认情况下,alertmanager在第一条匹配的路线上停止。你应该说他继续。
route:
group_by: ['alertname']
group_interval: 5m
repeat_interval: 15m
group_wait: 30s
receiver: 'prometheus-msteams'
routes:
- receiver: prometheus-msteams
continue: true # <---- continue matching
- receiver: prometheus-msteams_1
https://prometheus.io/docs/alerting/latest/configuration/
# Whether an alert should continue matching subsequent sibling nodes.
[ continue: <boolean> | default = false ]