Overview
This guide shows you how to integrate Latitude Telemetry into an application that uses Vercel AI SDK v7.Using Vercel AI SDK v6? See the Vercel AI SDK guide
instead — its telemetry setup is different.
ai package into the separate @ai-sdk/otel package, and it is now opt-out: once you register a telemetry integration, every AI SDK call emits telemetry by default — there is no per-call experimental_telemetry flag anymore. Latitude ingests those spans without a provider-specific instrumentation entry.
You’ll keep calling the Vercel AI SDK exactly as you do today. Telemetry simply
observes and enriches those calls.
The Vercel AI SDK integration is TypeScript only.
Requirements
- A Latitude account and API key
- A Latitude project slug
- A Node.js project that uses Vercel AI SDK v7 (
ai@7) and the matching@ai-sdk/otel
Steps
Initialize and use
Initialize Latitude without an
instrumentations array. Then register the AI SDK
OpenTelemetry integration once, after constructing Latitude — it uses the global tracer
provider that Latitude registered, so spans flow to Latitude automatically. No per-call flag is
needed.The recommended integration is
OpenTelemetry, which emits standard OpenTelemetry GenAI
semantic-convention spans. @ai-sdk/otel also exports LegacyOpenTelemetry, which emits the
older ai.* spans (same as v6). Latitude ingests both.Next.js
Register the integration in yourinstrumentation.ts, alongside your OpenTelemetry provider setup:
instrumentation.ts
Opting out
Telemetry is opt-out. To disable it for a specific call, settelemetry: { isEnabled: false }. To disable it globally, don’t register any telemetry integration.
Seeing Your Traces
Once connected, traces appear automatically in Latitude:- Open your project in the Latitude dashboard
- Each execution shows input/output messages, model, token usage, latency, and errors