Skip to content

[Metrics SDK] Optimize Thread Usage in PeriodicExportingMetricReader #3230

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

Open
lalitb opened this issue Jan 7, 2025 · 3 comments · May be fixed by #3383
Open

[Metrics SDK] Optimize Thread Usage in PeriodicExportingMetricReader #3230

lalitb opened this issue Jan 7, 2025 · 3 comments · May be fixed by #3383
Assignees
Labels
good first issue Good for newcomers help wanted Good for taking. Extra help will be provided by maintainers 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
@marcalff marcalff added the help wanted Good for taking. Extra help will be provided by maintainers label Mar 7, 2025
Copy link

github-actions bot commented Mar 7, 2025

This issue is available for anyone to work on. Make sure to reference this issue in your pull request.
✨ Thank you for your contribution! ✨

@marcalff marcalff added the good first issue Good for newcomers label Mar 7, 2025
@ColeVanOphem
Copy link

Hi everyone, I'm a student interested in contributing and plan to take on this issue as my first pull request. Looking forward to diving in and helping out!

@lalitb
Copy link
Member Author

lalitb commented Apr 18, 2025

Thanks @ColeVanOphem for the interest. Assigned to you.

@ColeVanOphem ColeVanOphem linked a pull request Apr 26, 2025 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Good for taking. Extra help will be provided by maintainers triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants