【问题标题】:Prometheus 'labels'普罗米修斯“标签”
【发布时间】: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


    【解决方案1】:
    猜你喜欢
    • 2022-12-22
    • 2020-01-10
    • 2020-11-12
    • 1970-01-01
    • 2022-01-22
    • 2021-07-20
    • 1970-01-01
    • 2017-09-03
    • 1970-01-01
    相关资源
    最近更新 更多