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

Most of these LLM SDKs are traced automatically — just install Respan and initialize, no instrumentor imports needed. A few (marked ➕) need an explicit instrumentor; see the footnotes below the table.

$pip install respan-ai
1from respan import Respan
2Respan()
3# All supported LLM calls are now auto-traced

Legend: ✅ auto-instrumented (no imports) · ➕ supported, needs an explicit instrumentor (see footnotes) · — not supported.

SDKPythonTypeScript
OpenAI
Anthropic
Azure OpenAI
Google Vertex AI
Google GenAI (Gemini)2
AWS Bedrock
Cohere1
Together AI
Mistral1
Ollama
Groq1

1 Not bundled in respan-ai. Install the provider’s instrumentor and pass it, e.g. pip install respan-instrumentation-cohere then Respan(instrumentations=[CohereInstrumentor()]). Mistral and Groq require Python <3.13.

2 In TypeScript, @google/genai is not auto-instrumented — see the Google GenAI guide.


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