【发布时间】:2022-12-02 05:49:53
【问题描述】:
I need to send a specific alert to multiple channels on Slack through alertmanager via a prometheus .yml file.
At the moment my current config is one to one, meaning one alert to one channel. Therefore the alert \' vs_replica_sql_slave_status\' goes to \'slack_monitoring_prod\'
prometheus.yml:
groups:
- name: vs_replica_sql_slave_status
rules:
- alert: vs_slave_status
for: 2m
expr: (mysql_global_status_slave_running{instance=~\"vs-replica.+\",alias!~\"vs-replica-test\",alia
labels:
severity: \"critical\"
annotations:
identifier: \"{{ $labels.alias }}\"
description: \"Slave Status not running\"
alertmanager.yml:
routes:
- match:
severity: critical
receiver: slack_monitoring_prod
I need to send the alert to another channel as well which is:
- match:
severity: critical_dwh
receiver: critical_dwh
In the first block of code I have labels > severity > critical which points to first channel. Is it possible to add another label that will point to the second channel or will this break the whole config? i.e:
labels:
severity: \"critical\"
severity: \"critical_dwh\"
Any suggestion or methods on how to perform this would be greatly appreciated.
标签: prometheus prometheus-alertmanager alertmanager