veera
veera

Reputation: 31

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

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

Upvotes: 3

Views: 1996

Answers (1)

Ajamal Khan
Ajamal Khan

Reputation: 79

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

Upvotes: -1

Related Questions