Setup
Basic Usage
Once instrumented, all Pydantic AI agents are automatically traced:Privacy Controls
Control what data is captured in traces:| Parameter | Default | Description |
|---|---|---|
include_content | True | Log prompts and completions |
include_binary_content | False | Include images and other binary data |
Per-Agent Instrumentation
If you need different settings for different agents, useget_instrumentation_settings():
User Context Integration
Using create_traced_agent
The easiest way to create an agent with context support:Using get_metadata_callback
For more control, use the metadata callback directly:Async Usage
All methods work with async agents:Captured Data
The integration automatically records:| Field | Description |
|---|---|
gen_ai.system | LLM provider (e.g., openai) |
gen_ai.request.model | Model name |
gen_ai.prompt | Input messages (if include_content=True) |
gen_ai.completion | Response (if include_content=True) |
user_id | User ID from context |
session_id | Session ID from context |
duration | Request latency |

