Overview
respan is the recommended way to use Respan. It provides a single Respan() class that sets up tracing, activates instrumentation plugins, and will also initialize the Respan API client when available.
>=3.9, <4.0
Quick start
What it does
Respan() is a facade that orchestrates multiple backends:
RespanTelemetry or RespanAPI directly — Respan handles initialization and configuration for both.
Public exports
Everything you need is available fromrespan:
When to use respan vs respan-tracing
| Use case | Package |
|---|---|
| Instrument OpenAI Agents, OpenAI SDK, etc. | respan |
| Plugin + decorator combo | respan |
| Decorators only, no plugins | respan-tracing directly |
| Building a custom instrumentation plugin | respan-tracing + respan-sdk |
| Need fine-grained OTEL control | respan-tracing directly |
respan. Use respan-tracing directly only when you need manual OTEL configuration.
Next steps
- Respan() — constructor parameters and configuration examples
- propagate_attributes() — attach user/thread/metadata to all spans
- log_batch_results() — log OpenAI Batch API results
- Instrumentation Protocol — build your own plugin