feat(om2): add native histograms to OpenMetrics2.0
Background
Based on https://github.com/prometheus/proposals/blob/main/proposals/2024-01-29_native_histograms_text_format.md And OpenMetrics 2.0 WG discussions.
Changes
- Allow structured complex types marked by "{" and "}" in the specification.
- Allow multiple exemplars per complex type value.
- ~Require that exemplars for complex type values have the timestamp.~ (1)
- Be permissive about observing NaN , +Inf, -Inf. Discourage observing NaN.
- Split histogram into ones with classic and native buckets.
- For classic buckets, define behavior when observing NaN.
- Define the native buckets and also how NaN is handled.
- Define the text format of native histograms and also their exemplars.
- Define float and integer version of native histograms.
(1) Not doing this on account of being an implementation limitation and also contradicts having backwards compatibility when exposing classic histograms as complex type.
Open questions / decisions
Note self: add details how summaries and classic histograms one liners (so not NHCB spans/deltas) fit into it.
I've just realized that I have not implemented multiple exemplars in the ABNF. I'll do that once I rebase on #2636
Just one more note from my side. (But as said, I'm not authorized to approve OMv2 related things.)
I'm planning to go through this, but looks generally good!
My comments have all been addressed. (I just don't approve this for the reasons stated previously.)