Skip to content

fix(node): Ensure late init works with all integrations #16016

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

Merged
merged 1 commit into from
Apr 9, 2025

Conversation

mydea
Copy link
Member

@mydea mydea commented Apr 9, 2025

In cases where we tweak the options we pass to the instrumentation, our code did not handle this very well. This could lead to certain options missing when init is called again later, as we updated the config with incomplete/wrong options.

To fix this properly, I added a new variant to generateInstrumentOnce which accepts a class and an options transformer, which ensures that the options are always correctly transformed, no matter if called the first or second time.

(The code to make this overloaded generateInstrumentOnce function work with TS was pretty tricky, but I think it is good now - type inferral etc. works nicely now!)

Fixes #16004

In cases where we tweak the options we pass to the instrumentation, our code did not handle this very well. This could lead to certain options missing when init is called again later, as we updated the config with incomplete/wrong options.

To fix this properly, I added a new variant to `generateInstrumentOnce` which accepts a class and an options transformer, which ensures that the options are always correctly transformed, no matter if called the first or second time.
@mydea mydea requested review from lforst and AbhiPrasad April 9, 2025 10:02
@mydea mydea self-assigned this Apr 9, 2025
Copy link
Contributor

github-actions bot commented Apr 9, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.28 KB +0.01% +1 B 🔺
@sentry/browser - with treeshaking flags 23.12 KB - -
@sentry/browser (incl. Tracing) 36.95 KB +0.01% +1 B 🔺
@sentry/browser (incl. Tracing, Replay) 74.14 KB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 67.51 KB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 78.8 KB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 90.61 KB - -
@sentry/browser (incl. Feedback) 39.68 KB +0.01% +1 B 🔺
@sentry/browser (incl. sendFeedback) 27.9 KB +0.01% +1 B 🔺
@sentry/browser (incl. FeedbackAsync) 32.67 KB - -
@sentry/react 25.09 KB +0.01% +1 B 🔺
@sentry/react (incl. Tracing) 38.87 KB - -
@sentry/vue 27.51 KB - -
@sentry/vue (incl. Tracing) 38.67 KB - -
@sentry/svelte 23.32 KB +0.01% +1 B 🔺
CDN Bundle 24.51 KB - -
CDN Bundle (incl. Tracing) 36.95 KB - -
CDN Bundle (incl. Tracing, Replay) 71.99 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 77.16 KB +0.01% +1 B 🔺
CDN Bundle - uncompressed 71.47 KB - -
CDN Bundle (incl. Tracing) - uncompressed 109.23 KB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 220.52 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 233.05 KB - -
@sentry/nextjs (client) 40.49 KB - -
@sentry/sveltekit (client) 37.39 KB - -
@sentry/node 143.09 KB +0.05% +59 B 🔺
@sentry/node - without tracing 96.29 KB +0.06% +53 B 🔺
@sentry/aws-serverless 120.64 KB +0.05% +50 B 🔺

View base workflow run

@mydea mydea merged commit 56aac53 into develop Apr 9, 2025
108 checks passed
@mydea mydea deleted the fn/fix-graphql-preloading branch April 9, 2025 11:02
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.

graphqlIntegration: updating Sentry config removes responseHook from otel config
2 participants