Skip to content

feat(browser): Migrate sendDefaultPii to dataCollection in browser packages#21097

Open
chargome wants to merge 3 commits into
developfrom
cg/data-collection-browser
Open

feat(browser): Migrate sendDefaultPii to dataCollection in browser packages#21097
chargome wants to merge 3 commits into
developfrom
cg/data-collection-browser

Conversation

@chargome
Copy link
Copy Markdown
Member

  • browser/src/client.ts: Migrate to dataCollection for infer_ip relay setting and addAutoIpAddressToSession listener
  • browser/src/integrations/httpclient.ts: Split single sendDefaultPii gate into granular cookies, httpHeaders.request, httpHeaders.response checks with new collect behavior filtering. Includes a backwards-compat guard so legacy sendDefaultPii users see no behavioral change (deferred to v11).
  • browser-utils/src/metrics/utils.ts: Migrate to dataCollection for client.address span attribute

Note on backwards compatibility:

When dataCollection is not explicitly set by the user, the httpclient integration falls back to the old sendDefaultPii boolean gate (all-or-nothing). This avoids silently sending more data for existing users. When dataCollection is explicitly set, the granular filtering is applied. (#21094)

closes #20929

@chargome chargome self-assigned this May 21, 2026
@chargome
Copy link
Copy Markdown
Member Author

bugbot run

Copy link
Copy Markdown

@cursor cursor Bot left a comment

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 2 potential issues.

Fix All in Cursor

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

Reviewed by Cursor Bugbot for commit eb71e9e. Configure here.

Comment thread packages/browser/src/integrations/httpclient.ts
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 27.33 kB +0.03% +8 B 🔺
@sentry/browser - with treeshaking flags 25.74 kB +0.03% +7 B 🔺
@sentry/browser (incl. Tracing) 45.34 kB +0.05% +22 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 47.56 kB +0.02% +6 B 🔺
@sentry/browser (incl. Tracing, Profiling) 50.31 kB +0.03% +15 B 🔺
@sentry/browser (incl. Tracing, Replay) 84.94 kB +0.03% +21 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 74.44 kB +0.02% +14 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 89.65 kB +0.02% +17 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 102.26 kB +0.02% +15 B 🔺
@sentry/browser (incl. Feedback) 44.52 kB +0.03% +9 B 🔺
@sentry/browser (incl. sendFeedback) 32.14 kB +0.03% +9 B 🔺
@sentry/browser (incl. FeedbackAsync) 37.26 kB +0.03% +10 B 🔺
@sentry/browser (incl. Metrics) 28.41 kB +0.03% +6 B 🔺
@sentry/browser (incl. Logs) 28.64 kB +0.02% +4 B 🔺
@sentry/browser (incl. Metrics & Logs) 29.34 kB +0.03% +6 B 🔺
@sentry/react 29.06 kB +0.03% +8 B 🔺
@sentry/react (incl. Tracing) 47.57 kB +0.04% +19 B 🔺
@sentry/vue 32.25 kB +0.02% +5 B 🔺
@sentry/vue (incl. Tracing) 47.19 kB +0.04% +16 B 🔺
@sentry/svelte 27.36 kB +0.04% +9 B 🔺
CDN Bundle 29.73 kB +0.03% +7 B 🔺
CDN Bundle (incl. Tracing) 47.85 kB +0.04% +15 B 🔺
CDN Bundle (incl. Logs, Metrics) 31.22 kB +0.03% +9 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 49.11 kB +0.04% +16 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 70.54 kB +0.01% +7 B 🔺
CDN Bundle (incl. Tracing, Replay) 85.35 kB +0.02% +16 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.51 kB +0.02% +15 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 91.21 kB +0.01% +2 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.38 kB +0.01% +5 B 🔺
CDN Bundle - uncompressed 87.82 kB +0.03% +18 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 144.34 kB +0.03% +43 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 92.31 kB +0.02% +18 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 148.09 kB +0.03% +43 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 217.04 kB +0.01% +18 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 263.11 kB +0.02% +43 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 266.86 kB +0.02% +43 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 276.81 kB +0.02% +43 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 280.55 kB +0.02% +43 B 🔺
@sentry/nextjs (client) 50.06 kB +0.07% +32 B 🔺
@sentry/sveltekit (client) 45.82 kB +0.04% +17 B 🔺
@sentry/core/server 76.41 kB - -
@sentry/core/browser 63.16 kB - -
@sentry/node-core 62.59 kB - -
@sentry/node 164.35 kB -0.01% -1 B 🔽
@sentry/node - without tracing 75.02 kB +0.01% +1 B 🔺
@sentry/aws-serverless 87.24 kB +0.01% +1 B 🔺
@sentry/cloudflare (withSentry) - minified 173 kB - -
@sentry/cloudflare (withSentry) 432.17 kB - -

View base workflow run

@chargome chargome marked this pull request as ready for review May 21, 2026 13:19
@chargome chargome requested a review from a team as a code owner May 21, 2026 13:20
@chargome chargome requested review from logaretm and mydea and removed request for a team May 21, 2026 13:20
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.

(browser): Migrate browser + browser-utils to dataCollection

1 participant