Set up the SDK

Manually instrument your app with the Respan tracing SDK.

For first-time setup, the Tracing quickstart gets you running in 5 minutes. This page is the deeper manual reference: framework-specific instrumentors, decorators for custom spans, and advanced configuration.

First export your Respan API key, then pick the instrumentation path that matches your stack.

$export RESPAN_API_KEY="your-api-key"

Auto-instrumented SDKs

These LLM SDKs can be traced automatically — just install Respan and initialize. No instrumentor imports needed.

$pip install respan-ai
1from respan import Respan
2Respan()
3# All supported LLM calls are now auto-traced
SDKPythonTypeScript
OpenAI
Anthropic
Azure OpenAI
Google Vertex AI
AWS Bedrock
Cohere
Together AI
Mistral
Ollama
Groq

Agent frameworks (explicit instrumentor)

Agent frameworks require an explicit instrumentor because they capture higher-level spans (agent runs, handoffs, tool calls) beyond raw LLM calls.

$pip install respan-ai respan-instrumentation-openai-agents openai-agents
1from agents import Agent, Runner
2from respan import Respan
3from respan_instrumentation_openai_agents import OpenAIAgentsInstrumentor
4
5Respan(instrumentations=[OpenAIAgentsInstrumentor()])
6
7agent = Agent(name="Assistant", instructions="Reply in one sentence.")
8result = Runner.run_sync(agent, "Explain tracing.")
9print(result.final_output)

Full guide →

Already have OpenTelemetry set up? Send spans directly via Manual ingestion.


Disable auto-instrumentation

By default, Respan auto-instruments all supported providers. You can disable specific ones:

1from respan import Respan
2
3# Disable specific providers
4Respan(
5 block_instruments={"bedrock", "vertexai"}
6)

In Python, you can also enable only specific providers instead of disabling:

1from respan import Respan
2
3# Only instrument OpenAI and Anthropic
4Respan(
5 instruments={"openai", "anthropic"}
6)

Add custom instrumentors

Agent frameworks and custom integrations require explicit instrumentors. Pass them via the instrumentations parameter:

1from respan import Respan
2from respan_instrumentation_openai_agents import OpenAIAgentsInstrumentor
3
4Respan(instrumentations=[OpenAIAgentsInstrumentor()])

When instrumentations are provided, auto-instrumentation is disabled by default to avoid duplicate spans. Pass is_auto_instrument=True (Python) to enable both.


Next steps