Skip to content

Fix leading zero handling in native histograms implementations - #6033

Merged
zalegrala merged 3 commits into
grafana:mainfrom
zalegrala:nativeHistogramLeadingZeroNewSeries
Jan 14, 2026
Merged

Fix leading zero handling in native histograms implementations#6033
zalegrala merged 3 commits into
grafana:mainfrom
zalegrala:nativeHistogramLeadingZeroNewSeries

Conversation

@zalegrala

@zalegrala zalegrala commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

What this PR does:

Here we ensure that the native histogram impelemtation apples the leading zero logic to both the classic (when using "both") and native implementations. This is to avoid an issue when new series are created with a null value, the transition from null -> x does not account for the first value written. In environments in which metrics are created and then age out, this can cause instability in the results.

Which issue(s) this PR fixes:
Related #2068
Related #4140

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]
@zalegrala zalegrala changed the title Ensure leading zero handling on "both" histograms implementaions Dec 5, 2025
@zalegrala
zalegrala marked this pull request as ready for review December 5, 2025 16:37
Comment thread modules/generator/registry/native_histogram.go
@zalegrala
zalegrala force-pushed the nativeHistogramLeadingZeroNewSeries branch 2 times, most recently from b4156ad to 4d4a9ac Compare January 9, 2026 15:24
@zalegrala
zalegrala force-pushed the nativeHistogramLeadingZeroNewSeries branch from 4d4a9ac to 01934af Compare January 13, 2026 14:41

@javiermolinar javiermolinar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@zalegrala
zalegrala merged commit b500ea9 into grafana:main Jan 14, 2026
22 checks passed
@zalegrala
zalegrala deleted the nativeHistogramLeadingZeroNewSeries branch January 14, 2026 17:33
mattdurham pushed a commit to mattdurham/tempo that referenced this pull request Jun 18, 2026
…na#6033)

* Ensure leading zero handling on "both" histograms implementaions

* Add test to cover native and "both" modes in native implementation

* Update changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants