npm / @ai-sdk/otel
@ai-sdk/otel
What changed in @ai-sdk/otel 1 to 7, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
14 breaking3 security1 deprecations13 new APIs and options8 behavior and defaults9 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@ai-sdk/otel 79 changes
Breaking changes 7
A new package provides the OpenTelemetry integration, so developers can import it from @ai-sdk/otel.
The package is ESM-only; CommonJS
require()is no longer supported, so use ESMimportsyntax.The tracer property has been removed from experimental_telemetry. Pass a custom OpenTelemetry Tracer to the OpenTelemetry constructor instead.
The minimum supported Node.js version is raised to 22; supported versions are 22, 24, and 26.
Telemetry integrations and tracing-channel subscribers receive the renamed embedding callback and type instead of onEmbedFinish.
Telemetry integrations and tracing-channel subscribers receive the renamed reranking callback and type instead of onRerankFinish.
Telemetry integrations should implement the renamed per-step lifecycle callback onStepEnd instead of onStepFinish.
Behavior and default changes 2
Once a telemetry integration is registered, AI SDK calls emit telemetry by default. Set isEnabled to false to opt out of a specific call, or register no integration to disable telemetry globally.
The telemetry configuration option is now named telemetry; experimental_telemetry remains a deprecated alias during the deprecation window.
@ai-sdk/otel 139 changes
Breaking changes 7
Output parts now follow content order, text blocks are not merged, and supported file, reasoning file, custom, tool error, and tool approval parts are emitted on both output and input sides; the root span records content from all steps in…
The API name changed from evaluate to decide.
Packages are compiled for the ES2022 runtime target, which may affect runtime compatibility.
Packages are ESM-only; consumers using require() must switch to ESM import syntax.
OpenTelemetry is renamed to LegacyOpenTelemetry, so developers using the old name must update their code.
GenAIOpenTelemetry is renamed to OpenTelemetry, so developers using the old name must update their code.
Telemetry integration names change from *TelemetryIntegration to *Telemetry.
Security 3
Both OTel integrations redact every header value in telemetry-only copies of plain Google MCP server tool definitions, keeping connector credentials out of telemetry attributes.
Restores credential redaction for unannotated OpenAI MCP, Code Interpreter, and shell tool definitions in both OpenTelemetry integrations, preserving protection for older providers and plain provider tool definitions without changing application or provider arguments.
Telemetry integrations redact Code Interpreter and shell domain secrets, plus MCP authorization and header values, from exported tool definitions while preserving credentials in provider requests.
Deprecations 1
This function is deprecated;
formatOutputContentis added.
New APIs and options 13
Adds a function for formatting output content.
Formatting helpers and their output types are exported for reuse outside the telemetry integration.
Typed experimental durable context hooks are available for telemetry integrations.
Pass durable context with the same OpenTelemetryIdGenerator used for the tracer provider's idGenerator and sampler to carry parent trace context and sampling across WorkflowAgent steps and reconstruct the enclosing invoke_agent tree.
Records an OpenTelemetry histogram in seconds for generateText and streamText model calls, including errors, cancellation, and failed stream retry attempts, so configured metric exporters can report inference latency.
Telemetry integrations now support the onStepError callback.
Adds an option to OpenTelemetry to name root agent spans using functionId or a custom callback; model-based span names remain the default.
Experimental streaming lifecycle callbacks are added.
Telemetry is added to speech generation and transcription.
Adds telemetry support to experimental_evaluate, allowing developers to use telemetry with it.
An option allows developers to provide custom span attributes.
Performance metrics are emitted using GenAI semantic conventions.
Opt-in options add supplemental AI SDK attributes to OpenTelemetry spans.
Behavior and default changes 6
The actual chat HTTP endpoint is reported through optional request metadata and model-call end events, recorded as host and port on OpenTelemetry chat spans, and exposed as a sanitized origin in generation results and callbacks.
Model-call spans record normalized state parts, while outer spans retain the public state inputs.
Telemetry includes provider usage propagation.
Runtime context attribution is added to embed, embedMany, and rerank.
Spans are now added for providerExecuted tools, making their execution observable through OpenTelemetry.
The integration adds a span at the step level.
Fixes and other changes 9
Ends the span of a model call when a stream retry or steering interrupt starts a new one.
Decision model response identifiers are now recorded.
Decision file bytes are serialized as base64 in OpenTelemetry state attributes.
Spans are marked with status ERROR when the finish reason is error.
API error spans preserve HTTP status codes.
Fallback spans are attributed to the provider that succeeds.
OpenTelemetry now records tool results and definitions for tools executed by the provider.
A nested context object now creates a separate attribute.
Invalid span array attribute values are sanitized to avoid OTLP ingestion failures and function log errors.