Visitar URL original
sdk/metric: document unit-sensitivity of DefaultAggregationSelector (… · open-telemetry/opentelemetry-go@d0b6cbd · GitHub
Skip to content

Commit d0b6cbd

Browse files
alliasgherpellared
andauthored
sdk/metric: document unit-sensitivity of DefaultAggregationSelector (#8224)
Fixes #5891 --------- Signed-off-by: Ali <alliasgher123@gmail.com> Co-authored-by: Robert Pająk <pellared@hotmail.com>
1 parent 9a68034 commit d0b6cbd

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎sdk/metric/reader.go‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,15 @@ type AggregationSelector func(InstrumentKind) Aggregation
183183
// mapping: Counter ⇨ Sum, Observable Counter ⇨ Sum, UpDownCounter ⇨ Sum,
184184
// Observable UpDownCounter ⇨ Sum, Observable Gauge ⇨ LastValue,
185185
// Histogram ⇨ ExplicitBucketHistogram.
186+
//
187+
// The default ExplicitBucketHistogram boundaries are designed for
188+
// millisecond-scale latency values. Boundaries are interpreted relative to the
189+
// values recorded for the instrument and are not rescaled when an instrument is
190+
// created with a different unit (e.g. via
191+
// [go.opentelemetry.io/otel/metric.WithUnit]). Instrumentation authors should
192+
// supply appropriate boundaries per instrument via
193+
// [go.opentelemetry.io/otel/metric.WithExplicitBucketBoundaries]; end users
194+
// can also override boundaries for a specific instrument with a [View].
186195
func DefaultAggregationSelector(ik InstrumentKind) Aggregation {
187196
switch ik {
188197
case InstrumentKindCounter,

0 commit comments

Comments
 (0)