The normal case in the situation where an exporter cannot reach a backend
is to just not return the backend metrics at all, but expose a
<mybackend>_up metric by the exporter that is set to 1 if the backend is
reachable and 0 if it's down. For example, "haproxy_up" in the HAProxy
Exporter or "mysql_up" in the MySQLd Exporter. Then you can alert on that.

If you really would like to keep exposing the backend time series even if
you cannot gather data for them, then you could set them to NaN
("float('nan')" in Python).

On Sat, May 23, 2020 at 2:12 AM Humberto Ramos Costa <[email protected]>
wrote:

> I'm using the Prometheus python lib to create a exporter.
> This exporter gets data from another apllication running on the same
> machine.
> There are some situations where i can't get the data and i woul like to
> set the metrics (Gauge in this case) with nodata (like None in python).
>
> --
> 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/4fb450f2-52a6-4a51-9177-0cb48fe66020%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/4fb450f2-52a6-4a51-9177-0cb48fe66020%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Julius Volz
PromLabs - promlabs.com

-- 
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/CAObpH5wMmrdaJGWZRY7M3-rKLTKFAzUcsAFChAdC6ROjg3Ztjg%40mail.gmail.com.

Reply via email to