docs icon indicating copy to clipboard operation
docs copied to clipboard

feat(om2): add native histograms to OpenMetrics2.0

Open krajorama opened this issue 8 months ago • 2 comments

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

See OpenMetrics2.0 WG meeting notes tab

krajorama avatar Apr 24 '25 15:04 krajorama

Note self: add details how summaries and classic histograms one liners (so not NHCB spans/deltas) fit into it.

krajorama avatar May 06 '25 14:05 krajorama

I've just realized that I have not implemented multiple exemplars in the ABNF. I'll do that once I rebase on #2636

krajorama avatar Jun 03 '25 14:06 krajorama

Just one more note from my side. (But as said, I'm not authorized to approve OMv2 related things.)

beorn7 avatar Sep 03 '25 12:09 beorn7

I'm planning to go through this, but looks generally good!

bwplotka avatar Sep 03 '25 13:09 bwplotka

My comments have all been addressed. (I just don't approve this for the reasons stated previously.)

beorn7 avatar Sep 03 '25 15:09 beorn7