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

[processor/cumulativetodelta] Output delta histograms include min and max when they shouldnt #15658

Closed
jack-berg opened this issue Oct 25, 2022 · 10 comments · Fixed by #16520
Closed
Labels
bug Something isn't working help wanted Extra attention is needed priority:p2 Medium processor/cumulativetodelta Cumulative To Delta processor

Comments

@jack-berg
Copy link
Member

What happened?

Description

The cumulativetodelta processor retains the min and max from the cumulative histograms when they shouldn't. Its semantically wrong to include cumulative min and max on a resulting delta.

Steps to Reproduce

Its quite clear in the source code that the min and max fields are retained from the data point. However, I've also pushed up a commit with a test case that demonstrates it.

Expected Result

No values for resulting delta histogram min and max.

Actual Result

Cumulative histogram min and max retained.

Collector version

head

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

No response

Log output

No response

Additional context

Its not super easy to resolve this because there isn't an obvious way to clear the min and max values. The HistogramDataPoint has methods to set min and max, but those require a float64. No method exists to set as nil, or clear.

@jack-berg jack-berg added bug Something isn't working needs triage New item requiring triage labels Oct 25, 2022
@fatsheep9146 fatsheep9146 added processor/cumulativetodelta Cumulative To Delta processor and removed needs triage New item requiring triage labels Oct 26, 2022
@github-actions
Copy link
Contributor

Pinging code owners: @TylerHelmuth. See Adding Labels via Comments if you do not have permissions to add labels yourself.

@TylerHelmuth
Copy link
Member

/cc @balintzs @mistodon

@TylerHelmuth
Copy link
Member

@dmitryax whats the best way to clear out a HistogramDataPoint's min and max? Do we need to make an empty HistogramDataPoint and copy over individual fields? Or can I add a RemoveMin/RemoveMax to pdata?

@TylerHelmuth TylerHelmuth added the priority:p2 Medium label Oct 26, 2022
@TylerHelmuth
Copy link
Member

@jack-berg in the meantime histogram conversion is still behind a feature gate (which will be enabled by default in 0.63.0) and can be enabled/disabled as needed.

@mx-psi
Copy link
Member

mx-psi commented Oct 26, 2022

If the min/max is smaller/greater than the one on the previous point then we could keep it. It would be weird for only some points in a given time series to have min/max, but it would conform to the specification and it may be useful (it would definitely be useful for the Datadog exporter for example :) ).

@jack-berg
Copy link
Member Author

@jack-berg in the meantime histogram conversion is still behind a feature gate

Understood 🙂

If the min/max is smaller/greater than the one on the previous point then we could keep it.

Meaning that the change in value of min / max from one point to the next indicates that the measurement was recorded in the most recent window? I'd probably lean towards removing it in all cases for consistency / simplicity, but don't feel strongly about that.

@mx-psi
Copy link
Member

mx-psi commented Oct 26, 2022

Meaning that the change in value of min / max from one point to the next indicates that the measurement was recorded in the most recent window?

Yes, indeed.

I'd probably lean towards removing it in all cases for consistency / simplicity, but don't feel strongly about that.

Thinking about it further, it would probably not affect many datapoints (since getting a new min/max on the most recent window will be rare over time), so I don't feel strongly either to be honest

@TylerHelmuth
Copy link
Member

@dmitryax can we add a ClearMin/ClearMax to the Histogram API in pdata?

@TylerHelmuth TylerHelmuth added the help wanted Extra attention is needed label Nov 3, 2022
@dmitryax
Copy link
Member

dmitryax commented Nov 3, 2022

We discussed this with @bogdandrutu some time ago and decided to wait until there is a real need for ability to clear optional fields. Looks like it's the time. I'll create a separate issue where we can decide on the naming.

@TylerHelmuth
Copy link
Member

@dmitryax thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed priority:p2 Medium processor/cumulativetodelta Cumulative To Delta processor
Projects
None yet
5 participants