Skip to content

fix(core): Instrument invoke_agent root span, and support Vercel ai v5 #17395

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

RulaKhaled
Copy link
Member

@RulaKhaled RulaKhaled commented Aug 12, 2025

Main changes are:

  1. Instrument root invoke_agent span: This addresses that transaction event.spans only includes child spans, ensuring proper correlation beyond just children.
  2. Refactor vercelai integration layout in core: Restructured the vercelai folder to mirror our other AI agent integrations (split constants/utils/index) for clarity and easier maintenance.
  3. Link errors in Vercel AI v5 (metadata-based): Added support to capture and link tool errors that are returned as result metadata (not thrown). We correlate tool-call IDs to spans and set the trace/span context when capturing the error, so errors are attached to the right tool-call/trace even without a thrown exception.
  4. Added tests to test vercel ai v5

@RulaKhaled RulaKhaled changed the title fix(core): fix(core): Instrument invoke_agent root span, and support V5 [WIP] fix(core): Instrument invoke_agent root span, and support V5 Aug 12, 2025
Copy link
Contributor

github-actions bot commented Aug 12, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 24.16 kB - -
@sentry/browser - with treeshaking flags 22.73 kB - -
@sentry/browser (incl. Tracing) 39.87 kB - -
@sentry/browser (incl. Tracing, Replay) 77.99 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 67.83 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 82.69 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 94.79 kB - -
@sentry/browser (incl. Feedback) 40.83 kB - -
@sentry/browser (incl. sendFeedback) 28.81 kB - -
@sentry/browser (incl. FeedbackAsync) 33.7 kB - -
@sentry/react 25.88 kB - -
@sentry/react (incl. Tracing) 41.86 kB - -
@sentry/vue 28.64 kB - -
@sentry/vue (incl. Tracing) 41.69 kB - -
@sentry/svelte 24.18 kB - -
CDN Bundle 25.66 kB - -
CDN Bundle (incl. Tracing) 39.76 kB - -
CDN Bundle (incl. Tracing, Replay) 75.82 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 81.27 kB - -
CDN Bundle - uncompressed 74.96 kB - -
CDN Bundle (incl. Tracing) - uncompressed 117.59 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 231.88 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 244.48 kB - -
@sentry/nextjs (client) 43.89 kB - -
@sentry/sveltekit (client) 40.32 kB - -
@sentry/node-core 47.99 kB - -
@sentry/node 147.17 kB +0.11% +152 B 🔺
@sentry/node - without tracing 92.24 kB - -
@sentry/aws-serverless 103.67 kB +0.01% +1 B 🔺

View base workflow run

@RulaKhaled RulaKhaled changed the title [WIP] fix(core): Instrument invoke_agent root span, and support V5 [WIP] fix(core): Instrument invoke_agent root span, and support Vercel ai v5 Aug 13, 2025
@RulaKhaled RulaKhaled marked this pull request as ready for review August 13, 2025 11:45
@RulaKhaled RulaKhaled requested review from mydea and AbhiPrasad August 13, 2025 13:04
@RulaKhaled RulaKhaled changed the title [WIP] fix(core): Instrument invoke_agent root span, and support Vercel ai v5 fix(core): Instrument invoke_agent root span, and support Vercel ai v5 Aug 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant