Skip to content
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

Fix the statsdreceiver summary point calculation #6155

Merged
merged 2 commits into from
Nov 11, 2021

Conversation

jmacd
Copy link
Contributor

@jmacd jmacd commented Nov 7, 2021

Description:
The statsdreceiver has incorrect handling of sample-rate information, particularly when computing summary values. The existing support, which divides the observed value by the sample rate, is incorrect. This fixes the code to use a weighted calculation of the quantiles, which corrects the problem.

Note as discussed in #5742 this receiver is making incorrect use of the StartTime field for the sum and count fields, which are ostensibly cumulative but are in fact reset with every period. This PR makes the receiver use the so-called "degenerate" cumulative temporality, meaning to report deltas as cumulatives w/ repeatedly resetting start time. This is technically much more correct than the existing behavior, which sent cumulative values as delta temporality.

Uses gonum.org/v1/gonum/stat for the math bits.

Link to tracking Issue:
Fixes #5252. As discussed in #5742, a related solution here will be to use the new exponential histogram with automatic scaling.

Testing:
A unit test was added for correctly calculated quantiles from weighted data.

Documentation: No user-visible changes.

@jmacd jmacd requested review from a team and jpkrohling November 7, 2021 09:43
@jmacd jmacd changed the title Jmacd/fix summ Fix the statsdreciever summary point calculation Nov 7, 2021
@jpkrohling
Copy link
Member

@keitwb, as the other owner of this component, would you please give your +1 to this?

Copy link
Contributor

@keitwb keitwb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems ok to me.

@jpkrohling jpkrohling changed the title Fix the statsdreciever summary point calculation Fix the statsdreceiver summary point calculation Nov 11, 2021
@jpkrohling jpkrohling merged commit f6f59e7 into open-telemetry:main Nov 11, 2021
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.

Statsd receiver incorrect handling of histogram/timer sample rate
3 participants