[1617] Add ConstnativeHistogram by shivanthzen · Pull Request #1654 · prometheus/client_golang (original) (raw)

It sounds like you are thinking about a float histogram. That's something we might want to add later (ideally together with the option of creating classic float histograms). However, the use case for float histograms in instrumentation is very rare.

I am in fact talking about a gauge histogram. It merely requires to set a different MetricType in the MetricFamily. However, I've just realized that we currently have no way of communicating the difference of counter histogram (i.e. the "normal" histogram) and gauge histogram during metrics collection. For that, we needed Desc to have a metric type field (which was the plan for quite some time).

So I'm pretty sure we cannot solve this problem in this PR, because it needed too much re-architecting.

But if we assume that the difference between counter histogram and gauge histogram will be in the Desc, we actually don't need a bool parameter here, but just have to later allow the option of creating "typed" Descs.

In conclusion, let's not do gauge histograms right now.