Skip to content

om2/migration: document negative and float value changes - #3166

Open
krajorama wants to merge 2 commits into
mainfrom
krajo/om2-migration-negative-values
Open

krajorama wants to merge 2 commits into
mainfrom
krajo/om2-migration-negative-values

Conversation

@krajorama

@krajorama krajorama commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

TL;DR: I'm not sure we need this actually. Talks about niche use cases.

Summary

  • Adds a "Negative and Float Values" section and a Quick Reference row to the OM 2.0 migration guide.
  • Covers the OM 1.0 to 2.0 relaxations: negative histogram and summary Sum, negative summary quantile values, and float Count/bucket/Gcount values (previously integers only).
  • Notes that a histogram with negative threshold buckets can no longer omit its sum (cross-linked from "Sum and Count Required").
  • Lists the rules that did not change (non-negative counts and GaugeHistogram bucket values, negative classic thresholds, negative Gsum), so om2/gaugehistogram: prohibit negative count and bucket values #3139 (Gcount/bucket values must not be negative) is not misread as a delta from 1.0.

Follow-up to #3139 and #3150, so the guide matches the spec before om2-rc1 goes to main.

Test plan

  • OM 2.0 examples added to the guide parse with the spec ABNF grammar.
  • Rules in the new section checked against the OM 1.0 spec and the om2-rc1 2.0 spec text.
  • Diff is additive only; unrelated formatting left untouched (the guide is not in MD_FILES_TO_FORMAT).

OM 1.0 required histogram and summary sums and summary quantile values
to be non-negative, and required histogram counts and bucket values to
be integers. Histograms with negative threshold buckets had to omit the
sum. Document the OM 2.0 relaxations (negative sums and quantiles, float
counts and buckets) and the unchanged rules.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
@krajorama krajorama mentioned this pull request Oct 29, 2026
2 tasks done
Base automatically changed from om2-rc1 to main October 30, 2026 07:11

@bwplotka bwplotka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit, otherwise LGTM!

temperature_celsius_bucket{le="0.0"} 5
temperature_celsius_bucket{le="10.0"} 9
temperature_celsius_bucket{le="+Inf"} 10
temperature_celsius_count 10

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In OM 1.0, _count is only exposed when _sum is present per open_metrics_spec.md#L742, so a histogram with negative threshold buckets had to omit _count too, just like in the example at line 463 above:

Suggested change
temperature_celsius_count 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants