PromQL to identify targets which are failing continuously in last 5 minutes

163 views
Skip to first unread message

Narendra Gudipudi

unread,
Sep 23, 2021, 10:42:09 PM9/23/21
to Prometheus Users
Hi,

I am using blackbox exporter to probe my targets. I am trying to write a PromQL to identify and alert every 5 minutes with details of targets which are continuously failing in the last 5 minutes. Any help here is greatly appreciated.

I run my probers every 1 minute;
9:00 AM
probe_success {url="https:/url1"} = 1
probe_success {url="https:/url2"} = 0
probe_success {url="https:/url3"} = 0
probe_success {url="https:/url4"} = 1

9:01 AM
probe_success {url="https:/url1"} = 1
probe_success {url="https:/url2"} = 0
probe_success {url="https:/url3"} = 0
probe_success {url="https:/url4"} = 0

9:02 AM
probe_success {url="https:/url1"} = 1
probe_success {url="https:/url2"} = 0
probe_success {url="https:/url3"} = 0
probe_success {url="https:/url4"} = 1

9:03 AM
probe_success {url="https:/url1"} = 1
probe_success {url="https:/url2"} = 0
probe_success {url="https:/url3"} = 0
probe_success {url="https:/url4"} = 1

9:04 AM
probe_success {url="https:/url1"} = 1
probe_success {url="https:/url2"} = 0
probe_success {url="https:/url3"} = 0
probe_success {url="https:/url4"} = 0

9:05 AM
probe_success {url="https:/url1"} = 1
probe_success {url="https:/url2"} = 0
probe_success {url="https:/url3"} = 0
probe_success {url="https:/url4"} = 1

I am looking for some help with query which gives me these two URLs -
https:/url2
https:/url3
as these were continuously failing in the last 5 mins.

Ben Kochie

unread,
Sep 23, 2021, 11:11:40 PM9/23/21
to Narendra Gudipudi, Prometheus Users
avg_over_time(probe_success[5m]) == 0

--
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/2eebbd5f-08df-4694-b589-ab5cb2c7031en%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages