openinference-instrumentation-pydantic-ai
OpenInference PydanticAI Instrumentation
What it is and what it does
This package adds automatic tracing to PydanticAI agents by wrapping their execution with OpenTelemetry instrumentation. It captures agent interactions, model calls, and reasoning steps as structured spans that conform to the OpenInference standard, making them viewable in observability platforms like Arize Phoenix and Arize AX. The instrumentation is transparent—you enable it by adding a span processor to your tracer provider, and all subsequent agent runs emit traces without code changes to your agent logic.
The package is built on top of the OpenInference instrumentation framework and depends on OpenTelemetry's core APIs and semantic conventions. It's designed for developers who want to monitor, debug, and analyze PydanticAI agent behavior in development and production environments. The traces can be exported to any OpenTelemetry-compatible backend, giving you flexibility in where and how you store and visualize agent execution data.
Use it for:
- Debug PydanticAI agent reasoning and model interactions by viewing detailed traces in Phoenix or Arize AX.
- Monitor agent performance and latency across model calls in production environments.
- Analyze agent behavior patterns and identify bottlenecks or failure modes.
- Track structured outputs and model responses for compliance or audit purposes.
- Correlate agent traces with other application telemetry in a unified observability platform.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Auto-instruments PydanticAI agents to emit OpenTelemetry traces compatible with observability platforms like Arize Phoenix and Arize AX.
Yes. The package is actively maintained, has no known vulnerabilities, installs with low friction, and directly solves the problem of observing PydanticAI agents. If you're running PydanticAI in production or need visibility into agent behavior, this is the standard instrumentation library. The Apache-2.0 license is permissive for commercial use.
Install
openinference-instrumentation-pydantic-ai on PyPI
pip
pip install openinference-instrumentation-pydantic-aiuv
uv add openinference-instrumentation-pydantic-aipoetry
poetry add openinference-instrumentation-pydantic-aiInstalling openinference-instrumentation-pydantic-ai
Before you install
Low friction: pure Python wheel with seven runtime dependencies already in the OpenTelemetry and OpenInference ecosystems. Active maintenance—released 2 days ago with a 1147-star repository and continuous commits.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most production environments.
Quickstart
pip install openinference-instrumentation-pydantic-ai
from openinference.instrumentation.pydantic_ai import OpenInferenceSpanProcessor
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import SimpleSpanProcessor
tracer_provider = TracerProvider()
tracer_provider.add_span_processor(OpenInferenceSpanProcessor())
tracer_provider.add_span_processor(SimpleSpanProcessor(exporter))
Requires Python 3.10 or later; OpenTelemetry SDK and an exporter (e.g., OTLP) must be installed separately to send traces to a collector.
Verify before relying
- Whether the package supports PydanticAI versions beyond what the fact sheet indicates.
- Performance overhead of instrumentation on agent execution latency.
- Whether custom span processors or filtering options are available beyond the documented quickstart.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (<3.15,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 7 — openinference-instrumentation, openinference-semantic-conventions, opentelemetry-api, opentelemetry-instrumentation, opentelemetry-semantic-conventions, typing-extensions, wrapt |
| Maintenance | actively maintained — 2 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 375,482/month — #7,137 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: openinference_instrumentation_pydantic_ai-0.1.20-py3-none-any.whl
Tags
More Monitoring packages
Wraps any iterable to display a real-time…
copyleft · top 100 on PyPI
opentelemetry-semantic-conventionsProvides generated Python code for…
permissive · top 100 on PyPI
opentelemetry-sdkProvides the reference implementation of the…
permissive · top 100 on PyPI
opentelemetry-apiProvides the abstract API and interfaces for…
permissive · top 100 on PyPI
opentelemetry-exporter-otlp-proto-httpExports OpenTelemetry observability data to an…
permissive · top 1,000 on PyPI
opentelemetry-instrumentationProvides automatic instrumentation commands and…
permissive · top 1,000 on PyPI
logfireLogfire is a Python observability platform that…
permissive · top 1,000 on PyPI
openinference-instrumentation-agnoAuto-instruments Agno Agent applications to…
permissive · top 15,000 on PyPI
openinference-instrumentation-google-genaiAutomatically instruments Google GenAI SDK…
permissive · top 15,000 on PyPI
openinference-instrumentation-crewaiAutomatically instruments CrewAI agent…
permissive · top 15,000 on PyPI
openinference-instrumentation-anthropicAutomatically captures and exports traces from…
permissive · top 15,000 on PyPI
openinference-instrumentation-dspyAuto-instruments DSPy applications to generate…
permissive · top 15,000 on PyPI
arizeArize is a Python client library for…
permissive · top 5,000 on PyPI
openinference-instrumentation-claude-agent-sdkAuto-instruments Claude Agent SDK calls to emit…
permissive · top 15,000 on PyPI
openinference-instrumentation-google-adkAuto-instruments Google ADK applications to…
permissive · top 15,000 on PyPI
openinference-instrumentation-llama-indexAuto-instruments LlamaIndex applications to…
permissive · top 15,000 on PyPI