Setup
The
@braintrust/otel package supports both OpenTelemetry v1 and v2. For the best experience, use the same OpenTelemetry versions that LiveKit Agents uses to avoid compatibility issues..env
Trace with LiveKit Agents
Configure Braintrust’s span processor and set it as LiveKit’s tracer provider.livekit_agent.py
BraintrustSpanProcessor automatically captures all LiveKit agent spans, including:
- Voice interactions and audio processing
- OpenAI Realtime API calls
- Agent session lifecycle events
- Custom spans you create with
tracer.start_as_current_span()(Python) ortracer.startActiveSpan()(TypeScript)
span.set_attribute() (Python) or span.setAttribute() (TypeScript) to enrich your traces with custom metadata, making it easier to debug and analyze your agent’s behavior in Braintrust.
Next steps
Learn more about building with LiveKit Agents and tracing with Braintrust: LiveKit Agents- LiveKit Agents Overview - Introduction to the LiveKit Agents framework
- Building Voice Agents - Guide to creating voice-enabled agents
- Agent Plugins - Available plugins for STT, TTS, and LLM providers
- Deployment Guide - Deploy your agents to production
- OpenTelemetry Integration - Deep dive into Braintrust’s OpenTelemetry support
- Custom Tracing Guide - Add custom spans and attributes to your traces
- Logging and Observability - Monitor and debug your AI applications