Skip to content

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

Open
alliasgher wants to merge 1 commit intoopen-telemetry:mainfrom
alliasgher:docs/5891-histogram-buckets-unit
Open

sdk/metric: document unit-sensitivity of DefaultAggregationSelector#8224
alliasgher wants to merge 1 commit intoopen-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
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.5%. Comparing base (2fe7910) to head (bf8dcac).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #8224     +/-   ##
=======================================
- Coverage   82.5%   82.5%   -0.1%     
=======================================
  Files        310     310             
  Lines      24555   24555             
=======================================
- Hits       20268   20267      -1     
+ Misses      3912    3911      -1     
- Partials     375     377      +2     
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 Outdated
@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 Outdated
Comment thread sdk/metric/reader.go Outdated
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>
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

3 participants