-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 Asynchronous Counters Recording #3350
Conversation
Clarify the Counter and UpDownCounter Observe values are the exact counter value, not increments to the previous measurements.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3350 +/- ##
=====================================
Coverage 77.9% 77.9%
=====================================
Files 164 164
Lines 11319 11345 +26
=====================================
+ Hits 8821 8847 +26
Misses 2301 2301
Partials 197 197
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems reasonable.
Just for my understanding does this basically mean that async Counters are gauges with monotonic flags and temporality fields?
I think the The way I understand the specification to be written is that the user of asynchronous up-down-counters and counters maintain the state of the counter themselves. It is passed to the SDK with the appropriate monotonic and temporality types to have the SDK report the sum with the right properties, but it is up to the user to ensure the validity of these properties. |
Fix #3278
Currently, asynchronous counters observe values that are treated as incremental changes to already summed recordings. This is contrary to what the specification notes is expected by the user in the API:
This fixes the implemented behavior. It adds a new
precomputedSum
Aggregator
type that interprets the passedAggregate
values as already computed sums and returns them directly. This newAggregator
type is used for theAsyncCounter
andAsyncUpDownCounter
instrument kinds.