Setup
- Python
Usage
Once initialized, all Pydantic AI agent runs and tool invocations are captured automatically:What Gets Captured
Run the example
Clone the repo and run a complete agent end-to-end.Python
Run the Python example
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Auto-instrument Pydantic AI agent runs, LLM calls, and tool invocations
import traceroot
from traceroot import Integration
traceroot.initialize(integrations=[Integration.PYDANTIC_AI])
import traceroot
from traceroot import Integration
from pydantic_ai import Agent
traceroot.initialize(integrations=[Integration.PYDANTIC_AI])
agent = Agent(
"openai:gpt-4o-mini",
system_prompt="You are a helpful assistant.",
)
result = agent.run_sync("What is the capital of France?")
print(result.output)
traceroot.flush()
| Attribute | Description |
|---|---|
| Agent runs | Each agent.run() / agent.run_sync() / agent.run_stream() invocation |
| Tool calls | Each tool invocation with input arguments and results |
| LLM calls | Raw completion requests with input messages, output messages, and model name |
| Tokens & Cost | Input and output token counts per LLM call; cost calculated from model pricing |
| Cache tokens | Cache read and write token counts when reported by the provider |
| Latency | Duration per agent run and per span |