Skip to content

Adjuster doesn't detect resets when individual bucket count decreases #38582

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

Closed
ridwanmsharif opened this issue Mar 12, 2025 · 2 comments · Fixed by #38583
Closed

Adjuster doesn't detect resets when individual bucket count decreases #38582

ridwanmsharif opened this issue Mar 12, 2025 · 2 comments · Fixed by #38583
Labels
bug Something isn't working processor/metricstarttime

Comments

@ridwanmsharif
Copy link
Member

Component(s)

processor/metricstarttime

What happened?

Description

When an individual bucket counter decreases but the total count and sum goes up, the adjuster doesn't recognize the reset:

if currentDist.Count() < tsi.histogram.previousCount || currentDist.Sum() < tsi.histogram.previousSum {

Steps to Reproduce

Consider a histogram with 2 buckets: the buckets with boundaries 0 < x < 1 and 1 < y < 2

And at time t I get a histogram point with the following bucket counts {10, 20}
and then at time t + x I get another point with the bucket counts {100, 19}

This should trigger a reset as the individual bucket counter should never be decreasing.

Collector version

latest

Environment information

Environment

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

OpenTelemetry Collector configuration

Log output

Additional context

No response

@ridwanmsharif ridwanmsharif added bug Something isn't working needs triage New item requiring triage labels Mar 12, 2025
ridwanmsharif added a commit to ridwanmsharif/opentelemetry-collector-contrib that referenced this issue Mar 12, 2025
Copy link
Contributor

Pinging code owners for processor/metricstarttime: @dashpole @ridwanmsharif. See Adding Labels via Comments if you do not have permissions to add labels yourself. For example, comment '/label priority:p2 -needs-triaged' to set the priority and remove the needs-triaged label.

@crobert-1
Copy link
Member

Issue filed by code owner, removing needs triage

@crobert-1 crobert-1 removed the needs triage New item requiring triage label Mar 12, 2025
ridwanmsharif added a commit to ridwanmsharif/opentelemetry-collector-contrib that referenced this issue Mar 13, 2025
ridwanmsharif added a commit to ridwanmsharif/opentelemetry-collector-contrib that referenced this issue Mar 13, 2025
ridwanmsharif added a commit to ridwanmsharif/opentelemetry-collector-contrib that referenced this issue Mar 14, 2025
ridwanmsharif added a commit to ridwanmsharif/opentelemetry-collector-contrib that referenced this issue Mar 17, 2025
Fiery-Fenix pushed a commit to Fiery-Fenix/opentelemetry-collector-contrib that referenced this issue Apr 24, 2025
…lemetry#38583)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
When an individual bucket counter decreases but the total count and sum
goes up, the adjuster now recognizes it as a reset.

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes
open-telemetry#38582

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Added unit tests.

<!--Describe the documentation added.-->
#### Documentation
N/A

<!--Please delete paragraphs that you did not use before submitting.-->

---------

Signed-off-by: Ridwan Sharif <[email protected]>
Co-authored-by: Antoine Toulme <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working processor/metricstarttime
Projects
None yet
2 participants