fix: drop invalid OpenMetrics 2.0 exemplars instead of failing exposition - #970
Open
dashpole wants to merge 2 commits into
Open
fix: drop invalid OpenMetrics 2.0 exemplars instead of failing exposition#970dashpole wants to merge 2 commits into
dashpole wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates OpenMetrics 2.0 exposition handling to drop invalid exemplars while preserving valid metric output.
Changes:
- Centralizes exemplar timestamp validation.
- Drops exemplars with invalid timestamps or labels.
- Adds regression coverage for invalid exemplars.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
expfmt/openmetrics_2_0_create.go |
Implements exemplar validation and dropping behavior. |
expfmt/openmetrics_2_0_create_test.go |
Tests invalid exemplar handling. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
dashpole
marked this pull request as ready for review
August 24, 2026 17:03
bwplotka
reviewed
Aug 24, 2026
…tion Per the OpenMetrics 2.0 specification failure modes, failures specific to exemplars should not cause the entire exposition to fail. Invalid exemplars (e.g. invalid timestamps, malformed labels) are now dropped so that the rest of the metric exposition succeeds. Signed-off-by: David Ashpole <dashpole@google.com>
dashpole
force-pushed
the
fix-om20-exemplars
branch
from
August 24, 2026 17:34
4813e7a to
b4b469e
Compare
…are dropped Signed-off-by: David Ashpole <dashpole@google.com>
dashpole
force-pushed
the
fix-om20-exemplars
branch
from
August 24, 2026 17:36
b4b469e to
223e26b
Compare
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.
Small follow-up to #894.
Per the OpenMetrics 2.0 specification failure modes, failures specific to exemplars should not cause the entire exposition to fail. Invalid exemplars (e.g. invalid timestamps, malformed labels) are now dropped so that the rest of the metric exposition succeeds.
This also consolidates exemplar timestamp validation in
validateExemplar20.