Installation
Quick Start
What Gets Traced
The Pydantic AI integration automatically captures:- Agent runs — input prompt, output text (including structured Pydantic model output), model name
- Token usage — input_tokens and output_tokens from the agent result
- Errors — captured and re-raised to the caller
- Async support — both
run()(async) andrun_sync()(sync) are instrumented
Configuration
Structured Output
The integration handles Pydantic AI’s structured output types — the output is serialized to JSON for telemetry:Async Usage
The wrapper supports both sync and async agent runs:Flushing and Shutdown
Always callflush() before your process exits to ensure all telemetry is shipped:
Known Limitations
run_stream()is not instrumented — onlyrun()andrun_sync()are captured. Streaming runs produce no telemetry.- Multi-step agent runs: In agents with multiple LLM calls (e.g., tool use loops), only the final result’s data is captured. Intermediate LLM calls are not tracked individually.