-
Notifications
You must be signed in to change notification settings - Fork 214
Open
Description
Problem
When building production agents with the Node.js SDK, I need to correlate my application's OpenTelemetry spans with LiveKit's internal spans (agent_session, agent_turn, user_turn_completed).
Currently, the Python SDK exposes set_tracer_provider() for trace context configuration, but the Node.js SDK has no equivalent API. This means:
- LiveKit's spans and my application's spans have separate trace IDs
- I cannot visualize the full call flow in a single trace tree
- Debugging requires manually correlating spans by
room_sidacross two separate traces
Current Behavior
@livekit/rtc-noderegisters an OpenTelemetry TracerProvider at import time- My observability code can add span processors to this provider (so spans export to the same backend)
- But there's no way to share trace context - each creates its own root span
Desired Behavior
An API similar to Python's set_tracer_provider() that allows:
- Setting a custom TracerProvider, OR
- Propagating a parent span context so LiveKit's spans become children of my trace
Use Case
I have an agent with an 8-phase initialization pipeline (init:entry, init:connect_room, init:prepare_session, etc.). I want all of these phases PLUS LiveKit's internal spans to appear in a single trace tree for end-to-end observability.
Environment
- @livekit/agents: v1.0.x
- Node.js: v22.x
- OpenTelemetry SDK: v2.x
srolel
Metadata
Metadata
Assignees
Labels
No labels