Skip to content

feat(core): Report user-set integrations and their options in SDK config - #26708

Open
logaretm wants to merge 4 commits into
developfrom
awad/sdk-config-integration-options
Open

logaretm wants to merge 4 commits into
developfrom
awad/sdk-config-integration-options

Conversation

@logaretm

@logaretm logaretm commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Previously we dropped the default resolved options to trim down the payload, this PR continues that by dropping the default integrations and only reports what the user has set explicitly, including the explicitly set options.

Notable changes to the payload:

  • Move integrations into options, since now it represents what the user has passed explicitly.
  • Added a new top-level removed_default_integration metadata field, that is only present if the user uses a callback filter for integrations.
  • Ensured all integrations go through defineIntegration to capture their options and that all SDKs capture at the top-level rather than leaking defaults to upstream SDKs like Vue -> Browser.
 {
   "version": 3,
   "sdk": { "name": "sentry.javascript.node", "version": "11.16.0" },
   "environment": "production",
-  "integrations": [
-    { "name": "EventFilters" },
-    { "name": "FunctionToString" },
-    { "name": "LinkedErrors" },
-    { "name": "CaptureConsole" },
-  ],
+  "removed_default_integrations": ["Dedupe"],
   "options": {
     "environment": "production",
+    "integrations": [
+      { "name": "CaptureConsole", "options": { "levels": ["error"] } },
+    ],
     "tracesSampleRate": 0.2
   }
 }

This Builds on the #26677 PR stack, the changes seem like a lot but most are a couple of line changes.

Restores what #26616 dropped after its type build failed: `defineIntegration`
keeps a copy of the options the user passed, the integrations that bypassed it
use it again (with typed exports so declarations build), and every framework
and downstream SDK captures the user's options before adding its defaults.

The SDK config reports the user's integrations under `options.integrations`.
An `integrations` function is reported as a change to the defaults: what it
added, plus the sorted names of the defaults it dropped at the top level as
`removed_default_integrations`.
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: 8d73041 (PR test merge using develop at d8564c0)

Against: d8564c0 (develop) · base run #67328

✅ Baseline matches: this diff contains only this PR's changes.

Path Size % Change Change
@sentry/browser 30.39 kB +0.52% +157 B 🔺
@sentry/browser - with treeshaking flags 28.59 kB +0.6% +168 B 🔺
@sentry/browser - with treeshaking flags tracing without tracing 28.5 kB +0.59% +166 B 🔺
@sentry/browser (incl. Tracing) 52.96 kB +0.29% +153 B 🔺
@sentry/browser (incl. Tracing Core) 40.48 kB +0.37% +147 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 52.96 kB +0.29% +149 B 🔺
@sentry/browser (incl. Tracing, Profiling) 55.83 kB +0.25% +136 B 🔺
@sentry/browser (incl. Tracing, Replay) 92.86 kB -0.03% -26 B 🔽
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 81.71 kB +0.02% +13 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 97.25 kB +0.04% +35 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 110.73 kB -0.07% -69 B 🔽
@sentry/browser (incl. Feedback) 48.32 kB +0.31% +148 B 🔺
@sentry/browser (incl. sendFeedback) 30.96 kB +0.49% +149 B 🔺
@sentry/browser (incl. FeedbackAsync) 36.02 kB +0.51% +181 B 🔺
@sentry/browser (incl. Metrics) 31.72 kB +0.54% +169 B 🔺
@sentry/browser (incl. Logs) 31.99 kB +0.51% +160 B 🔺
@sentry/browser (incl. Metrics & Logs) 32.65 kB +0.52% +166 B 🔺
@sentry/react 32.42 kB +0.58% +185 B 🔺
@sentry/react (incl. Tracing) 55.62 kB +0.3% +166 B 🔺
@sentry/vue 38.64 kB +0.5% +189 B 🔺
@sentry/vue (incl. Tracing) 55.96 kB +0.38% +208 B 🔺
@sentry/svelte 30.43 kB +0.63% +189 B 🔺
@sentry/remix (Remix 3 client bundle) 58.64 kB +0.31% +177 B 🔺
CDN Bundle 32.41 kB +0.76% +244 B 🔺
CDN Bundle (incl. Tracing) 53.4 kB +0.4% +211 B 🔺
CDN Bundle (incl. Logs, Metrics) 35.14 kB +0.57% +197 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 55.89 kB +0.25% +135 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 76.03 kB +0.02% +8 B 🔺
CDN Bundle (incl. Tracing, Replay) 91.15 kB +0.06% +47 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 93.71 kB -0.01% -3 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) 96.6 kB +0.1% +89 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 99.03 kB -0.05% -40 B 🔽
CDN Bundle - uncompressed 94.53 kB +0.67% +625 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 157.91 kB +0.42% +653 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 102.87 kB +0.62% +629 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 165.54 kB +0.4% +653 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 233.12 kB +0.28% +639 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 278.19 kB +0.24% +663 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 285.82 kB +0.24% +663 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 290.13 kB +0.24% +667 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 297.75 kB +0.23% +667 B 🔺
@sentry/nextjs (client) 59.31 kB +0.27% +156 B 🔺
@sentry/sveltekit (client) 54.27 kB +0.4% +212 B 🔺
@sentry/core/server 45.31 kB +0.07% +31 B 🔺
@sentry/core/browser 14.46 kB +0.34% +48 B 🔺
@sentry/node 154.24 kB +0.15% +231 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 83.32 kB -0.02% -15 B 🔽
@sentry/node - without tracing 88.93 kB +0.14% +124 B 🔺
@sentry/node - without channel injection 143.22 kB +0.17% +239 B 🔺
@sentry/aws-serverless 99.52 kB +0.11% +108 B 🔺
@sentry/cloudflare (withSentry) - minified 209.32 kB +0.4% +817 B 🔺
@sentry/cloudflare (withSentry) 485.65 kB +0.37% +1.78 kB 🔺
@sentry/cloudflare (withSentry, instrumented CommonJS package) - minified 1.02 MB +0.16% +1.55 kB 🔺
@sentry/nextjs/cloudflare (withSentry) - minified 234.56 kB +0.36% +821 B 🔺

View base workflow run

@github-actions

Copy link
Copy Markdown
Contributor

One or more gzipped bundles increased by more than 500 bytes. If this increase is intentional, add the Accept Bundlesize Increase label to this PR to rerun and accept the check.

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Optional E2E tests

Some optional checks were not successful. They do not block the merge. 6 not successful, 54 successful. See the run.

Check Status
❌ CI: Optional E2E Tests / E2E cloudflare-workers-send-to-sentry Test (optional) Failing after 2m Details
❌ CI: Optional E2E Tests / E2E node-openai-decisions (latest) Test (optional) Failing after 36s Details
❌ CI: Optional E2E Tests / E2E node-openai-decisions Test (optional) Failing after 33s Details
❌ CI: Optional E2E Tests / E2E node-pi-durable (latest) Test (optional) Failing after 33s Details
❌ CI: Optional E2E Tests / E2E cloudflare-pi-durable (latest) Test (optional) Failing after 46s Details
❌ CI: Optional E2E Tests / E2E nextjs-16-tunnel (cloudflare) Test (optional) Failing after 1m Details
Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E cloudflare-think Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-tunnel (cloudflare) Test (optional) Successful in 31s Details
✅ CI: Optional E2E Tests / E2E deno (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (cloudflare) Test (optional) Successful in 43s Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries Test (optional) Successful in 49s Details
✅ CI: Optional E2E Tests / E2E cloudflare-think (ai v6) Test (optional) Successful in 58s Details
✅ CI: Optional E2E Tests / E2E nestjs-12 (cloudflare) Test (optional) Successful in 40s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (cloudflare, latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E cloudflare-agent Test (optional) Successful in 38s Details
✅ CI: Optional E2E Tests / E2E nextjs-14-supabase Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E cloudflare-flue-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (latest) Test (optional) Successful in 55s Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-workers-without-tracing-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E astro-7 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-flue Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (latest) Test (optional) Successful in 4m Details
✅ CI: Optional E2E Tests / E2E cloudflare-pi-durable Test (optional) Successful in 49s Details
✅ CI: Optional E2E Tests / E2E debug-id-sourcemaps Test (optional) Successful in 37s Details
✅ CI: Optional E2E Tests / E2E nestjs-12 (deno) Test (optional) Successful in 57s Details
✅ CI: Optional E2E Tests / E2E node-eve Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (turbo) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nestjs-12 (bun) Test (optional) Successful in 59s Details
✅ CI: Optional E2E Tests / E2E cloudflare-mastra Test (optional) Successful in 50s Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry (static trace lifecycle) Test (optional) Successful in 55s Details
✅ CI: Optional E2E Tests / E2E astro-7 (static trace lifecycle) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-fastify-6 Test (optional) Successful in 32s Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v2 Test (optional) Successful in 25s Details
✅ CI: Optional E2E Tests / E2E node-mastra Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v1 Test (optional) Successful in 27s Details
✅ CI: Optional E2E Tests / E2E node-eve (content off) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-eve (0.x) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E react-router-7-framework-instrumentation Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (development) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-cloudflare Test (optional) Successful in 37s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext, bun) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-mastra (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-eve (orchestrion) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (static / nuxt generate) Test (optional) Successful in 34s Details
✅ CI: Optional E2E Tests / E2E node-flue (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E vue-3 (no Options API) Test (optional) Successful in 48s Details
✅ CI: Optional E2E Tests / E2E solidstart-2 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-tunnel Test (optional) Successful in 43s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-cloudflare Test (optional) Successful in 34s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps kept) Test (optional) Successful in 40s Details
✅ CI: Optional E2E Tests / E2E react-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E solidstart-2-tunnel Test (optional) Successful in 48s Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps Test (optional) Successful in 31s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps Test (optional) Successful in 38s Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (kv-cache) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-pi-durable Test (optional) Successful in 37s Details

Wrapping the integration function to capture its options made every
`defineIntegration()` call look side-effecting, so bundlers kept unused
integrations. Mark it as free of side effects.
…tegration-options

# Conflicts:
#	packages/core/src/integrations/reportSdkConfig.ts
#	packages/core/test/lib/integrations/reportSdkConfig.test.ts
@logaretm
logaretm marked this pull request as ready for review November 20, 2026 16:17
@logaretm
logaretm requested a review from nicohrubec November 20, 2026 16:18

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1b0bb70. Configure here.

}

return resolved;
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Callback wrapper assumes array return

Medium Severity

The new integrations function wrapper calls .map on the callback result immediately, but getIntegrationsToSetup still accepts a single integration and wraps it in an array. Returning one integration, null, or undefined from the callback now throws during init instead of being coerced. That can take down the host app for a previously tolerated pattern.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1b0bb70. Configure here.

return initServer({
runtime: { name: 'bun', version: process.versions.bun as string },
...options,
...userOptions,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Next.js runtimes leak SDK integrations

Medium Severity

On Next.js Bun and Deno, an integrations callback is invoked with extra SDK-injected instances (fetchIntegration, bunHttpServerIntegration) that never get isDefaultInstance. The capture wrapper then treats those as user-set, so the config payload reports them (including { spans: false }) as if the app added them. An integrations array does not have this leak.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1b0bb70. Configure here.

const integration = fn(...args) as ReturnType<Fn>;
integration._options = options;

return integration;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Runtime objects serialized as options

Medium Severity

Wrapping tracing integrations with defineIntegration stores the entire first argument as _options. For Vue, Ember, and React Router v4/v5 that includes live router, appInstance, or history objects. isPlainObject treats class instances as walkable, so the config report can recurse the live object graph and send route query data (PII) or a huge payload. TanStack Router already omits the router for this reason.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1b0bb70. Configure here.

This branch has not been deployed

No deployments
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