PromQL prolong alert 30 minutes

5 views
Skip to first unread message

fiala...@gmail.com

unread,
Jan 28, 2021, 2:37:50 AM1/28/21
to Prometheus Users
Hi,

I have a simple rule for monitoring traffic drop (by 20% in last 15 minutes):

some_traffic_metric < (some_traffic_metric offset 15m * 0.8)

I need this alert to be active for at least 30 minutes. 

Please help, how to rewrite the query.

Thank you.

Matthias Rampke

unread,
Jan 28, 2021, 3:41:11 AM1/28/21
to fiala...@gmail.com, Prometheus Users
Try `min_over_time` on a subquery:

min_over_time(( some_traffic_metric / some_traffic_metrics offset 15m)[30m:]) < 0.8

/MR

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/1def3a6c-4804-4782-af0e-0109b05011dfn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages