Skip to content

Cannot Shutdown() MeterProvider manually without a warning from destructor #3511

@gaborcsardi

Description

@gaborcsardi

Sometimes it makes sense to shut down a meter provider manually. However, the destructor of MeterProvider also calls Shutdown() [1], which will emit a warning if the MeterProvider was Shutdown() already manually [2]. So effectively every manual call to MeterProvider will create a warning message.

Ideally, if the meter provider was already shut down manually, the destructor would not emit a warning, I think.

[1]


[2]
OTEL_INTERNAL_LOG_WARN("[MeterContext::Shutdown] Shutdown can be invoked only once.");

Metadata

Metadata

Assignees

Labels

Staletriage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions