2

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

user3740179
  • 133
  • 10

1 Answers1

1

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.

trallnag
  • 2,041
  • 1
  • 17
  • 33