CounterMetricFamily returns float values #1165
-
|
I'm wrapping an application's telemetry into a format suitable for prom. I might misunderstand the documentation at https://prometheus.github.io/client_python/collector/custom My expectation for counters is that they are ever increasing integers. The CounterMetricFamily sets float values, if you pass an integer in its constructor value kwarg. In the example, if you register a CounterMetricsFamily, assigning an int value, the value comes back as the float value of the integer. For example, if you set the value to 4, it gets reported as 4.0 This makes sense, since the code of the implementation is setting the value explicitly as a float in its constructor. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
This is the expected behavior, in Prometheus everything is handled as float64 values in the database so there is no reason to try to handle int and floats separately. |
Beta Was this translation helpful? Give feedback.
This is the expected behavior, in Prometheus everything is handled as float64 values in the database so there is no reason to try to handle int and floats separately.