diff --git a/llama_stack/providers/inline/telemetry/meta_reference/telemetry.py b/llama_stack/providers/inline/telemetry/meta_reference/telemetry.py index d31a521fd..569d02f50 100644 --- a/llama_stack/providers/inline/telemetry/meta_reference/telemetry.py +++ b/llama_stack/providers/inline/telemetry/meta_reference/telemetry.py @@ -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)