-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[processor/deltatocumulativeprocessor]: fix incorrect bucket counts when downscaling exp histograms #33831
[processor/deltatocumulativeprocessor]: fix incorrect bucket counts when downscaling exp histograms #33831
Conversation
4c199d7
to
045ce5c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@edma2 please add a changelog entry: https://github.com/open-telemetry/opentelemetry-collector/blob/main/CONTRIBUTING.md#adding-a-changelog-entry
otherwise LGTM
processor/deltatocumulativeprocessor/internal/data/expo/scale_test.go
Outdated
Show resolved
Hide resolved
@sh0rez thanks, added a changelog entry |
@sh0rez @jpkrohling thanks for your reviews and approvals, can we merge it now? |
Description:
The downscaling algorithm collapses bucket by pairing neighbors into new buckets. The simple case occurs when there is an even number of buckets and offset is zero or even.
When there is an odd number of buckets, the last bucket is accounted for by incrementing the
size
variable to ensure an extra loop iteration.When offset is odd, the first bucket is accounted for by special handling in the loop.
However, when there is an even number of buckets, AND an odd offset, this happens:
The collapsed buckets are incorrect because the buckets sum up to 1 (1+0) instead of 2 (1+1).
Handle this edge case by incrementing the
size
variable when offset is oddLink to tracking Issue:
Testing:
Added some test cases to showcase the bug.
Documentation: