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] Optimize Thread Usage in PeriodicExportingMetricReader #3230

Open
lalitb opened this issue Jan 7, 2025 · 0 comments
Open

[Metrics SDK] Optimize Thread Usage in PeriodicExportingMetricReader #3230

lalitb opened this issue Jan 7, 2025 · 0 comments
Labels
triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@lalitb
Copy link
Member

lalitb commented Jan 7, 2025

The current implementation of PeriodicExportingMetricReader::CollectAndExportOnce spawns a new thread for each export operation. This design was initially based on the assumption that the reader should handle multiple exporter requests for separate time series concurrently. However, this behavior is not supported by the specification and leads to unnecessary resource consumption, especially when the export interval is short.

The proposal is to manage export execution on a single background worker thread, similar to DoBackgroundWork in the batch processor.

@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jan 7, 2025
@marcalff marcalff added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

2 participants