Skip to main content
AgentBasis supports Pydantic AI with built-in OpenTelemetry instrumentation.

Setup

Basic Usage

Once instrumented, all Pydantic AI agents are automatically traced:

Privacy Controls

Control what data is captured in traces:

Per-Agent Instrumentation

If you need different settings for different agents, use get_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: