Skip to content

fix(statsdreceiver): apply histogram max_size to the correct metric category#49418

Draft
shachar-ash wants to merge 2 commits into
open-telemetry:mainfrom
shachar-ash:fix/statsd-histogram-maxsize-misassignment
Draft

fix(statsdreceiver): apply histogram max_size to the correct metric category#49418
shachar-ash wants to merge 2 commits into
open-telemetry:mainfrom
shachar-ash:fix/statsd-histogram-maxsize-misassignment

Conversation

@shachar-ash

@shachar-ash shachar-ash commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Initialize() wired the timer_histogram_mapping config to the wrong ObserverCategory: the histogram/distribution case wrote the exponential-histogram config (max_size) onto timerEvents, and the timing case wrote explicit buckets onto histogramEvents. Because |h/|d metrics read histogramEvents.histogramConfig (which was never set), a max_size configured on a distribution/histogram mapping was silently ignored and those metrics always used the go-expohisto default (160); explicit buckets on a timing mapping were likewise dropped.

Assign each statsd_type's config to the category that actually serves it. Adds a regression test that configures a distribution-only mapping with max_size=10 over a 2**10 input range and asserts the histogram collapses to scale 0 / 10 buckets (fails before the fix, where the default size is used).

Description

Link to tracking issue

Fixes

…ategory

Initialize() wired the timer_histogram_mapping config to the wrong
ObserverCategory: the histogram/distribution case wrote the
exponential-histogram config (max_size) onto timerEvents, and the timing
case wrote explicit buckets onto histogramEvents. Because |h/|d metrics
read histogramEvents.histogramConfig (which was never set), a max_size
configured on a distribution/histogram mapping was silently ignored and
those metrics always used the go-expohisto default (160); explicit
buckets on a timing mapping were likewise dropped.

Assign each statsd_type's config to the category that actually serves it.
Adds a regression test that configures a distribution-only mapping with
max_size=10 over a 2**10 input range and asserts the histogram collapses
to scale 0 / 10 buckets (fails before the fix, where the default size is
used).

Co-authored-by: Cursor <cursoragent@cursor.com>
@shachar-ash shachar-ash requested review from a team, dmitryax and jmacd as code owners July 1, 2026 16:09
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jul 1, 2026

Copy link
Copy Markdown

CLA Not Signed

@github-actions github-actions Bot added the receiver/statsd statsd related issues label Jul 1, 2026
@atoulme atoulme marked this pull request as draft July 1, 2026 19:08
@atoulme

atoulme commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Please review the EasyCLA step, fix the changelog and mark ready to review again.

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

Labels

receiver/statsd statsd related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants