@ai-sdk/otel). The simplest setup is @arizeai/phoenix-otel, which handles the OpenTelemetry provider, OpenInference span processing, and export to Phoenix in a single register() call.
Version compatibility
AI SDK v7 telemetry requires Node.js 22 or newer.
Installation
Setup
Since AI SDK v7, telemetry is emitted once you register a telemetry integration withregisterTelemetry(new OpenTelemetry(...)). Pair that with register() from @arizeai/phoenix-otel, which processes the resulting spans and exports them to Phoenix:
node --import ./instrumentation.ts index.ts, or import "./instrumentation.js" at the top of your application’s entrypoint.
Once the telemetry integration is registered, AI SDK calls are traced by default; no per-call configuration is required. Use the telemetry option for per-call metadata such as functionId, or to opt out with isEnabled: false.
ToolLoopAgent run is traced end to end, with the agent, each LLM step, and every tool call captured as spans in a single trace. See the AI SDK agent example for a complete runnable project.
register() uses a batch span processor by default, so spans still queued when a short-lived script exits may not be exported. Call await provider.shutdown() before exit to flush them, or pass batch: false to register() for immediate export.Next.js
In a Next.js project, register the telemetry integration and@vercel/otel from the register() function in instrumentation.ts, using the OpenInference span processor from @arizeai/openinference-vercel, the same processor @arizeai/phoenix-otel uses under the hood:
@vercel/otel within a Next.js project.
When instrumenting a Next.js application, traced spans will not be “root spans” when the OpenInference span filter is configured. This is because Next.js parents spans underneath http requests, which do not meet the requirements to be an OpenInference span.
Examples
- AI SDK Agent: an AI SDK v7
ToolLoopAgenttraced with@arizeai/phoenix-otel - Next.js OpenAI Telemetry Example in the OpenInference repo

