Installation
Classes
RespanExporter
OpenTelemetrySpanExporter implementation that converts Vercel AI SDK spans to Respan format.
| Parameter | Type | Default | Description |
|---|---|---|---|
apiKey | string | — | Respan API key. Falls back to RESPAN_API_KEY env var. |
baseUrl | string | undefined | "https://api.respan.ai" | API base URL. |
Methods
| Method | Description |
|---|---|
export(spans, resultCallback) | Export OpenTelemetry spans to Respan. |
Internal processing
The exporter automatically:- Deduplicates AI SDK spans
- Parses model information, prompt messages, and tool calls
- Extracts token usage and cost data
- Maps Vercel AI metadata to Respan span attributes
- Handles streaming response data