deadtrickster / prometheus.erl

Prometheus.io client in Erlang
MIT License
341 stars 117 forks source link

Cumulative counters in histograms are exposed in scientific format #130

Open surik opened 3 years ago

surik commented 3 years ago

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?