Exporter for Anthropic Agent SDK telemetry to Respan
Project description
Respan Exporter for Anthropic Agent SDK
Exporter for Anthropic Agent SDK telemetry to Respan.
Installation
pip install respan-exporter-anthropic-agents
Quickstart
import asyncio
from claude_agent_sdk import ClaudeAgentOptions
from respan_exporter_anthropic_agents.respan_anthropic_agents_exporter import (
RespanAnthropicAgentsExporter,
)
exporter = RespanAnthropicAgentsExporter()
async def main() -> None:
options = exporter.with_options(
options=ClaudeAgentOptions(
allowed_tools=["Read", "Glob", "Grep"],
permission_mode="acceptEdits",
)
)
async for message in exporter.query(
prompt="Analyze this repository and summarize architecture.",
options=options,
):
print(message)
asyncio.run(main())
Configuration
Environment Variables
| Variable | Required | Description |
|---|---|---|
RESPAN_API_KEY |
Yes | Your Respan API key. |
RESPAN_BASE_URL |
No | Base URL for all Respan services. Defaults to https://api.respan.ai. |
RESPAN_BASE_URL is the single base URL that controls where telemetry is exported. The exporter automatically appends /api/v1/traces/ingest to build the full endpoint.
Constructor Parameters
All configuration can also be passed directly to the constructor (takes priority over environment variables):
exporter = RespanAnthropicAgentsExporter(
api_key="your_respan_key", # Overrides RESPAN_API_KEY
base_url="https://api.respan.ai", # Overrides RESPAN_BASE_URL
endpoint="https://custom/ingest", # Full endpoint URL (overrides base_url)
timeout_seconds=15,
max_retries=3,
base_delay_seconds=1.0,
max_delay_seconds=30.0,
)
Examples
Runnable examples with full setup instructions:
- Python: anthropic_agents_python_example
- TypeScript: anthropic_agents_typescript_example
Dev Guide
Running Tests
# Unit tests
python -m unittest tests.test_exporter -v
# Live integration test (opt-in, makes real API calls)
export RESPAN_API_KEY="your_respan_key"
export IS_REAL_GATEWAY_TESTING_ENABLED=1
python -m unittest tests.test_real_gateway_integration -v
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_exporter_anthropic_agents-1.0.9.tar.gz.
File metadata
- Download URL: respan_exporter_anthropic_agents-1.0.9.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.8 Darwin/25.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb3a9b588af27714025a56712320233c066c3edbe709d9e98aebb97531a941ea
|
|
| MD5 |
d176c734392144e032df5fd1ce2c07d2
|
|
| BLAKE2b-256 |
cc612e837b3ef86fc73aab7761438a26d02b0734a47caf71c677af22739ad651
|
File details
Details for the file respan_exporter_anthropic_agents-1.0.9-py3-none-any.whl.
File metadata
- Download URL: respan_exporter_anthropic_agents-1.0.9-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.8 Darwin/25.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ffec14de9204ef19d8a070feef536f6a0a597934a0d1a64c9deddf436b36138e
|
|
| MD5 |
b4d69f447f806c2343892aa184a606c9
|
|
| BLAKE2b-256 |
86fa6e580ffd5d0072228206487e686e3bd77b088cb3ff46eaef4e2d08cd6bdf
|