Respan instrumentation plugin for PydanticAI
Project description
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=...toPydanticAIInstrumentor(...)if you only want to instrument one agent instance. - The plugin uses explicit
InstrumentationSettings(version=4)to keep emitted spans on the current GenAI semantic conventions used elsewhere in this repo. - This package does not depend on OpenInference at runtime; it consumes native PydanticAI telemetry directly.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file respan_instrumentation_pydantic_ai-0.1.1.tar.gz.
File metadata
- Download URL: respan_instrumentation_pydantic_ai-0.1.1.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16a9254c3aa2ec46fc32d0cec7e887c6a4e8c3a83d98f5b99f008b7a7a0f7779
|
|
| MD5 |
c64a2ae4dbd8252b5c2c39cbfe0755b3
|
|
| BLAKE2b-256 |
ec164d6b9ffdadd5d2bedb2e9670bf98b945f67ba3b680afc52a487a13019105
|
Provenance
The following attestation bundles were made for respan_instrumentation_pydantic_ai-0.1.1.tar.gz:
Publisher:
publish.yml on respanai/respan
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
respan_instrumentation_pydantic_ai-0.1.1.tar.gz -
Subject digest:
16a9254c3aa2ec46fc32d0cec7e887c6a4e8c3a83d98f5b99f008b7a7a0f7779 - Sigstore transparency entry: 1325000431
- Sigstore integration time:
-
Permalink:
respanai/respan@f93b8f2f2d4c09bb12546b791305e74f24c7896a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/respanai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f93b8f2f2d4c09bb12546b791305e74f24c7896a -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file respan_instrumentation_pydantic_ai-0.1.1-py3-none-any.whl.
File metadata
- Download URL: respan_instrumentation_pydantic_ai-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f29f0b0f548af91f54eecbb1462d67bbfc91acd8a1c6743e670698f88ec4871
|
|
| MD5 |
161c769777234d58e016bd5c370fd16c
|
|
| BLAKE2b-256 |
07c2dce82016c5d7f7b8329c5e48ae99be921a35d830e9ea2cc7d8a320548bdb
|
Provenance
The following attestation bundles were made for respan_instrumentation_pydantic_ai-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on respanai/respan
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
respan_instrumentation_pydantic_ai-0.1.1-py3-none-any.whl -
Subject digest:
0f29f0b0f548af91f54eecbb1462d67bbfc91acd8a1c6743e670698f88ec4871 - Sigstore transparency entry: 1325000544
- Sigstore integration time:
-
Permalink:
respanai/respan@f93b8f2f2d4c09bb12546b791305e74f24c7896a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/respanai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f93b8f2f2d4c09bb12546b791305e74f24c7896a -
Trigger Event:
workflow_run
-
Statement type: