Closed wudongwang closed 7 months ago
Hi @wudongwang,
this question would be better posted at https://groups.google.com/g/prometheus-users or a similar forum. The issue tracker is not the right place.
Apart from that, there is two things that come to mind immediately. a) If your prometheus retention is long enough query for active alerts in promql, see https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/#inspecting-alerts-during-runtime b) send all alerts via webhook to a service that persists these events. For example with this webhook-adapter https://github.com/cloudflare/alertmanager2es you can send all alerts to elasticsearch and then visualize them in kibana.
已通过查询表达式获取到数据:ALERTS_FOR_STATE:firing[1d]
How can I get a week's worth of alert history for Prometheus, Alertmanager via python script?