Skip to content

init: agent tracing setup does not track conversations or users #1658

Description

@sergical

Summary

When agent tracing is selected for an app that uses the Vercel AI SDK, sentry init adds Sentry.vercelAIIntegration() but does not set a conversation ID or the user. AI spans arrive, but every chat turn is its own row in Agent Tracing → Conversations, with no user attached.

The platform docs cover this under Tracking Conversations: call Sentry.setConversationId() with a stable ID and Sentry.setUser() on each request that makes AI calls.

Observed (getsentry/sentry-devex#91, @sentry/nextjs 11.x, ai 7)

  • vercelAIIntegration() added to the server config. On JavaScript SDK 11 this integration is already enabled automatically on Node when tracing is on, so the line is redundant.
  • No setConversationId / setUser in either chat route.

Suggested

When agent tracing is selected and the app has request handlers that call an AI library:

  • set the conversation ID and user in those handlers (the app's own chat/thread ID and the authenticated user), or at minimum point to the Tracking Conversations section in the success output;
  • skip vercelAIIntegration() on SDK ≥ 11 server runtimes, where it is a default.

For comparison, the sentry-for-ai sentry-instrument skill now wires both calls when AI monitoring is requested (getsentry/sentry-for-ai#361).

Created with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions