Skip to content

bugfix sort after merging histogram metrics#7380

Merged
yeya24 merged 2 commits intocortexproject:masterfrom
Shvejan:master
Mar 27, 2026
Merged

bugfix sort after merging histogram metrics#7380
yeya24 merged 2 commits intocortexproject:masterfrom
Shvejan:master

Conversation

@Shvejan
Copy link
Copy Markdown
Contributor

@Shvejan Shvejan commented Mar 26, 2026

What this PR does:
Add sort.Slice() to sort buckets by UpperBound in ascending order after building from the map. This matches the Prometheus client library's approach:

Which issue(s) this PR fixes:
Fixes #7379

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [BUGFIX]

Signed-off-by: Shvejan Mutheboyina <shvejan@amazon.com>
Copy link
Copy Markdown
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

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

Thanks

Co-authored-by: SungJin1212 <tjdwls1201@gmail.com>
Signed-off-by: Ben Ye <yb532204897@gmail.com>
@yeya24 yeya24 merged commit c9f30dc into cortexproject:master Mar 27, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: mergeHistogram produces non-deterministic bucket order causing flaky tests

3 participants