blackbox_exporter: probe_duration_seconds when probe_success == 0

1,654 views
Skip to first unread message

capta...@captainark.net

unread,
Jun 24, 2017, 4:51:52 AM6/24/17
to Prometheus Users
Hi,

I've started using Prometheus and blackbox_exporter yesterday.

I'm trying to display RTT and packet loss for my servers using Grafana.

However, I've noticed that, when the ping fails, I'm getting the timeout value I've configured (5 seconds) for the RTT :

curl "http://localhost:9115/probe?target=1.2.3.4&module=icmpv4"                                                                                          
# HELP probe_dns_lookup_time_seconds Returns the time taken for probe dns lookup in seconds                                                                                          
# TYPE probe_dns_lookup_time_seconds gauge  
probe_dns_lookup_time_seconds
8.812000000000001e-06                                      
# HELP probe_duration_seconds Returns how long the probe took to complete in seconds      
# TYPE probe_duration_seconds gauge          
probe_duration_seconds
5.000562537          
# HELP probe_ip_protocol Specifies whether probe ip protocol is IP4 or IP6                
# TYPE probe_ip_protocol gauge              
probe_ip_protocol
4                          
# HELP probe_success Displays whether or not the probe was a success                      
# TYPE probe_success gauge                  
probe_success
0

I end up with the following graph :

Is there any way to have those values considered as zero or null ?

Thanks !

Brian Brazil

unread,
Jun 25, 2017, 3:39:34 AM6/25/17
to capta...@captainark.net, Prometheus Users
You could do

probe_duration_seconds unless probe_success = 1

And make sure grafana shows missing as null. Note this time includes DNS resolution, which you may wish to subtract out.

--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/43e0c930-2001-454f-97c7-54757c4db887%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

capta...@captainark.net

unread,
Jun 25, 2017, 6:54:40 AM6/25/17
to Prometheus Users, capta...@captainark.net
I completely missed the 'unless' operator while reading the docs...

I've set up the query in grafana as follows :

probe_duration_seconds{hostname="$hostname", job="bbr_icmpv4"} - probe_dns_lookup_time_seconds{hostname="$hostname", job="bbr_icmpv4"} unless probe_success{hostname="$hostname", job="bbr_icmpv4"} == 0

And now the graphs look like this :


Thanks for your help !
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.

ninike

unread,
Feb 27, 2020, 5:34:27 AM2/27/20
to Prometheus Users
hello,I want to know how to calculate the packet loss, what is the calculation expression, through the probe_success indicator?can you help me? thanks!

在 2017年6月24日星期六 UTC+8下午4:51:52,capta...@captainark.net写道:
Reply all
Reply to author
Forward
0 new messages