Native histogram example
Hello all 👋 With native histograms coming up could we add a best practices example to this library as well? I think it would be super useful. I went by the tests and API but it took a bit to understand how to create it to be compatible. Hopefully adding an example that is per best practices would help folks get it right and adopt it more.
cc @beorn7 @bwplotka @kakkoyun
The "random" example already uses a native histogram:
https://github.com/prometheus/client_golang/blob/5d937cd915c54803b5c46a276d6a5b731f26670c/examples/random/main.go#L66
It doesn't add NativeHistogramMaxBucketNumber and NativeHistogramMinResetDuration, but I'm not even sure if it should. (Arguably, if we believe that people should set this by default, we should set a reasonable default. It's just so hard in Go to have non-zero defaults while still allowing the user to set an actual zero explicitly.)
We could, of course, use those options in the example and explain them there.
We could, of course, use those options in the example and explain them there.
Sounds good, maybe one example with simple default (like now, missed that as it was under random) and then one where a user might want to finetune things and when. Could be useful to be under examples/histograms, what do you think?
I leave it to @bwplotka and @kakkoyun to pick the right format and location. Happy to help with the wording, once we have arrived at that point.