This page uses LiveKit’s native OpenTelemetry pipeline. It doesn’t need a LiveKit-specific OpenInference instrumentor.
Install
Setup
Set your Phoenix endpoint as an environment variable, along with your LiveKit server credentials:instrumentation.py
Run LiveKit Agents
Configure tracing before the agent session starts, then flush spans when the job shuts down:This example shows how to add Phoenix tracing to an existing LiveKit Agents app. Configure
AgentSession with the STT, LLM, and TTS plugins your app uses, and launch the worker as described in the LiveKit quickstart.agent.py
session.id in the metadata groups each room’s spans into a Phoenix session.
Observe
Run an agent session and open thelivekit-agents project in Phoenix. Depending on your LiveKit version and plugins, the trace includes:
- Agent session and turn spans
- User and agent speaking spans
- Lifecycle spans for agent activity
- Model and realtime-model spans, with metrics
- Any custom metadata you attach through
set_tracer_provider
tracer_provider.
Troubleshooting
- No spans in Phoenix. Confirm
configure_livekit_tracing()runs beforeAgentSession.start(...), and thatforce_flush()runs before the worker exits. - Spans land in the wrong project. Set
project_nameinregister(), or setPHOENIX_PROJECT_NAMEin the worker’s environment.

