prometheus.erl icon indicating copy to clipboard operation
prometheus.erl copied to clipboard

Cumulative counters in histograms are exposed in scientific format

Open surik opened this issue 4 years ago • 0 comments

After updating prometheus.erl from 4.6.0 to 4.8.1 I noticed that le float counters are formatted using scientific notation.

I think this maybe be related to changes done here https://github.com/deadtrickster/prometheus.erl/pull/121

bound_to_label_value(Bound) when is_float(Bound) ->
  float_to_list(Bound);

which does float_to_list(Bound,[{scientific,20}])

Although this can be processed by Prometheus but breaks the monotonicity of buckets, see screenshot (deployment at around 12:10 with new prometheus.erl)

image

Should we consider using float_to_list(Bound, [{decimals, 20}, compact]). for backwardcompatability and monotonicity?

surik avatar Aug 04 '21 13:08 surik