Skip to content

om2/summary: allow negative Sum and Quantile values - #3150

Open
dashpole wants to merge 1 commit into
prometheus:om2-rc1from
dashpole:om2-summary-negative-values
Open

dashpole wants to merge 1 commit into
prometheus:om2-rc1from
dashpole:om2-summary-negative-values

Conversation

@dashpole

Copy link
Copy Markdown
Contributor

Allow Summary metrics in OpenMetrics 2.0 to expose negative Sum and Quantile values when negative event values are observed:

  • Clarify that Count is a counter semantically (MUST NOT be NaN or negative and MUST be an integer), while Sum MUST NOT be NaN and is only a counter semantically as long as there are no negative event values measured by the Summary (matching the existing Histogram wording).
  • Remove the 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_golang and client_java) and Prometheus's OpenMetrics parsers (see prometheus/prometheus#19894 (comment)).

Signed-off-by: David Ashpole <dashpole@google.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 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
dashpole marked this pull request as ready for review October 21, 2026 18:44

@krajorama krajorama 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.

LGTM, we're still different from Histograms in that NaN is not allowed in Sum, but let's discuss that separately.

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.

3 participants