Skip to content

Conversation

@mydea
Copy link
Member

@mydea mydea commented Sep 18, 2025

This avoids looking up the integration for anthropic-ai instrumentation, instead relying on this being passed in (which it already is). When manually instrumenting the client you need to pass in the options directly.

  1. Node: Options are passed from the integration to instrumentAnthropicAiClient anyhow, so nothing changes
  2. cloudflare/vercel-edge: There is no integration, users need to manually call instrumentAnthropicAiClient() and pass in the options anyhow (no integration to look anything up from exists there)

This required updating the tests to actually use auto instrumentation properly instead of manual client wrapping, which is overall a good change anyhow IMHO.

@mydea mydea requested a review from RulaKhaled September 18, 2025 09:47
@mydea mydea self-assigned this Sep 18, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 18, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 24.22 kB - -
@sentry/browser - with treeshaking flags 22.74 kB - -
@sentry/browser (incl. Tracing) 40.23 kB - -
@sentry/browser (incl. Tracing, Replay) 78.6 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 68.27 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 83.26 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 95.49 kB - -
@sentry/browser (incl. Feedback) 40.94 kB - -
@sentry/browser (incl. sendFeedback) 28.88 kB - -
@sentry/browser (incl. FeedbackAsync) 33.78 kB - -
@sentry/react 25.93 kB - -
@sentry/react (incl. Tracing) 42.23 kB - -
@sentry/vue 28.71 kB - -
@sentry/vue (incl. Tracing) 42.04 kB - -
@sentry/svelte 24.24 kB - -
CDN Bundle 25.75 kB - -
CDN Bundle (incl. Tracing) 40.05 kB - -
CDN Bundle (incl. Tracing, Replay) 76.28 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 81.78 kB - -
CDN Bundle - uncompressed 75.23 kB - -
CDN Bundle (incl. Tracing) - uncompressed 118.58 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 233.71 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 246.47 kB - -
@sentry/nextjs (client) 44.23 kB - -
@sentry/sveltekit (client) 40.66 kB - -
@sentry/node-core 49.96 kB -0.01% -1 B 🔽
@sentry/node 151.18 kB -0.05% -73 B 🔽
@sentry/node - without tracing 91.86 kB -0.01% -1 B 🔽
@sentry/aws-serverless 105.31 kB - -

View base workflow run

@github-actions
Copy link
Contributor

github-actions bot commented Sep 18, 2025

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 9,114 - 9,262 -2%
GET With Sentry 1,432 16% 1,394 +3%
GET With Sentry (error only) 6,102 67% 5,999 +2%
POST Baseline 1,213 - 1,179 +3%
POST With Sentry 561 46% 560 +0%
POST With Sentry (error only) 1,077 89% 1,061 +2%
MYSQL Baseline 3,358 - 3,310 +1%
MYSQL With Sentry 504 15% 421 +20%
MYSQL With Sentry (error only) 2,749 82% 2,677 +3%

View base workflow run

@mydea mydea marked this pull request as ready for review September 18, 2025 11:59
Copy link
Member

@RulaKhaled RulaKhaled left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mydea mydea merged commit 062d684 into develop Sep 19, 2025
367 of 369 checks passed
@mydea mydea deleted the fn/ai-options branch September 19, 2025 10:09
RulaKhaled added a commit that referenced this pull request Dec 3, 2025
This avoids looking up the integration for openai instrumentation,
instead relying on this being passed in (which it already is). When
manually instrumenting the client you need to pass in the options
directly.

1. Node: Options are passed from the integration to
instrumentOpenAiClient anyhow, so nothing changes
2. cloudflare/vercel-edge: There is no integration, users need to
manually call instrumentOpenAiClient() and pass in the options anyhow
(no integration to look anything up from exists there)

See also #17694

Closes #18375

---------

Co-authored-by: RulaKhaled <[email protected]>
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.

3 participants