Why
Self-hosting teams already run their own observability stacks (Grafana, Prometheus, Datadog - anything that speaks OTLP). Agent runs should be observable there: the user's data and metrics stay in the user's infrastructure. No hosted collector, no consent flow, no default network activity, no new always-on dependency.
Rescoped 2026-08-10: this issue originally proposed opt-in anonymous product telemetry to a project-hosted collector. That idea is deliberately deferred (revisit at the 1.0 decision). The instrumentation built here keeps that path cheap if it is ever wanted - the same OTLP pipeline could later point at a project collector behind an explicit consent switch.
Behavior
- Activation is endpoint-driven, following the standard OTLP convention: when
OTEL_EXPORTER_OTLP_ENDPOINT (plus the usual companion vars) is set, the agent runtime registers @ai-sdk/otel and exports; when unset, the exporter module is never loaded (dynamic import) - zero runtime cost, zero network calls.
- Default span/metric attributes are metadata-only: run id,
workflowType, executionMode, tool name, outcome status/errorClass, duration, budget counters, model family, token buckets. SQL text, schema identifiers, prompts and result data are never attached by default - on a multi-user instance the operator reading the dashboards is not necessarily the query author.
- A documented verbose opt-in flag may widen attributes; the exact delta is listed in the docs, not left implicit.
- Embedded/platform builds: the host application owns OTel registration; the package must not register a second global SDK.
Scope
Target
Ships with the M2 preview (#329); documented as an enterprise-facing capability ("your data, your metrics, your stack").
Part of #325
Why
Self-hosting teams already run their own observability stacks (Grafana, Prometheus, Datadog - anything that speaks OTLP). Agent runs should be observable there: the user's data and metrics stay in the user's infrastructure. No hosted collector, no consent flow, no default network activity, no new always-on dependency.
Behavior
OTEL_EXPORTER_OTLP_ENDPOINT(plus the usual companion vars) is set, the agent runtime registers@ai-sdk/oteland exports; when unset, the exporter module is never loaded (dynamic import) - zero runtime cost, zero network calls.workflowType,executionMode, tool name, outcome status/errorClass, duration, budget counters, model family, token buckets. SQL text, schema identifiers, prompts and result data are never attached by default - on a multi-user instance the operator reading the dashboards is not necessarily the query author.Scope
@ai-sdk/otel+ OTLP exporter (dormant unless configured)docs/OBSERVABILITY.md: env vars, span catalogue, a Grafana/Prometheus quickstartTarget
Ships with the M2 preview (#329); documented as an enterprise-facing capability ("your data, your metrics, your stack").
Part of #325