Skip to content

sdk/metric: document unit-sensitivity of DefaultAggregationSelector - #8224

Merged
pellared merged 4 commits into
open-telemetry:mainfrom
alliasgher:docs/5891-histogram-buckets-unit
May 26, 2026
Merged

pellared merged 4 commits into
open-telemetry:mainfrom
alliasgher:docs/5891-histogram-buckets-unit

Conversation

@alliasgher

Copy link
Copy Markdown
Contributor

Description

The default `ExplicitBucketHistogram` boundaries returned by `DefaultAggregationSelector` are tuned for millisecond-scale measurements and are not rescaled when an instrument is created with `metric.WithUnit("s")` or any other unit. Add a godoc note so users reading the selector can see this and point them at the knobs for overriding the boundaries.

This is the godoc change agreed to by @dmathieu in #5891 (comment). The actual rescaling behaviour is spec-blocked (the blocked:specification label on the issue) and is intentionally not touched here.

Fixes #5891.

Checklist

  • CHANGELOG.md entry added (placeholder #XXXX, will update with real PR number once assigned).
  • Tests updated (godoc-only change, no behavior change).

@alliasgher
alliasgher force-pushed the docs/5891-histogram-buckets-unit branch from c3da0c9 to ac80092 Compare April 17, 2026 13:37
@codecov

codecov Bot commented Apr 17, 2026 •

Copy link
Copy Markdown

Codecov Report

โœ… All modified and coverable lines are covered by tests.
โœ… Project coverage is 82.9%. Comparing base (9a68034) to head (3b9f39f).

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #8224   +/-   ##
=====================================
  Coverage   82.9%   82.9%           
=====================================
  Files        315     315           
  Lines      25109   25109           
=====================================
+ Hits       20824   20826    +2     
+ Misses      3911    3910    -1     
+ Partials     374     373    -1     
Files with missing lines Coverage ฮ”
sdk/metric/reader.go 93.6% <รธ> (รธ)

... and 3 files with indirect coverage changes

๐Ÿš€ New features to boost your workflow:
  • โ„๏ธ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread CHANGELOG.md Resolved
@dmathieu dmathieu added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Apr 17, 2026
Comment thread sdk/metric/reader.go Resolved
Comment thread sdk/metric/reader.go Resolved
The default ExplicitBucketHistogram boundaries returned by
DefaultAggregationSelector are tuned for millisecond-scale measurements
and are not rescaled when an instrument is created with
metric.WithUnit("s") or any other unit. Add a godoc note so users
reading the selector can see this and point them at the knobs for
overriding the boundaries.

Fixes open-telemetry#5891

Signed-off-by: Ali <alliasgher123@gmail.com>
Comment thread sdk/metric/reader.go Resolved
@pellared
pellared merged commit d0b6cbd into open-telemetry:main May 26, 2026
32 checks passed
@pellared pellared added this to the v1.44.0 milestone May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PRs that do not require a CHANGELOG.md entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Histogram buckets do not adjust for unit

4 participants