Skip to content

feat(metrics): Migrate metrics to use dataCollection instead of sendDefaultPii - #21078

Merged
chargome merged 2 commits into
developfrom
cg/datacollection-metrics
May 28, 2026
Merged

feat(metrics): Migrate metrics to use dataCollection instead of sendDefaultPii#21078
chargome merged 2 commits into
developfrom
cg/datacollection-metrics

Conversation

@chargome

@chargomechargome commented May 20, 2026

Copy link
Copy Markdown
Member

Migrates metrics code from reading sendDefaultPii off client options to using the new client.getDataCollectionOptions().userInfo API. This is a 1:1 behavioral mapping — userInfo controls the same auto-population of user identity fields (IP, User-Agent) that sendDefaultPii did.

closes#21051

@chargomechargome self-assigned this May 20, 2026
@chargome

Copy link
Copy Markdown
MemberAuthor

@cursor review

@cursorcursorBot 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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit b76c0da. Configure here.

@github-actions

github-actionsBot commented May 20, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize% ChangeChange
@sentry/browser27.27 kB-0.02%-4 B 🔽
@sentry/browser - with treeshaking flags25.68 kB-0.02%-3 B 🔽
@sentry/browser (incl. Tracing)45.28 kB+0.02%+7 B 🔺
@sentry/browser (incl. Tracing + Span Streaming)47.5 kB-0.02%-7 B 🔽
@sentry/browser (incl. Tracing, Profiling)50.26 kB+0.01%+3 B 🔺
@sentry/browser (incl. Tracing, Replay)84.88 kB+0.01%+6 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags74.39 kB+0.02%+11 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas)89.59 kB+0.01%+4 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback)102.21 kB+0.01%+7 B 🔺
@sentry/browser (incl. Feedback)44.46 kB-0.01%-3 B 🔽
@sentry/browser (incl. sendFeedback)32.08 kB-0.02%-4 B 🔽
@sentry/browser (incl. FeedbackAsync)37.2 kB-0.02%-4 B 🔽
@sentry/browser (incl. Metrics)28.36 kB-0.03%-6 B 🔽
@sentry/browser (incl. Logs)28.59 kB-0.02%-4 B 🔽
@sentry/browser (incl. Metrics & Logs)29.28 kB-0.02%-4 B 🔽
@sentry/react29.01 kB-0.02%-4 B 🔽
@sentry/react (incl. Tracing)47.51 kB+0.02%+6 B 🔺
@sentry/vue32.19 kB-0.02%-5 B 🔽
@sentry/vue (incl. Tracing)47.13 kB+0.01%+3 B 🔺
@sentry/svelte27.3 kB-0.02%-3 B 🔽
CDN Bundle29.67 kB-0.02%-5 B 🔽
CDN Bundle (incl. Tracing)47.8 kB+0.01%+4 B 🔺
CDN Bundle (incl. Logs, Metrics)31.16 kB-0.02%-5 B 🔽
CDN Bundle (incl. Tracing, Logs, Metrics)49.05 kB+0.01%+3 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics)70.48 kB-0.01%-5 B 🔽
CDN Bundle (incl. Tracing, Replay)85.3 kB+0.01%+5 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics)86.46 kB+0.01%+4 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback)91.17 kB+0.01%+1 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics)92.34 kB+0.01%+2 B 🔺
CDN Bundle - uncompressed87.71 kB+0.03%+21 B 🔺
CDN Bundle (incl. Tracing) - uncompressed144.23 kB+0.04%+46 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed92.2 kB+0.03%+21 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed147.99 kB+0.04%+46 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed216.93 kB+0.01%+21 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed263.01 kB+0.02%+46 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed266.75 kB+0.02%+46 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed276.71 kB+0.02%+46 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed280.44 kB+0.02%+46 B 🔺
@sentry/nextjs (client)50 kB+0.02%+5 B 🔺
@sentry/sveltekit (client)45.75 kB+0.02%+5 B 🔺
@sentry/core/server76.44 kB-0.01%-1 B 🔽
@sentry/core/browser63.19 kB-0.01%-2 B 🔽
@sentry/node-core62.54 kB-0.01%-3 B 🔽
@sentry/node131.06 kB-0.01%-5 B 🔽
@sentry/node - without tracing74.97 kB-0.01%-4 B 🔽
@sentry/aws-serverless87.19 kB-0.01%-5 B 🔽
@sentry/cloudflare (withSentry) - minified173.42 kB+0.02%+21 B 🔺
@sentry/cloudflare (withSentry)433.35 kB+0.01%+14 B 🔺

View base workflow run

@chargome
chargome marked this pull request as ready for review May 20, 2026 16:24
@chargome
chargome requested a review from a team as a code ownerMay 20, 2026 16:24
Sign up for freeto 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.

Migrate metrics to dataCollection

2 participants

@chargome@logaretm