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

Calculate delta sums for delta async counter/up-down-counter types #3398

merged 3 commits into from Oct 27, 2022


Copy link

@MrAlias MrAlias commented Oct 26, 2022

Fix #3278

Clarification of the expected async counter/up-down-counter behavior:

instrumentation will always record a cumulative value and if a user overrides the temporality to be delta the exported data needs to be converted to delta.

This updates the NewPrecomputedDeltaSum function to return an Aggregation implementation that conforms to this behavior.

Update the async instrument docs for the counters types to explain that
the value recorded is assumed by implementations to be the cumulative
Report the delta Aggregation while supporting cumulative Aggregate
@MrAlias MrAlias added pkg:SDK Related to an SDK package area:metrics Part of OpenTelemetry Metrics labels Oct 26, 2022
Copy link

codecov bot commented Oct 26, 2022

Codecov Report

Merging #3398 (10b316c) into main (ccbc38e) will increase coverage by 0.0%.
The diff coverage is 92.1%.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #3398   +/-   ##
  Coverage   77.9%   77.9%           
  Files        164     164           
  Lines      11323   11359   +36     
+ Hits        8822    8857   +35     
  Misses      2303    2303           
- Partials     198     199    +1     
Impacted Files Coverage Δ
sdk/metric/internal/sum.go 97.5% <92.1%> (-2.5%) ⬇️
sdk/trace/batch_span_processor.go 81.1% <0.0%> (+0.8%) ⬆️

Copy link

jmacd commented Oct 27, 2022

Nice! 🎉

@MrAlias MrAlias merged commit 40f1900 into open-telemetry:main Oct 27, 2022
20 checks passed
@MrAlias MrAlias deleted the async-counter-cumulative branch October 27, 2022 15:47
@MrAlias MrAlias added this to the Metric v0.34.0 milestone Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
area:metrics Part of OpenTelemetry Metrics pkg:SDK Related to an SDK package
No open projects
Status: Done

Successfully merging this pull request may close these issues.

AsyncCounter and AsyncUpDownCounter expected callback value changed in v0.32.0
3 participants