On Saturday, 27 August 2022 at 13:33:33 UTC+1 Brian Candler wrote:

> You want to know how long have they been down? Do the same as you did with 
> node_boot_time_seconds:
>
> *    time() - max_over_time((time() * up)[24h:]) unless up == 1*
>

On reflection, I think the following is a slightly better version:

*    time() - max_over_time((time() * up)[24h:]) and up == 0*

The only difference is, if you remove a target from the scrape job, this 
will also suppress the value.  That is: you'll only be told that the 
machine has been down for N seconds, if the machine is still being scraped 
*and* is still down.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/8d561a39-393b-4c36-8866-8fc0ee066408n%40googlegroups.com.

Reply via email to