Skip to main content
Automatically capture agent runs, LLM calls, and tool invocations within the Pydantic AI framework via its native OpenTelemetry instrumentation.

Install

Set up

Usage

Once initialized, all Pydantic AI agent runs and tool invocations are captured automatically:

Verify

Run your code and confirm the trace arrives:
  1. In the TraceRoot UI: Navigate to Tracing > Traces in TraceRoot Cloud. You should see a trace with root span invoke_agent agent, named after the agent — Pydantic AI infers agent from the variable name unless you pass Agent(name=...).
  2. Via the CLI: Run traceroot traces list to inspect your recent traces from the terminal.

What gets captured

Limitations

None known.

Run the example

Clone the repo and run a complete agent end-to-end.

Python

Run the Python example

Next steps

Python SDK Reference

Explore the full Python SDK reference and instrumentation options.

Cost Tracking

Learn how TraceRoot calculates token costs and tracks model spend.