Apply share_labels/target_info tags regardless of payload order - #24884
Open
ian28223 wants to merge 2 commits into
Open
Apply share_labels/target_info tags regardless of payload order#24884ian28223 wants to merge 2 commits into
ian28223 wants to merge 2 commits into
Conversation
ian28223
added a commit
that referenced
this pull request
Aug 17, 2026
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: fedf0af | Docs | Datadog PR Page | Give us feedback! |
evalya-impact-summaryevalya impact analysis |
ian28223
added a commit
that referenced
this pull request
Aug 17, 2026
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
ian28223
force-pushed
the
ian.bucad/fix_openmetrics_share_labels_ordering
branch
from
August 17, 2026 09:07
79836cf to
3a0e577
Compare
ian28223
marked this pull request as ready for review
August 17, 2026 09:07
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3a0e577f88
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…d order LabelAggregator collected and yielded metrics in the same interleaved pass: a metric processed before its shared-label source metric was reached in the payload would be yielded without the shared tags, while the same metric on a later scrape (once shared_labels_cached is True) would have them applied. For a monotonic counter, that tag-set change looks like a brand new context to the aggregator, and combined with the scraper-wide flush_first_value flag already being true by the second scrape, its full raw counter value gets flushed as if it were a single interval's delta instead of a small diff. Buffer metrics only until every configured shared-label source has been found, then yield the buffered prefix and continue streaming the rest, so tagging no longer depends on payload order without buffering the entire response into memory. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
ian28223
force-pushed
the
ian.bucad/fix_openmetrics_share_labels_ordering
branch
from
August 17, 2026 11:56
3a0e577 to
fedf0af
Compare
Contributor
Validation ReportAll 21 validations passed. Show details
|
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.
What does this PR do?
Fixes
LabelAggregator(OpenMetrics V2) soshare_labels/target_infotags are collected from the full scrape payload before any metric is yielded, instead of interleaving collection with yielding.Motivation
flush_first_valueflag already beingTrueby the second scrape, its full raw counter value gets flushed as a single interval's delta instead of a small diff.rabbitmq.queue.messages.acked.countspiking to the counter's entire lifetime total on Agent restart); reproduces identically on the genericopenmetricscheck, confirming it's a base-check issue.Review checklist (to be filled by reviewers)
qa/requiredif this PR needs QA validation, orqa/skip-qaif it does not. Exactly one of the two is required.backport/<branch-name>label to the PR and it will automatically open a backport PR once this one is merged