Hi there,

I have a question relative to Gauge and booleans, if you don't mind.

I'm considering to use a gauge to reflect the evolution of a boolean value.

Knowing that the set method of a Gauge cast the given value as a float, I 
could call directly my_gauge.set(my_bool_value), and have it set to 0.0 or 
1.0.

So the question here is: Is the casting as float part of the API design, or 
simply an implementation detail which may change?

If we have no guarantee that this cast will remain, then the call to set 
needs to be protected by my_gauge.set(float(my_bool_value)), but it is a 
pity to call it twice...

It's a nice built in capability, so if it is going to last, I may argue 
that it would be worth mentioning it explicitly somewhere, either in the 
doc of the *set* function or the documentation of the Gauge 
(https://github.com/prometheus/client_python#gauge).

Thanks in advance!

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Developers" 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-developers/ffcee28e-d367-4897-8b30-ff5a1e28daean%40googlegroups.com.

Reply via email to