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

ExplicitBucketHistogram resets counts to zero even if aggregation temporality is cumulative #3407

Closed
ocelotl opened this issue Aug 21, 2023 · 1 comment · Fixed by #3429
Closed
Assignees
Labels
bug Something isn't working metrics

Comments

@ocelotl
Copy link
Contributor

ocelotl commented Aug 21, 2023

          While this might help for deltas, the SDK should be returning metrics every single collection for readers that are CUMULATIVE (the default). However that seems to not be working corrctly https://github.com/open-telemetry/opentelemetry-python/issues/3277#issuecomment-1684521139

Yes, noticed that now that I added another test case. I think this is a problem for the explicit bucket histogram aggregation who is resetting to zero all bucket counts after every collection even in the aggregation temporality is cumulative. I say we review this PR and address that issue separately.

Originally posted by @aabmass in #3335 (review)

@ocelotl ocelotl self-assigned this Aug 21, 2023
@ocelotl ocelotl added bug Something isn't working metrics labels Aug 21, 2023
@aabmass
Copy link
Member

aabmass commented Aug 21, 2023

I looked into this a bit and found the issue #3277 (comment)

I think I found the issue

if not any(self._bucket_counts):
return None

This short circuiting logic is incorrect, it just assumes if no new counts were recorded since the last collection that we can return None. We should return the previous point values instead.

ocelotl added a commit to ocelotl/opentelemetry-python that referenced this issue Sep 8, 2023
ocelotl added a commit to ocelotl/opentelemetry-python that referenced this issue Sep 8, 2023
ocelotl added a commit to ocelotl/opentelemetry-python that referenced this issue Nov 24, 2023
ocelotl added a commit to ocelotl/opentelemetry-python that referenced this issue Nov 24, 2023
ocelotl added a commit to ocelotl/opentelemetry-python that referenced this issue Nov 24, 2023
ocelotl added a commit to ocelotl/opentelemetry-python that referenced this issue Dec 8, 2023
ocelotl added a commit to ocelotl/opentelemetry-python that referenced this issue Dec 8, 2023
ocelotl added a commit to ocelotl/opentelemetry-python that referenced this issue Jan 11, 2024
ocelotl added a commit to ocelotl/opentelemetry-python that referenced this issue Jan 11, 2024
ocelotl added a commit to ocelotl/opentelemetry-python that referenced this issue Feb 5, 2024
ocelotl added a commit to ocelotl/opentelemetry-python that referenced this issue Feb 5, 2024
ocelotl added a commit to ocelotl/opentelemetry-python that referenced this issue Feb 7, 2024
ocelotl added a commit to ocelotl/opentelemetry-python that referenced this issue Feb 7, 2024
ocelotl added a commit that referenced this issue Feb 8, 2024
* Fix explicit bucket histogram aggregation

Fixes #3407

* Revert "Fix explicit bucket histogram aggregation"

This reverts commit f1c6683.

* Fix ExplicitBucketHistogramAggregation

Fixes #3407

* Fix default instrument temporality

* Fix last test case

* Add more test cases

* Test min, max and sum

* Fix lint

* Add CHANGELOG

* Fix lint

* Skip test if running in Windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working metrics
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants