Repository navigation
Conversation
Signed-off-by: David Ashpole <dashpole@google.com>
There was a problem hiding this comment.
🟢 Approval recommended
Both specification changes match the stated intent, with no unresolved review findings.
No open issues 🎉
What changed in this PR
Updates OpenMetrics 2.0 Summary semantics to support negative observations.
Changes:
- Allows negative Sum values while preserving Count constraints and prohibiting NaN sums.
- Removes the restriction against negative quantile values.
| File | Description |
|---|---|
| docs/specs/om/open_metrics_spec_2_0.md | Revises Summary constraints to permit negative sums and quantile values. |
Review effort: Balanced
dashpole
marked this pull request as ready for review
October 21, 2026 18:44
krajorama
approved these changes
Oct 22, 2026
krajorama
left a comment
Member
There was a problem hiding this comment.
LGTM, we're still different from Histograms in that NaN is not allowed in Sum, but let's discuss that separately.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allow
Summarymetrics in OpenMetrics 2.0 to expose negativeSumandQuantilevalues when negative event values are observed:Countis a counter semantically (MUST NOT be NaN or negativeandMUST be an integer), whileSumMUST NOT be NaNand is only a counter semantically as long as there are no negative event values measured by theSummary(matching the existingHistogramwording).Quantile values MUST NOT be negative.restriction so summaries observing negative values can expose negative quantile values.This aligns the specification with existing instrumentation libraries (such as
client_golangandclient_java) and Prometheus's OpenMetrics parsers (see prometheus/prometheus#19894 (comment)).