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

Metrics SDK - can we cleanup after a shutdown? #2442

Open
cijothomas opened this issue Dec 17, 2024 · 2 comments
Open

Metrics SDK - can we cleanup after a shutdown? #2442

cijothomas opened this issue Dec 17, 2024 · 2 comments

Comments

@cijothomas
Copy link
Member

Though shutdown prevents metrics from ever getting collected/exported, they are still kept in the HashMaps/Aggregations. There is no check in hot path to see if the provider is already shutdown (it may be too expensive to do that check). This maybe okay, but opening an issue to discuss more.

Also, given the Counter/Meter from the API use a Arc<dyn> object pointing to something from the SDK, it is not easily possible to do much cleanup in the SDK, unless the user explicitly drops the Counter/Meters themselves.

@cijothomas cijothomas added this to the Metrics SDK Stable milestone Dec 17, 2024
@cijothomas
Copy link
Member Author

@utpilla @fraillt FYI. Something we can discuss.

@fraillt
Copy link
Contributor

fraillt commented Dec 18, 2024

As you have mentioned, I would prefer to avoid having this check in hot path as well.
However, we should probably clear Pipeline (more precisely inner: Mutex<PipelineInner>) during shutdown, so that memory can be cleaned up once user explicitly drops meters themselves.

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

No branches or pull requests

2 participants