-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Span metrics calls count always 0 with delta aggregation temporality #40139
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
Labels
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Looks like a regression. Can you roll out a PR? |
Yep, I can create a PR for the proposed solution. Let me know if there are any other ideas/thoughts. |
dragonlord93
pushed a commit
to dragonlord93/opentelemetry-collector-contrib
that referenced
this issue
May 23, 2025
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Fixes bug causing calls count to always be 0 when using delta aggregation temporality (see linked issue). This PR adds a check for the temporality used so that we only overwrite the first value for cumulative metrics only. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes open-telemetry#40139 <!--Please delete paragraphs that you did not use before submitting.--> --------- Co-authored-by: Sean Marciniak <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Component(s)
connector/spanmetrics
What happened?
Description
Kudos to @san-san for finding this bug.
Looks like this PR introduced a bug when using delta aggregation temporality: #39052
With delta aggregation temporality, resourceMetrics get purged after exporting the metrics here. So, the metrics generated are always newly created ones and have
isFirst
set to true. This results in the value always getting overwritten here.Can confirm that this is not an issue in
v0.123.0
(i.e. prior to the first value logic)Steps to Reproduce
calls
metrics is 0 instead of 1.calls
metrics is 0 instead of 1.Expected Result
Data point value of the emitted
traces.span.metrics.calls
metric should be 1 after each sent spanActual Result
Data point value of the emitted
traces.span.metrics.calls
metric is 0 after each sent spanCollector version
v0.126.0
Environment information
No response
OpenTelemetry Collector configuration
Additional context
Proposed solution
I think we can check the aggregation type here so that we set the first value to 0 for cumulative metrics only. If my understanding is correct, the issue addressed by #39052 applies to cumulative metrics only.
The text was updated successfully, but these errors were encountered: