Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grafana alert / value equals zero

I have the prometheus query = sum by (job) (rate(http_requests_total[5m]))

Could you tell how can I create alert in grafana when the value is equal zero (longer than given time)

I cannot find proper function

like image 816
user3740179 Avatar asked Oct 18 '25 00:10

user3740179


1 Answers

Let's say you want an alert to fire when the 5m average has been zero for more than 5 minutes:

enter image description here

If you dislike the is below 0.01 you can turn the query into a boolean one like so:

sum by (job) (rate(http_requests_total[5m])) == bool 0

Now you will get a 1 if the rate is 0 and 0 if the rate is not 0.

like image 159
trallnag Avatar answered Oct 19 '25 19:10

trallnag