Skip to content

fix(sdk/metric): keep distinct streams when overflow attribute exists - #8903

Open
lllakshit wants to merge 1 commit into
open-telemetry:mainfrom
lllakshit:fix/8776-expo-histogram-overflow-attr
Open

fix(sdk/metric): keep distinct streams when overflow attribute exists#8903
lllakshit wants to merge 1 commit into
open-telemetry:mainfrom
lllakshit:fix/8776-expo-histogram-overflow-attr

Conversation

@lllakshit

Copy link
Copy Markdown

Summary

Fixes #8776

Exponential histogram aggregation treated any existing otel.metric.overflow=true stream as proof that cardinality overflow had already occurred. After that stream was created, every later unseen attribute set was folded into it, even when AggregationLimit was 0 (unlimited).

This change only reuses the overflow stream when the aggregation limit is actually reached. With no limit, overflowSet remains a normal distinct stream and later attribute sets get their own data points.

Test plan

  • Added TestExpoHistogramOverflowAttributeBeforeLimit
  • Existing TestExpoHistogramOverflow still passes (limit enforcement unchanged)
  • go test ./sdk/metric/internal/aggregate -run 'TestExpoHistogramOverflow' -count=1

Exponential histogram aggregation reused the overflow attribute set for
every new measurement after that stream was created, even when the
cardinality limit had not been reached. Only route new attribute sets to
the overflow stream once the aggregation limit is actually exceeded.

Fixes open-telemetry#8776

Signed-off-by: lllakshit <llakshitmathur239@gmail.com>
@linux-foundation-easycla

linux-foundation-easycla Bot commented Aug 31, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: lllakshit / name: lllakshit (85f8ecc)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exponential histogram reuses overflow attribute before reaching cardinality limit

1 participant