Skip to content

fix(browser): Add ingest_settings to v2 log envelope payload - #20453

Merged
nicohrubec merged 11 commits into
developfrom
nh/span-streaming-ingest-settings-logs
May 4, 2026
Merged

fix(browser): Add ingest_settings to v2 log envelope payload#20453
nicohrubec merged 11 commits into
developfrom
nh/span-streaming-ingest-settings-logs

Conversation

@nicohrubec

@nicohrubecnicohrubec commented Apr 22, 2026

Copy link
Copy Markdown
Member

Adds version: 2 and ingest_settings to the log envelope payload so Relay can infer the end-user IP address and User-Agent from the incoming request (link to spec). This is only emitted by the browser SDK.

Both settings are currently gated behind sendDefaultPii (modeled after how event.sdk.settings.infer_ip).

This slightly changes behavior in this case because we were always inferring some user data on logs before (e.g. browser.name/version). This data will not be there anymore after this change, unless sendDefaultPii is enabled.

Closes#20277

@nicohrubecnicohrubec changed the title feat(browser): Add ingest_settings to log envelope payloadfeat(browser): Add ingest_settings to v2 log envelope payloadApr 22, 2026
@github-actions

github-actionsBot commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize% ChangeChange
@sentry/browser26.31 kB+0.59%+152 B 🔺
@sentry/browser - with treeshaking flags24.8 kB+0.66%+161 B 🔺
@sentry/browser (incl. Tracing)44.19 kB+0.15%+62 B 🔺
@sentry/browser (incl. Tracing + Span Streaming)46.41 kB+0.16%+73 B 🔺
@sentry/browser (incl. Tracing, Profiling)49.16 kB+0.16%+76 B 🔺
@sentry/browser (incl. Tracing, Replay)83.57 kB+0.12%+97 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags73.04 kB+0.12%+83 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas)88.25 kB+0.12%+102 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback)100.86 kB+0.07%+61 B 🔺
@sentry/browser (incl. Feedback)43.46 kB+0.15%+62 B 🔺
@sentry/browser (incl. sendFeedback)31.12 kB+0.5%+153 B 🔺
@sentry/browser (incl. FeedbackAsync)36.2 kB+0.17%+60 B 🔺
@sentry/browser (incl. Metrics)27.62 kB+0.64%+175 B 🔺
@sentry/browser (incl. Logs)27.74 kB+0.53%+144 B 🔺
@sentry/browser (incl. Metrics & Logs)28.44 kB+0.57%+160 B 🔺
@sentry/react28.05 kB+0.54%+148 B 🔺
@sentry/react (incl. Tracing)46.42 kB+0.13%+58 B 🔺
@sentry/vue31.18 kB+0.5%+154 B 🔺
@sentry/vue (incl. Tracing)46.03 kB+0.16%+71 B 🔺
@sentry/svelte26.33 kB+0.58%+151 B 🔺
CDN Bundle28.91 kB+0.22%+61 B 🔺
CDN Bundle (incl. Tracing)46.95 kB+0.09%+42 B 🔺
CDN Bundle (incl. Logs, Metrics)30.34 kB+0.22%+66 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics)48.06 kB+0.07%+29 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics)69.4 kB+0.08%+55 B 🔺
CDN Bundle (incl. Tracing, Replay)84.1 kB+0.05%+34 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics)85.16 kB+0.02%+13 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback)89.9 kB+0.05%+42 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics)91.01 kB+0.06%+47 B 🔺
CDN Bundle - uncompressed84.71 kB+0.19%+154 B 🔺
CDN Bundle (incl. Tracing) - uncompressed140.29 kB+0.1%+132 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed88.9 kB+0.18%+154 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed143.75 kB+0.1%+132 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed212.85 kB+0.07%+132 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed258.1 kB+0.06%+132 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed261.54 kB+0.06%+132 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed271.79 kB+0.05%+132 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed275.23 kB+0.05%+132 B 🔺
@sentry/nextjs (client)48.92 kB+0.14%+65 B 🔺
@sentry/sveltekit (client)44.67 kB+0.2%+89 B 🔺
@sentry/node-core59.13 kB+0.14%+77 B 🔺
@sentry/node170.42 kB+0.05%+81 B 🔺
@sentry/node - without tracing97 kB+0.09%+86 B 🔺
@sentry/aws-serverless113.85 kB+0.09%+102 B 🔺
@sentry/cloudflare (withSentry) - minified165.08 kB+0.07%+115 B 🔺
@sentry/cloudflare (withSentry)417.39 kB+0.08%+293 B 🔺

View base workflow run

@nicohrubec
nicohrubec marked this pull request as ready for review April 30, 2026 12:40
@nicohrubec
nicohrubec requested review from a team as code ownersApril 30, 2026 12:40
*
* @param items - The logs to include in the envelope.
* @param inferUserData - If true, tells Relay to infer the end-user IP and User-Agent from the incoming request.
* Only emitted as `ingest_settings` in browser environments.

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.

nit: extra leading spaces, intended?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

yes

@nicohrubecnicohrubec changed the title feat(browser): Add ingest_settings to v2 log envelope payloadfix(browser): Add ingest_settings to v2 log envelope payloadMay 4, 2026
nicohrubecand others added 4 commits May 4, 2026 10:23
@nicohrubec
nicohrubec merged commit 267c9ed into developMay 4, 2026
257 checks passed
@nicohrubec
nicohrubec deleted the nh/span-streaming-ingest-settings-logs branch May 4, 2026 08:49
olveryu added a commit to olveryu/WerewolfGameJudge that referenced this pull request May 6, 2026
Replace hand-rolled UA regex with ua-parser-js (v2), which correctly
identifies all browsers including WKWebView, MicroMessenger, Android
WebView, etc. Temporary workaround for getsentry/sentry-javascript#20453.
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.

Add ingest_settings property on log envelope container to infer IP addresses

3 participants

@nicohrubec@logaretm@chargome