_setup_cloud_tracer still overrides TracerProviders due to checking the wrong base class#4584
_setup_cloud_tracer still overrides TracerProviders due to checking the wrong base class#4584longcw merged 5 commits intolivekit:mainfrom
Conversation
…rovider instead of the trace api TraceProvider which all TraceProviders should inherit from
📝 WalkthroughWalkthroughThe tracer provider typing was refactored to use OpenTelemetry's public API types ( Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant traces.set_tracer_provider
participant trace_sdk as trace_sdk (SDK)
participant tracer_module as tracer (opentelemetry.trace)
participant processors as SpanProcessors
Caller->>traces.set_tracer_provider: call with tracer_provider (trace_api.TracerProvider), metadata?
traces.set_tracer_provider->>trace_sdk: is tracer_provider instance of trace_sdk.TracerProvider?
alt is SDK provider
traces.set_tracer_provider->>tracer_module: tracer.set_provider(tracer_provider)
traces.set_tracer_provider->>processors: attach _MetadataSpanProcessor / BatchSpanProcessor
else not SDK provider (Proxy/NoOp/API)
traces.set_tracer_provider->>trace_sdk: create trace_sdk.TracerProvider() as new_provider
trace_sdk-->>traces.set_tracer_provider: new_provider
traces.set_tracer_provider->>tracer_module: tracer.set_provider(new_provider)
traces.set_tracer_provider->>processors: attach processors to new_provider
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧹 Recent nitpick comments
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.py📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (1)📚 Learning: 2026-01-22T03:28:16.289ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (3)
✏️ Tip: You can disable this entire section by setting Comment |

_setup_cloud_tracerstill overrides TracerProviders due to checking the wrong base class.The previous TracerProvider inherits from the abstract base class TracerProvider which is intended to be the base class of all TracerProviders. Not all TracerProviders need to inherit from the sdk variant.
This specifically happens for the dd-trace TracerProvider which instead inherits from the abstract base class.
What happens is if you use livekit cloud and datadog open telemetry traces, the tracerprovider is being reset by the
_setup_cloud_tracerfunction and you don't get those traces. This is similar to the previous bug here#4060
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.