Skip to main content
The Vercel AI SDK is the one framework here that is not OpenTelemetry-native, so it does not use the exporter-only recipe the others do. It has its own telemetry API, and Tracelane ships an integration for it.
Why this page is different. As of ai@7, generateText emits no OpenTelemetry spans by itself — the package has no @opentelemetry/api dependency. Passing experimental_telemetry: { isEnabled: true } alone gets you nothing. The AI SDK instead exposes registerTelemetry(), and tracelaneTelemetry() maps it onto OpenTelemetry.

What you get

Setup

Then enable telemetry per call — the AI SDK requires this, and Tracelane cannot turn it on for you:
Your API key needs the ingest scope. Mint one in Settings → API keys.
Flush before your process exits. BatchSpanProcessor buffers, so a short-lived script or a serverless invocation can exit with spans still in memory and nothing will arrive. Call await provider.shutdown() before exit. This is the single most common reason a correct setup shows no traces.

What a trace looks like

A two-step tool-calling run, verified end to end against Tracelane production on 2026-08-31 — 6 spans, 1 root, 5 parented, 0 orphans, read back from storage:

Span volume

An OTel span and a gateway call are not the same unit, but they count against the same meter. A gateway request and an OTel span both count as ingest bytes — there is no separate quota for one path or the other. On this path your app sends spans, and one agent run is many — the trace above is 6 for a single generateText, and each extra step and tool call adds more. Size your ingest estimate against spans per run, not runs, and see pricing.

The alternative: the gateway base URL

If you only need the model call and want routing, BYOK, guardrails, caching and budgets, point the SDK’s provider at the Tracelane gateway instead:
They compose: run both and you get gateway features plus agent structure. Note the two do not currently join into a single trace — a gateway-proxied call does not adopt your agent’s trace context, so it appears as its own single-span trace.
Earlier releases exported instrumentVercelAI(ai). It never worked — it mutated the imported ai module object, and ES module namespaces are read-only. It now throws an error naming this replacement.