how to get alerts count ,how many times the alerts fired for last one week in prometheus

Viewed 919

sum by(alertname) (changes(ALERTS_FOR_STATE[24h])) this is giving me all the states. i need only like only how many alerts went to critical for last one week (already fired). need assist please.

thanks in advance

1 Answers

The grafana alert engine publishes some internal metrics about itself, these metrics might help you to solve your requirement.

Description
Total number of alerts
Alert execution result
Notifications sent counter
Alert execution timer

You can read more on internal metrics here and here

Related