[processor/spanpruning] Add histogram support for latency distribution on aggregated summary spans#47604
Merged
andrzej-stencel merged 12 commits intoopen-telemetry:mainfrom Apr 15, 2026
Conversation
csmarchbanks
approved these changes
Apr 14, 2026
jmacd
approved these changes
Apr 14, 2026
Contributor
jmacd
left a comment
There was a problem hiding this comment.
You make me wish for exponential histogram support as an option! Not a blocker, but note that /pkg/expohisto now contains an implementation you could use for this.
Contributor
Author
Oh neat! I already have a branch coming together with it 😆 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The span pruning processor currently emits min/max/avg/total duration statistics on summary spans, but these aggregates hide the shape of the latency distribution. A flat average can mask bimodal distributions and tail latency problems that are critical for debugging.
This PR adds configurable cumulative histogram buckets to summary spans, giving users latency distribution visibility without requiring a separate metrics pipeline. Bucket boundaries default to the OpenTelemetry SDK explicit bucket histogram boundaries (
[5ms, 10ms, 25ms, 50ms, 100ms, 250ms, 500ms, 1s, 2.5s, 5s, 10s]) and can be customized or disabled entirely by settingaggregation_histogram_bucketsto an empty list.Summary spans gain two new slice attributes:
<prefix>histogram_bucket_bounds_s-- upper bounds in seconds (excludes +Inf)<prefix>histogram_bucket_counts-- cumulative counts per bucket (includes +Inf)Cumulative semantics were chosen to match Prometheus/OpenTelemetry histogram conventions, where each bucket count includes all observations at or below that boundary.
Testing
stats_test.go)config_test.go)processor_test.go)TestLoadConfigDocumentation
aggregation_histogram_bucketsto the configuration table in READMEhistogram_bucket_bounds_sandhistogram_bucket_countsto the summary span attributes table