Skip to content

[Metrics SDK] Optimize Thread Usage in PeriodicExportingMetricReader #3230

@lalitb

Description

@lalitb

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.

Metadata

Metadata

Assignees

Labels

good first issueGood for newcomershelp wantedGood for taking. Extra help will be provided by maintainerstriage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions