Set up Respan
Set up Respan
- Sign up — Create an account at platform.respan.ai
- Create an API key — Generate one on the API keys page
- Add credits or a provider key — Add credits on the Credits page or connect your own provider key on the Integrations page
Overview
respan-tracing is a Python SDK built on OpenTelemetry that captures telemetry for your LLM applications. It records workflows, tasks, agents, and tools as hierarchical spans, tracks timings and errors, and sends traces to Respan for visualization and debugging.
Core concepts
| Concept | Description |
|---|---|
| Workflow | An end-to-end agent run. Creates a root trace span. |
| Task | A single operation within a workflow (LLM call, data processing, validation). |
| Agent | An autonomous entity with decision-making capabilities. Sets workflow name context for nested spans. |
| Tool | A callable operation used by agents or tasks (search, calculator, API call). |
| Trace | The full tree of spans sent to Respan for visualization. |
Public API
Initialization
| Export | Description |
|---|---|
RespanTelemetry | Main entry point. Initializes tracing, configures exporters, and enables auto-instrumentation. |
get_client() | Returns a RespanClient bound to the singleton tracer for span operations. |
Decorators
| Decorator | Description |
|---|---|
@workflow | Marks a function or class as a traced workflow (root span). |
@task | Marks a function or class as a traced task (child span). |
@agent | Marks a function or class as a traced agent span. |
@tool | Marks a function or class as a traced tool span. |
name, version, method_name, and processors parameters.
Context managers
| Export | Description |
|---|---|
respan_span_attributes() | Attaches Respan-specific attributes (customer_identifier, metadata, etc.) to spans within the context. |
Instrumentation
| Export | Description |
|---|---|
Instruments | Enum of 30+ supported auto-instrumentations (OpenAI, Anthropic, LangChain, vector DBs, etc.). |
Types
| Export | Description |
|---|---|
RespanParams | Pydantic model for Respan-specific parameters (customer_identifier, trace_group_identifier, metadata). |
Quick example
Next steps
- Start with the Quickstart
- Learn decorators: workflow, task, agent, tool
- Explore the Client API
- Configure Instrumentation
- Use Contexts