knsd / ping-exporter

Prometheus ICMP ping exporter
57 stars 16 forks source link

Comparison with blackbox_exporter #5

Open rustycl0ck opened 4 years ago

rustycl0ck commented 4 years ago

Just curious if there is a reason why someone would want to use this over https://github.com/prometheus/blackbox_exporter (or vice versa)?

adamcstephens commented 4 years ago

Here's an example of the different metrics between the two:

blackbox_exporter:

# 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 0.003130304                                                                                                                                                              
# HELP probe_duration_seconds Returns how long the probe took to complete in seconds                                                                                                                   
# TYPE probe_duration_seconds gauge                                                                                                                                                                    
probe_duration_seconds 0.037783481                                                                                                                                                                     
# HELP probe_icmp_duration_seconds Duration of icmp request by phase
# TYPE probe_icmp_duration_seconds gauge
probe_icmp_duration_seconds{phase="resolve"} 0.003130304
probe_icmp_duration_seconds{phase="rtt"} 0.029949922
probe_icmp_duration_seconds{phase="setup"} 0.004284539
# HELP probe_ip_addr_hash Specifies the hash of IP address. It's useful to detect if the IP address changes.
# TYPE probe_ip_addr_hash gauge
probe_ip_addr_hash 1.664977422e+09
# 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 1

knsd/ping-exporter

# HELP ping_resolve_time Time it take to resolve domain to an IP address
# TYPE ping_resolve_time gauge
ping_resolve_time{count="5", ip="1.1.1.1", ping_timeout="1000", protocol="v4", resolve_timeout="1000", target="1.1.1.1"} 0
# HELP ping_packets_total Total number of sent pings
# TYPE ping_packets_total gauge
ping_packets_total{count="5", ip="1.1.1.1", ping_timeout="1000", protocol="v4", resolve_timeout="1000", target="1.1.1.1"} 5
# HELP ping_packets_success Total number of success pings
# TYPE ping_packets_success gauge
ping_packets_success{count="5", ip="1.1.1.1", ping_timeout="1000", protocol="v4", resolve_timeout="1000", target="1.1.1.1"} 5
# HELP ping_packets_failed Total number of failed pings
# TYPE ping_packets_failed gauge
ping_packets_failed{count="5", ip="1.1.1.1", ping_timeout="1000", protocol="v4", resolve_timeout="1000", target="1.1.1.1"} 0
# HELP ping_packets_loss A percentage of failed pings from the total pings
# TYPE ping_packets_loss gauge
ping_packets_loss{count="5", ip="1.1.1.1", ping_timeout="1000", protocol="v4", resolve_timeout="1000", target="1.1.1.1"} 0
# HELP ping_resolve_error Boolean metric if there's an error during the resolve (error message will be in "error" label)
# TYPE ping_resolve_error gauge
ping_resolve_error{count="5", ip="1.1.1.1", ping_timeout="1000", protocol="v4", resolve_timeout="1000", target="1.1.1.1"} 0
# HELP ping_times A histogram of round-trip times
# TYPE ping_times histogram
ping_times_count{count="5", ip="1.1.1.1", ping_timeout="1000", protocol="v4", resolve_timeout="1000", target="1.1.1.1"} 5
ping_times_bucket{le="12", count="5", ip="1.1.1.1", ping_timeout="1000", protocol="v4", resolve_timeout="1000", target="1.1.1.1"} 5
ping_times_bucket{le="+Inf", count="5", ip="1.1.1.1", ping_timeout="1000", protocol="v4", resolve_timeout="1000", target="1.1.1.1"} 5
ping_times_min{count="5", ip="1.1.1.1", ping_timeout="1000", protocol="v4", resolve_timeout="1000", target="1.1.1.1"} 12
ping_times_max{count="5", ip="1.1.1.1", ping_timeout="1000", protocol="v4", resolve_timeout="1000", target="1.1.1.1"} 12
ping_times_sum{count="5", ip="1.1.1.1", ping_timeout="1000", protocol="v4", resolve_timeout="1000", target="1.1.1.1"} 60
baryluk commented 2 years ago

It looks like compared to blackbox_exporter the ping_exporter can do multiple ping probes. Such feature I think would be useful to be added in blackbox_exporter probably, but is not critical really for monitoring most of the time.

However, if one wants a details like this smokeping_exporter is even better option. It does continuous pinging every second in the background (not on scrape time), and exports counters instead of current probe result.