Skip to main content
The Vercel AI SDK emits ai.* spans natively. Wire an OTel exporter pointing at Agnost, then enable telemetry per call with userId / sessionId.
Vercel AI telemetry can include prompts, completions, and metadata. Review Data Governance before enabling production traffic.

1. Install

Already have @opentelemetry/sdk-node (or another OTel SDK) and @opentelemetry/exporter-trace-otlp-proto? Skip: you only need the existing packages. No OTel set up yet?

2. Wire the OTel exporter pointing at Agnost

Already exporting OTel? Append Agnost as an additional span processor on your existing TracerProvider:
No OTel yet? Boot a NodeSDK at startup (e.g. Next.js instrumentation.ts):

3. Pass userId / sessionId per call

experimental_telemetry.isEnabled defaults to false: set it per call.

What appears in Agnost

  • Conversations grouped by sessionId.
  • User-level analytics grouped by userId.
  • Raw logs for every generated span.

Verify

Run one generateText call, then open Raw logs in Agnost. If the event is present, check Conversations for session grouping.

Troubleshooting

  • Confirm experimental_telemetry.isEnabled is true on the call.
  • Confirm the OTLP exporter is initialized before the first AI SDK call.
  • Confirm X-Agnost-Org-ID is set on the exporter.

References