-
Notifications
You must be signed in to change notification settings - Fork 598
Closed
Labels
bugSomething isn't workingSomething isn't workingshutdown&runtimetriage:todoNeeds to be traiged.Needs to be traiged.
Description
What happened?
As mentioned in #1625 - Tracer now holds strong reference to TracerProvider.
When opentelemetry used as a layer with global tracing subscriber it is now impossible to shutdown properly (it only decrements a reference, but doesn't execute Drop).
let layer = tracing_opentelemetry::layer()
.with_tracer(tracer_provider.tracer("app"));
opentelemetry::global::set_tracer_provider(tracer_provider);
tracing::subscriber::set_global_default(Registry::default().with(layer));
// shutdown call does not actually shutdown global tracer provider
opentelemetry::global::shutdown_tracer_provider();As a result some spans are missing, flattened, etc.
EDIT: Possible workaround is to flush manually:
tracer_provider.force_flush();API Version
0.24.0
SDK Version
0.24.1
What Exporter(s) are you seeing the problem on?
OTLP
Relevant log output
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingshutdown&runtimetriage:todoNeeds to be traiged.Needs to be traiged.