I've tried counting the number of probe_success and multiplying it by the probe interval trying to get uptime in seconds and setting the value type to the total. the issue is the minimum step changes as the time frame changes not giving us a correct reading and nulling this option. What we are actually trying to do is get the percentage uptime based on successful probes in the time frame set for the dashboard. We are using singlestat to show the percentage
(probe_success{instance="www.google.com:443",job="clienttest"})*15
We tried dividing the value by an exporter its self to try to get a percentage that would also scale to no avail.
sum(probe_success{instance="www.google.com:443",job="clienttest"}) / sum(probe_success{instance="self",job="clienttest"}) *100
For a singlestat panel what you want to do is use just probe_success{instance="www.google.com:443",job="clienttest"}
as the expression, and under options make sure you are using the Average aggregation.
On the PromQL side you can also do avg_over_time(probe_success[1h])
, see this blog post.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With