Requires
pipecat-ai v1.3.0 or later and Python 3.11 or later.Setup
1
Install packages
2
Set your environment variables
.env
Auto-instrumentation
Callauto_instrument() before creating your pipeline to trace all PipelineWorker instances automatically.agent.py
Trace only Pipecat
Trace only Pipecat
To instrument Pipecat without auto-instrumenting other libraries, use
setup_pipecat() instead of auto_instrument():Opt out of Pipecat tracing
Opt out of Pipecat tracing
If you use
auto_instrument() for other libraries but want to exclude Pipecat, pass pipecat=False:Attach audio recordings
Attach audio recordings
By default, audio is not stored as attachments. To attach user and agent audio to spans, set these environment variables:You can also configure this when calling
setup_pipecat():Manual instrumentation
To add aBraintrustPipecatObserver to a specific PipelineWorker rather than patching globally, pass it explicitly:What Braintrust traces
Braintrust attaches aBraintrustPipecatObserver to each PipelineWorker and emits spans as frames flow through the pipeline.- Pipeline spans (
pipecat_pipeline), the root span covering the full pipeline run, with audio sample rate and format metadata. - LLM response spans (
pipecat_llm_response), nested under the pipeline span, with input messages, output text or tool calls, token usage, time to first token, and model name and provider. - Tool spans (named by the function), with tool arguments and result.
- STT transcription spans (
stt_transcription), with transcript text and language. - TTS response spans (
tts_response), with input text and, when enabled, an audio attachment. - User speaking spans (
user_speaking), with optional user audio attachment.