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
from respan import Respan
Respan()
# 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✅✅
Cohere➕ 1✅
Together AI✅✅
Mistral➕ 1—
Ollama✅—
Groq➕ 1—

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
from agents import Agent, Runner
from respan import Respan
from respan_instrumentation_openai_agents import OpenAIAgentsInstrumentor
Respan(instrumentations=[OpenAIAgentsInstrumentor()])
agent = Agent(name="Assistant", instructions="Reply in one sentence.")
result = Runner.run_sync(agent, "Explain tracing.")
print(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:

from respan import Respan
# Disable specific providers
Respan(
block_instruments={"bedrock", "vertexai"}
)

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

from respan import Respan
# Only instrument OpenAI and Anthropic
Respan(
instruments={"openai", "anthropic"}
)

Add custom instrumentors

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

from respan import Respan
from respan_instrumentation_openai_agents import OpenAIAgentsInstrumentor
Respan(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