Respan instrumentation plugin for the OpenAI Agents SDK
Project description
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.
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_openai_agents-1.1.0.tar.gz.
File metadata
- Download URL: respan_instrumentation_openai_agents-1.1.0.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.9.6 Darwin/25.0.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59197bd7e141c516f686ad80c062cb06abfefb8935f4de58e21586803fc422e7
|
|
| MD5 |
c225620a7e24dbcab72bb44aafde11a1
|
|
| BLAKE2b-256 |
76334879e80c4b14c89932d0419c8fe22967803dacb38385f33bd88fd05a807c
|
File details
Details for the file respan_instrumentation_openai_agents-1.1.0-py3-none-any.whl.
File metadata
- Download URL: respan_instrumentation_openai_agents-1.1.0-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.9.6 Darwin/25.0.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d0db689d3c8f6574f87b4e0ea527c5768d1640ce8ba60ee34ee24964bfb80df
|
|
| MD5 |
82faa00941b0dcd2d1ea8c408e3b5250
|
|
| BLAKE2b-256 |
b894118ff26970338d5d56c5d6b753639c4e3115af7db4a48a90b9e6f33cedeb
|