Choose a setup method
Start with one method for a call path. Combining SDK tracking with framework
OpenTelemetry on the same call can create duplicate interactions.
Recommended: Agnost AI skill
Recommended. Choose this path when you want your coding agent to inspect the
project, select a supported transport, make the smallest instrumentation change,
send a test event, and verify that it reached Agnost AI.
Manual setup: Agnost AI SDK
Manual setup: OpenTelemetry
The Vercel AI SDK emitsai.* spans natively. Wire an OTel exporter pointing at Agnost AI, then enable telemetry per call with userId / sessionId.
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 AI
Already exporting OTel? Append Agnost AI as an additional span processor on your existing TracerProvider:instrumentation.ts):
3. Pass userId / sessionId per call
experimental_telemetry.isEnabled defaults to false: set it per call.
What appears in Agnost AI
- Conversations grouped by
sessionId. - User-level analytics grouped by
userId. - Events for every generated span.
Verify
Run onegenerateText call, then open Events in Agnost AI. If the event is present, check Conversations for session grouping.
Troubleshooting
- Confirm
experimental_telemetry.isEnabledistrueon the call. - Confirm the OTLP exporter is initialized before the first AI SDK call.
- Confirm
X-Agnost-Org-IDis set on the exporter.
References
Next steps
- Conversations: review the complete Vercel AI SDK interaction.
- Events: inspect generated model and tool spans.
- Intents: organize production conversations by what users wanted.
