Skip to main content

Exporter for Anthropic Agent SDK telemetry to Respan

Project description

Respan Exporter for Anthropic Agent SDK

respan.ai | Documentation

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,
)

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


Download files

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

Source Distribution

respan_exporter_anthropic_agents-1.0.8.tar.gz (8.7 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_exporter_anthropic_agents-1.0.8.tar.gz.

File metadata

File hashes

Hashes for respan_exporter_anthropic_agents-1.0.8.tar.gz
Algorithm Hash digest
SHA256 caee72a6be825ed194207b85370a051eeb64fb5f799b3d17285bb728c5d66d83
MD5 242a783a613e3a613c39096b7240f3a4
BLAKE2b-256 eb2e70d0e1bff80e04471f84f0322539e546dc41871a0a95149b0b14e1c5e8f8

See more details on using hashes here.

File details

Details for the file respan_exporter_anthropic_agents-1.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for respan_exporter_anthropic_agents-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 ee31a22201a98ab6995b2f333ab94240f6b4fd1106c1e6c2c91b0e7ef502544f
MD5 b83988721cbb1766c914c73918c2fb46
BLAKE2b-256 b5dfb361ce43eacd652f2fe02367c3d31b6fd30a7491562729318772c2c0ebab

See more details on using hashes here.

Supported by

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