clarify the issue in comments

This commit is contained in:
Dinesh Yeduguru 2025-01-27 11:00:10 -08:00
parent d0c48d8397
commit cafe9cbb4a

View file

@ -84,6 +84,8 @@ class TelemetryAdapter(TelemetryDatasetMixin, Telemetry):
# Initialize the correct span processor based on the provider state.
# This is needed since once the span processor is set, it cannot be unset.
# Recreating the telemetry adapter multiple times will result in duplicate span processors.
# Since the library client can be recreated multiple times in a notebook,
# the kernel will hold on to the span processor and cause duplicate spans to be written.
if _TRACER_PROVIDER is None:
provider = TracerProvider(resource=resource)
trace.set_tracer_provider(provider)