[cumulativetodeltaprocessor] Add histogram_fields config for selective field conversion#49407
Open
Chau-Tran wants to merge 1 commit into
Open
[cumulativetodeltaprocessor] Add histogram_fields config for selective field conversion#49407Chau-Tran wants to merge 1 commit into
Chau-Tran wants to merge 1 commit into
Conversation
…e field conversion Add histogram_fields configuration option that specifies which histogram fields to convert to delta temporality. Valid values: bucket_counts, sum, count. When empty (default), all fields are converted (backward compatible). This enables use cases where only bucket_counts should be converted to delta (for native histogram storage) while sum and count remain cumulative for RATE() queries. Fixes open-telemetry#48617 Assisted-by: Claude Opus 4.6 Signed-off-by: Chau Tran <chau.tran@salesforce.com>
|
Contributor
|
Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib. Important reminders:
|
Member
|
@Chau-Tran please sign the CLA and confirm to the PR template's attestation (the I am a human checkbox) |
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
Adds an optional
histogram_fieldsallowlist tocumulativetodeltaprocessor. The list controls which histogram data-point fields (bucket_counts,sum,count) are converted to delta. When unset (default), all three fields are converted — identical to today's behavior.When set, only the listed fields are written back from the tracker's delta value; the others keep their cumulative value on the emitted data point. The tracker itself still computes a full delta internally so state stays consistent across restarts, resets, and the existing bucket-mismatch handling — only the write-back to the data point is gated.
Applies to both
HistogramandExponentialHistogram.RemoveMin/RemoveMaxcontinues to apply whenever any field converts (min/max can't be re-derived from a partial conversion). Reset / NaN /NoRecordedValuehandling is unchanged.Link to tracking issue
Fixes #48617
Testing
go test -race ./...passes inprocessor/cumulativetodeltaprocessorand its sub-packages.make fmt lintpasses (testifylint, gofmt, golangci-lint).make chlog-validatepasses.Documentation
README.md: new bullet under "Configuration" describinghistogram_fields, and an example YAML block showing the prototypicalbucket_counts-only opt-in..chloggen/.