Pydantic AI
Overview
respan-instrumentation-pydantic-ai enables Pydantic AI’s native OpenTelemetry emission and maps Pydantic AI v2 GenAI attributes into Respan conventions.
The plugin registers a local span processor and calls Pydantic AI’s Agent.instrument_all(...) by default, so model requests, agent runs, and tools are normalized before export.
Version: 0.1.0 | Python: >=3.11, <3.14
Dependencies
Quick start
Public API
PydanticAIInstrumentor
Captured data
The plugin captures agent spans, chat/model request spans, tool spans, model names, token usage, tool definitions, tool calls, response formats, and prompt/response content when content capture is enabled.
Structured message parts and tool payloads are serialized into JSON-safe string attributes before export so Pydantic AI v2 payloads render correctly in Respan.
Gateway
For a Respan-key-only runtime setup, see Pydantic AI gateway setup.