Skip to content

feat(core): Add dataCollection.defaults option - #25742

Open
sentry-junior[bot] wants to merge 2 commits into
developfrom
feat/data-collection-defaults-off
Open

sentry-junior[bot] wants to merge 2 commits into
developfrom
feat/data-collection-defaults-off

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

It adds roughly 100bytes. I (Jan) would assume this is a lot in the browser, but it gives a real benefit for users who want to make sure they're not sending more data in the future as currently configured.


Users who want restrictive data collection in v11 currently have to list every dataCollection key manually, and any key added in a later minor release silently starts collecting after an upgrade. dataCollection: { defaults: 'off' } makes every key that isn't set collect nothing, including future ones, so users only turn on what they need.

We went with a flag that the SDK resolves instead of the exported object from the issue. Spreading an object would set mcp explicitly and break its fallback to genAI. With the flag, resolveDataCollectionOptions stays the single place where defaults are applied, and MCP content still follows genAI when mcp isn't set.

'off' is a true "nothing" baseline, which also turns off stackFrameVariables and frameContextLines. The migration guide's "keep v10 behavior" snippet now uses defaults: 'off' with the v10 values layered on top.

Fixes #25659

via Jan Peer Stöcklmair.

--

View Junior Session [Sentry]

sentry-junior Bot and others added 2 commits October 25, 2026 22:20
Setting `defaults: 'off'` turns off every `dataCollection` field the user
does not set, including fields added in later minor releases. MCP content
still falls back to `genAI` when `mcp` is not set.

Refs #25659

Co-Authored-By: Jan VamPeer Stöcklmair <jan.peer@sentry.io>
Co-Authored-By: Jan VamPeer Stöcklmair <jan.peer@sentry.io>
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: 30e45d5 (PR test merge using develop at a734d03)

Against: a734d03 (develop) · base run #63553

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

Path Size % Change Change
@sentry/browser 30.08 kB +0.32% +95 B 🔺
@sentry/browser - with treeshaking flags 28.22 kB +0.33% +91 B 🔺
@sentry/browser - with treeshaking flags tracing without tracing 28.12 kB +0.32% +88 B 🔺
@sentry/browser (incl. Tracing) 52.26 kB +0.17% +84 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 52.27 kB +0.19% +95 B 🔺
@sentry/browser (incl. Tracing, Profiling) 55.2 kB +0.14% +77 B 🔺
@sentry/browser (incl. Tracing, Replay) 92.03 kB +0.07% +58 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 80.95 kB +0.12% +93 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 96.76 kB +0.07% +62 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 109.72 kB +0.08% +82 B 🔺
@sentry/browser (incl. Feedback) 47.59 kB +0.18% +85 B 🔺
@sentry/browser (incl. sendFeedback) 35.14 kB +0.26% +90 B 🔺
@sentry/browser (incl. FeedbackAsync) 40.25 kB +0.24% +96 B 🔺
@sentry/browser (incl. Metrics) 31.09 kB +0.26% +80 B 🔺
@sentry/browser (incl. Logs) 31.37 kB +0.27% +83 B 🔺
@sentry/browser (incl. Metrics & Logs) 32.04 kB +0.3% +93 B 🔺
@sentry/react 31.9 kB +0.27% +84 B 🔺
@sentry/react (incl. Tracing) 54.58 kB +0.16% +86 B 🔺
@sentry/vue 38.22 kB +0.2% +75 B 🔺
@sentry/vue (incl. Tracing) 55.17 kB +0.13% +67 B 🔺
@sentry/svelte 30.1 kB +0.32% +94 B 🔺
@sentry/remix (Remix 3 client bundle) 57.26 kB +0.12% +67 B 🔺
CDN Bundle 31.83 kB +0.23% +70 B 🔺
CDN Bundle (incl. Tracing) 52.78 kB +0.14% +73 B 🔺
CDN Bundle (incl. Logs, Metrics) 34.05 kB +0.28% +94 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 54.73 kB +0.14% +75 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 75.01 kB +0.11% +80 B 🔺
CDN Bundle (incl. Tracing, Replay) 90.49 kB +0.1% +83 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 92.41 kB +0.09% +77 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 96.61 kB +0.07% +66 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 98.58 kB +0.09% +82 B 🔺
CDN Bundle - uncompressed 93.81 kB +0.33% +302 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 156.66 kB +0.2% +302 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 100.36 kB +0.31% +302 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 162.63 kB +0.19% +302 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 230.58 kB +0.14% +302 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 277.01 kB +0.11% +302 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 282.96 kB +0.11% +302 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 290.71 kB +0.11% +302 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 296.66 kB +0.11% +302 B 🔺
@sentry/nextjs (client) 57.47 kB +0.16% +89 B 🔺
@sentry/sveltekit (client) 52.62 kB +0.13% +68 B 🔺
@sentry/core/server 43.71 kB +0.21% +89 B 🔺
@sentry/core/browser 13.81 kB - -
@sentry/node 153.84 kB +0.05% +67 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.58 kB - -
@sentry/node - without tracing 95.41 kB +0.1% +94 B 🔺
@sentry/node - without channel injection 134.51 kB +0.07% +85 B 🔺
@sentry/aws-serverless 103.54 kB +0.06% +55 B 🔺
@sentry/cloudflare (withSentry) - minified 195.8 kB +0.15% +283 B 🔺
@sentry/cloudflare (withSentry) 486.75 kB +0.08% +380 B 🔺
@sentry/nextjs/cloudflare (withSentry) - minified 216.46 kB +0.13% +276 B 🔺

View base workflow run

@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Optional E2E tests

Some optional checks were not successful. They do not block the merge. 2 not successful, 63 successful. See the run.

Check Status
❌ CI: Optional E2E Tests / E2E react-router-7-framework-instrumentation Test (optional) Failing after 1m Details
❌ CI: Optional E2E Tests / E2E node-anthropic-send-to-sentry (latest) Test (optional) Failing after 11s Details
Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E astro-7 Test (optional) Successful in 53s Details
✅ CI: Optional E2E Tests / E2E astro-7-static Test (optional) Successful in 51s Details
✅ CI: Optional E2E Tests / E2E cloudflare-think Test (optional) Successful in 33s Details
✅ CI: Optional E2E Tests / E2E cloudflare-flue-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-pi-durable (latest) Test (optional) Successful in 21s Details
✅ CI: Optional E2E Tests / E2E cloudflare-pi-durable Test (optional) Successful in 25s Details
✅ CI: Optional E2E Tests / E2E cloudflare-workers-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E cloudflare-think (ai v6) Test (optional) Successful in 35s Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries Test (optional) Successful in 28s Details
✅ CI: Optional E2E Tests / E2E cloudflare-mastra Test (optional) Successful in 25s Details
✅ CI: Optional E2E Tests / E2E cloudflare-agent Test (optional) Successful in 24s Details
✅ CI: Optional E2E Tests / E2E debug-id-sourcemaps Test (optional) Successful in 26s Details
✅ CI: Optional E2E Tests / E2E nextjs-14 (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E deno (latest) Test (optional) Successful in 45s Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (cloudflare) Test (optional) Successful in 26s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (canary, turbopack) Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (deno) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-14 (canary) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (canary, webpack) Test (optional) Successful in 4m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (turbo) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext, bun) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (cloudflare, latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16-standalone (canary, turbopack) Test (optional) Successful in 19s Details
✅ CI: Optional E2E Tests / E2E nextjs-orpc Test (optional) Successful in 57s Details
✅ CI: Optional E2E Tests / E2E node-anthropic-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v1 Test (optional) Successful in 16s Details
✅ CI: Optional E2E Tests / E2E nextjs-16-tunnel (cloudflare) Test (optional) Successful in 42s Details
✅ CI: Optional E2E Tests / E2E node-eve (latest) Test (optional) Successful in 51s Details
✅ CI: Optional E2E Tests / E2E node-eve (orchestrion) Test (optional) Successful in 37s Details
✅ CI: Optional E2E Tests / E2E node-eve Test (optional) Successful in 35s Details
✅ CI: Optional E2E Tests / E2E node-mastra (latest) Test (optional) Successful in 42s Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v2 Test (optional) Successful in 16s Details
✅ CI: Optional E2E Tests / E2E node-fastify-6 (tracer provider) Test (optional) Successful in 20s Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry Test (optional) Successful in 51s Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry-static Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-fastify-6 Test (optional) Successful in 21s Details
✅ CI: Optional E2E Tests / E2E node-flue (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-openai-decisions-send-to-sentry Test (optional) Successful in 54s Details
✅ CI: Optional E2E Tests / E2E node-pi-durable Test (optional) Successful in 21s Details
✅ CI: Optional E2E Tests / E2E node-flue Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-mastra Test (optional) Successful in 42s Details
✅ CI: Optional E2E Tests / E2E node-openai-send-to-sentry (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-openai-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-4 (canary) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-openai-decisions-send-to-sentry (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps kept) Test (optional) Successful in 20s Details
✅ CI: Optional E2E Tests / E2E nuxt-3 (canary) Test (optional) Successful in 58s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (static / nuxt generate) Test (optional) Successful in 28s Details
✅ CI: Optional E2E Tests / E2E node-pi-durable (latest) Test (optional) Successful in 22s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps Test (optional) Successful in 21s Details
✅ CI: Optional E2E Tests / E2E nuxt-4-static (canary) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E solidstart-2 Test (optional) Successful in 35s Details
✅ CI: Optional E2E Tests / E2E nuxt-5 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-cloudflare Test (optional) Successful in 17s Details
✅ CI: Optional E2E Tests / E2E react-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E supabase-nextjs Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps Test (optional) Successful in 19s Details
✅ CI: Optional E2E Tests / E2E vue-3 (no Options API) Test (optional) Successful in 52s Details
✅ CI: Optional E2E Tests / E2E vue-3 (canary) Test (optional) Successful in 53s Details
✅ CI: Optional E2E Tests / E2E angular (canary) Test (optional) Successful in 49s Details
✅ CI: Optional E2E Tests / E2E angular (canary) Test (optional) Successful in 54s Details

@JPeer264 JPeer264 self-assigned this Oct 25, 2026
@JPeer264
JPeer264 marked this pull request as ready for review October 25, 2026 23:27

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.

Provide a restrictive dataCollection baseline that also covers keys added in minor releases

1 participant