Skip to main content

respan-instrumentation-pydantic-ai

Respan instrumentation plugin for PydanticAI.

This package enables PydanticAI's native OpenTelemetry emission and maps the resulting PydanticAI attributes directly into the Respan/Traceloop conventions used by the OTLP pipeline.

Install

pip install respan-instrumentation-pydantic-ai

Quickstart

import os

from pydantic_ai import Agent
from pydantic_ai.models.openai import OpenAIModel
from pydantic_ai.providers.openai import OpenAIProvider
from respan import Respan
from respan_instrumentation_pydantic_ai import PydanticAIInstrumentor

respan = Respan(
    api_key=os.environ["RESPAN_API_KEY"],
    instrumentations=[PydanticAIInstrumentor()],
)

agent = Agent(
    OpenAIModel("gpt-4o-mini", provider=OpenAIProvider(api_key=os.environ["OPENAI_API_KEY"]))
)

result = agent.run_sync("Write a one-line haiku about tracing.")
print(result.output)

respan.flush()

Notes

  • By default the instrumentor enables global PydanticAI instrumentation via Agent.instrument_all(...).
  • Pass agent=... to PydanticAIInstrumentor(...) if you only want to instrument one agent instance.
  • The plugin uses explicit InstrumentationSettings(version=5) to keep emitted spans on the current Pydantic AI v2 GenAI semantic conventions.
  • This package does not depend on OpenInference at runtime; it consumes native PydanticAI telemetry directly.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

respan_instrumentation_pydantic_ai-0.1.3.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file respan_instrumentation_pydantic_ai-0.1.3.tar.gz.

File metadata

File hashes

Hashes for respan_instrumentation_pydantic_ai-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ce25e3faee546f05f75037f38c03e54b53a8158763b6d80d2a417e6df8628180
MD5 e8cb8a444ff98c6f2fa96d3cb488f286
BLAKE2b-256 1d6843e884bbd487b1c31085eccbfa57c145b5ef3935bc543402bedc6a45dbe3

See more details on using hashes here.

Provenance

The following attestation bundles were made for respan_instrumentation_pydantic_ai-0.1.3.tar.gz:

Publisher: publish.yml on respanai/respan

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file respan_instrumentation_pydantic_ai-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for respan_instrumentation_pydantic_ai-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e992ac1c333881aee522df00f89ecb227fe63f3de935d240099bdabde26b4622
MD5 e3d97ece6cc22eb19709d935e0500a73
BLAKE2b-256 8aa91b59831ce2acadff1bb5b36c1b5e60f9007a64cdc96be64c4d6a96c1a489

See more details on using hashes here.

Provenance

The following attestation bundles were made for respan_instrumentation_pydantic_ai-0.1.3-py3-none-any.whl:

Publisher: publish.yml on respanai/respan

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page