Skip to main content

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. 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.
Install the skill once in your coding-agent environment:
Run the framework-specific prompt below from the application root. Review the resulting diff before deploying it.

Manual setup: Agnost AI SDK

Manual setup: OpenTelemetry

The Vercel AI SDK emits ai.* 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:
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 AI

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

Verify

Run one generateText call, then open Events in Agnost AI. 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

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.