fix(datadog metrics sink): fix metric type comparison using wrong operand in sort#25621
Open
gwenaskell wants to merge 1 commit into
Open
fix(datadog metrics sink): fix metric type comparison using wrong operand in sort#25621gwenaskell wants to merge 1 commit into
gwenaskell wants to merge 1 commit into
Conversation
pront
approved these changes
Jun 15, 2026
pront
left a comment
Member
There was a problem hiding this comment.
Good catch! Please add a changelog entry.
Member
@gwenaskell Please clarify. If the unit tests did cover this typo, it should have been failing to start with, so it would seem this code path is not actually covered. |
bruceg
requested changes
Jun 15, 2026
bruceg
left a comment
Member
There was a problem hiding this comment.
The fix looks correct but it needs a coverage test and changelog entry.
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.
Summary
In
sort_and_collapse_counters_by_series_and_timestamp, the second tuple of the.cmp()call was incorrectly usinga.value().as_name()instead ofb.value().as_name(). This caused the metric type name (counter/gauge/histogram) to always compare equal to itself, making it a no-op as a sort key. The sort was effectively only ordering byseries()andtimestamp(), not by metric type name as intended.Vector configuration
No configuration change — this is an internal sink implementation fix.
How did you test this PR?
Existing unit tests in
sort_and_collapse_counters_by_series_and_timestampcover this code path.Change Type
Is this a breaking change?
Does this PR include user facing changes?
no-changeloglabel to this PR.References
Made with Cursor