[Metrics SDK] Optimize Thread Usage in PeriodicExportingMetricReader #3230
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.
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.
The text was updated successfully, but these errors were encountered: