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

Fix handling of empty metric collection cycles #3335

Merged
merged 14 commits into from
Sep 7, 2023

Conversation

ocelotl
Copy link
Contributor

@ocelotl ocelotl commented Jun 5, 2023

Fixes #3198

@ocelotl ocelotl requested a review from a team June 5, 2023 15:25
@ocelotl ocelotl self-assigned this Jun 5, 2023
Copy link
Member

@aabmass aabmass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should discuss the issue more in the SIG.

This PR would be a breaking change of the API. If we wanted to go this route, I'd recommend changing here to not call self._receive_metrics if they are empty instead of making it Optional:

self._receive_metrics(
self._collect(self, timeout_millis=timeout_millis),
timeout_millis=timeout_millis,
)

@ocelotl
Copy link
Contributor Author

ocelotl commented Aug 17, 2023

I think we should discuss the issue more in the SIG.

This PR would be a breaking change of the API. If we wanted to go this route, I'd recommend changing here to not call self._receive_metrics if they are empty instead of making it Optional:

self._receive_metrics(
self._collect(self, timeout_millis=timeout_millis),
timeout_millis=timeout_millis,
)

Right, fixed.

@ocelotl
Copy link
Contributor Author

ocelotl commented Aug 18, 2023

I am investigating #3277, marking this as a draft meanwhile

@ocelotl ocelotl marked this pull request as draft August 18, 2023 12:50
Copy link
Member

@aabmass aabmass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 #3277 (comment)

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.

@ocelotl ocelotl changed the title Remove console exporter metric output if empty Fix handling of empty metric collection cycles Aug 24, 2023
@ocelotl ocelotl requested a review from aabmass August 24, 2023 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unexpected print statement from ConsoleMetricExporter
4 participants