generateText, streamText, and generateObject. Unlike v6 — which wrote OpenTelemetry spans to the global tracer directly — v7 moved telemetry to a pluggable “integrations” model: the SDK emits internal telemetry events, and a registered integration turns them into spans. Vercel ships @ai-sdk/otel as the OpenTelemetry integration. Arize AX then ingests those spans through the @arizeai/openinference-vercel span processor.
If you’re on AI SDK v6 or earlier, use the Vercel AI SDK (v6 and earlier) guide instead — v6 emits OpenTelemetry spans natively and does not need
@ai-sdk/otel. The two SDK versions wire telemetry differently, so the setup is not interchangeable.Prerequisites
- Node.js 22+ (required by
@arizeai/openinference-vercel@3and@ai-sdk/otel) - An Arize AX account (sign up)
- An
OPENAI_API_KEYfrom the OpenAI Platform - Vercel AI SDK 7 (
ai@^7)
Launch Arize AX
- Sign in to your Arize AX account.
- From Space Settings, copy your Space ID and API Key. You will set them as
ARIZE_SPACE_IDandARIZE_API_KEYbelow.
Install
Install the AI SDK v7, the@ai-sdk/otel telemetry integration, and the OpenInference processor. Pick the tab for your runtime — they differ only in the OpenTelemetry registration helper.
- Node.js
- Next.js
@ai-sdk/otel is the piece that makes v7 emit spans at all. Without a registered telemetry integration, experimental_telemetry: { isEnabled: true } enables the SDK’s telemetry events but nothing converts them to OpenTelemetry spans, so nothing reaches Arize.Configure credentials
Setup tracing
Register the OpenTelemetry provider and the@ai-sdk/otel integration in one startup file. registerTelemetry(new OpenTelemetry()) (from ai and @ai-sdk/otel) installs the integration globally, so individual generateText/streamText calls only need the experimental_telemetry: { isEnabled: true } opt-in. Pick the tab that matches your runtime. The processor’s spanFilter and reparentOrphanedSpans options control which spans reach Arize and how each trace is rooted — see Span filter.
- Node.js
- Next.js
Run Vercel AI SDK
This is a standalone Node script. In Next.js, you don’t import
provider or call forceFlush() — the root instrumentation.ts registers tracing automatically. Just add experimental_telemetry: { isEnabled: true } to the generateText/streamText calls inside your route handlers or server actions.Expected output
Verify in Arize AX
- Open your Arize AX space and select project
vercel-ai-sdk-v7-tracing-example. - Within ~30 seconds you should see a trace for the call. v7 names its spans with the GenAI convention rather than the v6
ai.generateTextnames — the OpenInference processor classifies them by span kind, which is what you read in the UI:
chat LLM span holds the prompt, the model’s response, and token usage. Tool calls appear as additional tool spans under the step.
- If no traces appear, see Troubleshooting.
Span filter
Other instrumentations registered alongside the AI SDK (@opentelemetry/instrumentation-http, @vercel/otel, Next.js’s built-in tracing) emit POST / GET spans for every fetch, and the AI SDK’s spans nest under those HTTP roots. Two options on the processor control which spans reach Arize and how they’re rooted:
spanFilter: isOpenInferenceSpankeeps only the AI spans and drops the rest — the raw HTTP/fetch spans those other instrumentations emit.reparentOrphanedSpans: truere-roots any AI span left orphaned when the filter drops its parent, so the top-level call span becomes a clean trace root instead of pointing at a parent that was never exported.
Troubleshooting
- No traces in Arize AX. v7 emits no spans unless a telemetry integration is registered — confirm
@ai-sdk/otelis installed andregisterTelemetry(new OpenTelemetry())runs in yourinstrumentation.ts. Each call also needsexperimental_telemetry: { isEnabled: true }. ConfirmARIZE_SPACE_IDandARIZE_API_KEYare set in the same shell, and enable debug logs withexport OTEL_LOG_LEVEL=debug. 401from OpenAI. VerifyOPENAI_API_KEYis set and has access togpt-5.5. Swapopenai("gpt-5.5")for a model your key can call.- Process exits before spans flush. Always
await provider.forceFlush()(orprovider.shutdown()) before the process exits, otherwise trailing spans are dropped. - Next.js / Vercel runtime. Use
@vercel/otel’sregisterOTel(...)instead ofNodeTracerProvider, and pin versions:@vercel/otel@1.xrequires@opentelemetry/*1.x;@vercel/otel@2.xrequires2.x. Mismatches surface as silent missing traces. - AI SDK spans orphaned on the Traces tab. Set
reparentOrphanedSpans: trueon the processor as shown in Span filter, and confirm@arizeai/openinference-vercelis 3.0.0 or later — stable v7 telemetry support (and the v7-aware reparenting) landed in the v3 major. - You want the v6 span names.
@ai-sdk/otelalso exports aLegacyOpenTelemetryintegration that emits the olderai.generateText/ai.generateText.doGeneratespan names; register it in place ofOpenTelemetryif you have dashboards or evaluators keyed on those names.