prometheus-alertmanager

Prometheus AlertManager - Send Alerts to different clients based on routes

孤街醉人 提交于 2019-12-10 15:45:02
问题 I have 2 services A and B which I want to monitor. Also I have 2 different notification channels X and Y in the form of receivers in the AlertManager config file. I want to send to notify X if service A goes down and want to notify Y if service B goes down. How can I achieve this my configuration? My AlertManager YAML file is: route: receiver: X receivers: - name: X email_configs: - name: Y email_configs: And alert.rule files is: groups: - name: A rules: - alert: A_down expr: expression for:

How to make Prometheus alert description give both ratio and absolute numbers?

痴心易碎 提交于 2019-12-01 10:28:23
问题 I currently have a Prometheus alert that fires when my success rate drops below 85%. I would like to add the absolute numbers of the ratio to the alert description. How do I do that? My YAML currently looks like this (I cleaned up some extraneous details): groups: - name: recording_rules rules: - record: number_of_successes_24h expr: avg(sum by(instance)(my_status{kubernetes_name="my-prom",timeRange="1d",status=~"success"})) - record: number_of_total_24h expr: avg(sum by(instance)(my_status