Skip to content

feat(core)!: Align request data collection with v11 defaults - #22853

Open
s1gr1d wants to merge 3 commits into
developfrom
sig/requestData-collection
Open

feat(core)!: Align request data collection with v11 defaults#22853
s1gr1d wants to merge 3 commits into
developfrom
sig/requestData-collection

Conversation

@s1gr1d

@s1gr1d s1gr1d commented Jul 30, 2026

Copy link
Copy Markdown
Member

Cookies, request and response headers, and query parameters are now collected by default with sensitive values filtered, instead of being gated on sendDefaultPii.

The RequestData integration remains a second configuration layer: explicit include values control whether a category is attached, while dataCollection continues to define its allowlist or denylist. When include explicitly enables a category disabled globally, the default sensitive-value denylist applies. This also allows options such as include.ip: true to override dataCollection.userInfo: false for that integration.

Also added tests for the different cases.

Review Tip: Use "Hide Whitespace" as there were some indentation changes.

Closes #21260

@s1gr1d
s1gr1d requested a review from a team as a code owner July 30, 2026 09:50
@s1gr1d
s1gr1d requested review from chargome, logaretm and msonnb and removed request for a team July 30, 2026 09:50
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 29.82 kB - -
@sentry/browser - with treeshaking flags 28.02 kB - -
@sentry/browser (incl. Tracing) 47.08 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 47.09 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.82 kB - -
@sentry/browser (incl. Tracing, Replay) 86.39 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.83 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 91.11 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 103.76 kB - -
@sentry/browser (incl. Feedback) 47.13 kB - -
@sentry/browser (incl. sendFeedback) 34.66 kB - -
@sentry/browser (incl. FeedbackAsync) 39.76 kB - -
@sentry/browser (incl. Metrics) 30.89 kB - -
@sentry/browser (incl. Logs) 31.12 kB - -
@sentry/browser (incl. Metrics & Logs) 31.8 kB - -
@sentry/react 31.6 kB - -
@sentry/react (incl. Tracing) 49.33 kB - -
@sentry/vue 34.74 kB - -
@sentry/vue (incl. Tracing) 49.05 kB - -
@sentry/svelte 29.85 kB - -
CDN Bundle 31.87 kB - -
CDN Bundle (incl. Tracing) 47.45 kB - -
CDN Bundle (incl. Logs, Metrics) 33.42 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 48.82 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 72.78 kB - -
CDN Bundle (incl. Tracing, Replay) 85.08 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.38 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 90.85 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.16 kB - -
CDN Bundle - uncompressed 95.04 kB - -
CDN Bundle (incl. Tracing) - uncompressed 142.27 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 99.75 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 146.25 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 224.51 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 261.52 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 265.49 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 275.23 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 279.18 kB - -
@sentry/nextjs (client) 51.92 kB - -
@sentry/sveltekit (client) 47.51 kB - -
@sentry/core/server 79.75 kB +0.21% +167 B 🔺
@sentry/core/browser 51.74 kB +0.32% +160 B 🔺
@sentry/node 121.47 kB +0.17% +197 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 166 B - -
@sentry/node - without tracing 84.95 kB +0.22% +180 B 🔺
@sentry/aws-serverless 93.23 kB +0.24% +215 B 🔺
@sentry/cloudflare (withSentry) - minified 198.44 kB +0.43% +847 B 🔺
@sentry/cloudflare (withSentry) 487.93 kB +0.45% +2.15 kB 🔺

View base workflow run

return undefined;
}

const filtered = filterQueryParams(normalized, behavior);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we add an integration tests that covers this path? I think we are decoding the values in filterQueryParams (which I think is a pre-existing bug in the helper but unused in the sdk until now)

e.g.

query_string: 'q=hello%20world&token=secret'
// should result in event.request.query_string => q=hello%20world&token=[Filtered]'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

added an integration test and fixed this 👍

@s1gr1d
s1gr1d requested a review from a team as a code owner July 30, 2026 15:01
@s1gr1d
s1gr1d requested review from chargome, isaacs and mydea and removed request for a team July 30, 2026 15:01

@chargome chargome left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for updating!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

l: We can probably get rid of this test scenario or merge it with the default fetch case here now.

return isIncluded && behavior === false ? true : behavior;
}

function filterQueryString(queryString: QueryParams, behavior: CollectBehavior): string | undefined {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this still needs an early return on behavior === false

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.

[v11] Migrate cookie / requestData gating to dataCollection

2 participants