--- id: openinference-instrumentation-pydantic-ai version: "0.1.20" license: Apache-2.0 license_treatment: permissive maintenance: active --- # openinference-instrumentation-pydantic-ai — OpenInference PydanticAI Instrumentation License: permissive · Maintenance: active · Downloads: 375.5K/mo ## 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 above — 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 pip install openinference-instrumentation-pydantic-ai uv add openinference-instrumentation-pydantic-ai 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_current - Install friction: low - Maintenance: active - Downloads: 375.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pydantic ai instrumentation, opentelemetry tracing pydantic, ai agent observability, distributed tracing pydantic ai, openinference instrumentation, llm agent monitoring, pydantic ai traces, observability, opentelemetry, ai-agents [View on SkillFed](https://skillfed.io/packages/openinference-instrumentation-pydantic-ai) · [View on PyPI](https://pypi.org/project/openinference-instrumentation-pydantic-ai/)