Skip to main content

respan-instrumentation-openai-agents

Respan instrumentation plugin for the OpenAI Agents SDK. Captures agent traces, tool calls, handoffs, and LLM generations via the OTEL pipeline.

Configuration

1. Install

pip install respan-instrumentation-openai-agents

2. Set Environment Variables

Variable Required Description
RESPAN_API_KEY Yes Your Respan API key. Authenticates both proxy and tracing.
RESPAN_BASE_URL No Defaults to https://api.respan.ai.

All vendor-specific variables (e.g. OPENAI_API_KEY) are derived from these in your application code.

Quickstart

3. Run Script

import asyncio
import os
from agents import Agent, Runner
from respan import Respan
from respan_instrumentation_openai_agents import OpenAIAgentsInstrumentor

respan_api_key = os.environ["RESPAN_API_KEY"]
respan_base_url = os.getenv("RESPAN_BASE_URL", "https://api.respan.ai")

os.environ["OPENAI_API_KEY"] = respan_api_key
os.environ["OPENAI_BASE_URL"] = f"{respan_base_url}/api/openai"

respan = Respan(
    api_key=respan_api_key,
    base_url=respan_base_url,
    instrumentations=[OpenAIAgentsInstrumentor()],
)

agent = Agent(name="Assistant", instructions="You are a helpful assistant.")

async def main():
    result = await Runner.run(agent, "Hello!")
    print(result.final_output)

asyncio.run(main())
respan.flush()

4. View Dashboard

After running the script, traces appear on your Respan dashboard.

Further Reading

See the examples/openai-agents-sdk/ directory for runnable examples including tool use, handoffs, multi-agent workflows, guardrails, and streaming.

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_openai_agents-1.1.2.tar.gz (8.4 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_openai_agents-1.1.2.tar.gz.

File metadata

File hashes

Hashes for respan_instrumentation_openai_agents-1.1.2.tar.gz
Algorithm Hash digest
SHA256 28b1506a37ff57a40748663bc9f1f8a79123af3d69c646f97ffc7522dd0bab11
MD5 d2692426d6211123a4f031fe11813ac6
BLAKE2b-256 a8d69eae2434aa468268566811a24578fc2d714f828e634698ea3ffb06b3825a

See more details on using hashes here.

Provenance

The following attestation bundles were made for respan_instrumentation_openai_agents-1.1.2.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_openai_agents-1.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for respan_instrumentation_openai_agents-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4929811b634334ec496ecbeec82282cc406cf2c8c52b222cd872cb74f1153d8b
MD5 2ff6181fb05d95834a71f5b37caf1f64
BLAKE2b-256 b78d9268be4fd70b672229912d9492975f2cceebff582cb3b62b7743e704d609

See more details on using hashes here.

Provenance

The following attestation bundles were made for respan_instrumentation_openai_agents-1.1.2-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

1.1.2 This release

2 files

1.1.1

2 files

1.1.0

2 files

1.0.2

2 files

1.0.1

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