-
Notifications
You must be signed in to change notification settings - Fork 648
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 SumAggregation #3390
Fix SumAggregation #3390
Conversation
This is a relevant example. |
be26c92
to
0b6a4b6
Compare
opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/aggregation.py
Outdated
Show resolved
Hide resolved
Moving here this comment from @aabmass:
|
Looks like this PR saves the oldest previous time to get 1st option, is that right? |
Yes, that's right, but TBH, I'm not sure if we should do that. The first option would produce a point whose difference between start and end time is larger than "normal". If a periodic metric reader is used, it can be weird to have a point that is "longer" than a collection cycle, right? |
I think this is the expected behavior, see here
|
All right, seems like we are doing the right thing, then. PTAL at the rest of the PR when you have a chance 👍 |
After discussing with @lzchen it looks like we also need to take into consideration the instrument monotonicity in |
This may help:
|
opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/aggregation.py
Show resolved
Hide resolved
opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/aggregation.py
Show resolved
Hide resolved
opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/instrument.py
Outdated
Show resolved
Hide resolved
opentelemetry-sdk/tests/metrics/integration_test/test_sum_aggregation.py
Show resolved
Hide resolved
opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/_view_instrument_match.py
Show resolved
Hide resolved
opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/aggregation.py
Show resolved
Hide resolved
This reverts commit 6a81afa.
Fixes #3268
@aabmass this is the PR for the issue I mentioned in the last SIG, PTAL ✌️