skillfed

openinference-instrumentation-pydantic-ai

OpenInference PydanticAI Instrumentation

openinference-instrumentation-pydantic-ai v0.1.20 375.5K downloads/30d#7,137 on PyPI1,147
Permissive license Apache-2.0 Active released

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-ai

uv

uv add openinference-instrumentation-pydantic-ai

poetry

poetry add openinference-instrumentation-pydantic-ai

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

pydantic ai instrumentationopentelemetry tracing pydanticai agent observabilitydistributed tracing pydantic aiopeninference instrumentationllm agent monitoringpydantic ai traces
observabilityopentelemetryai-agents

More Monitoring packages

tqdm

Wraps any iterable to display a real-time…

copyleft · top 100 on PyPI

opentelemetry-semantic-conventions

Provides generated Python code for…

permissive · top 100 on PyPI

opentelemetry-sdk

Provides the reference implementation of the…

permissive · top 100 on PyPI

opentelemetry-api

Provides the abstract API and interfaces for…

permissive · top 100 on PyPI

opentelemetry-exporter-otlp-proto-http

Exports OpenTelemetry observability data to an…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation

Provides automatic instrumentation commands and…

permissive · top 1,000 on PyPI

logfire

Logfire is a Python observability platform that…

permissive · top 1,000 on PyPI

openinference-instrumentation-agno

Auto-instruments Agno Agent applications to…

permissive · top 15,000 on PyPI

openinference-instrumentation-google-genai

Automatically instruments Google GenAI SDK…

permissive · top 15,000 on PyPI

openinference-instrumentation-crewai

Automatically instruments CrewAI agent…

permissive · top 15,000 on PyPI

openinference-instrumentation-anthropic

Automatically captures and exports traces from…

permissive · top 15,000 on PyPI

openinference-instrumentation-dspy

Auto-instruments DSPy applications to generate…

permissive · top 15,000 on PyPI

arize

Arize is a Python client library for…

permissive · top 5,000 on PyPI

openinference-instrumentation-claude-agent-sdk

Auto-instruments Claude Agent SDK calls to emit…

permissive · top 15,000 on PyPI

openinference-instrumentation-google-adk

Auto-instruments Google ADK applications to…

permissive · top 15,000 on PyPI

openinference-instrumentation-llama-index

Auto-instruments LlamaIndex applications to…

permissive · top 15,000 on PyPI