Exporters fail when global tracer provider isn't set. #36362
Labels
Client
This issue points to a problem in the data-plane of the library.
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
feature-request
This issue requires a new behavior in the product in order be resolved.
Monitor - Exporter
Monitor OpenTelemetry Exporter
needs-team-attention
This issue needs attention from Azure service team or SDK team
Service Attention
This issue is responsible by Azure service team.
azure-sdk-for-python/sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/trace/_exporter.py
Line 86 in 8b6e24d
Why not let
tracer_provider
be a kwarg inBaseExporter
? It's useful in complex systems where you have multiple providers (e.g reinitializing tracer providers in forks). It's also a step towards letting people opt out of global state, which (to me) is a very iffy part of the opentelemetry ecosystem.I'd be willing to add a little PR. Afaik all that's needed is a kwarg line in
BaseExporter.__init__
and something liketracer_provider = self._tracer_provider or get_tracer_provider()
wherever get_tracer_provider() is being called in it's subclassesThe text was updated successfully, but these errors were encountered: