Skip to content

feat(browser): Add ingest_settings to span v2 envelope payload#20411

Merged
nicohrubec merged 8 commits intodevelopfrom
nh/span-streaming-ingest-settings
Apr 28, 2026
Merged

feat(browser): Add ingest_settings to span v2 envelope payload#20411
nicohrubec merged 8 commits intodevelopfrom
nh/span-streaming-ingest-settings

Conversation

@nicohrubec
Copy link
Copy Markdown
Member

@nicohrubec nicohrubec commented Apr 21, 2026

Adds version: 2 and ingest_settings to the span streaming 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 works today).

Manually tested E2E with a local react app and looks fine.

Closes #20275

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

size-limit report 📦

Path Size % Change Change
@sentry/browser 26.16 kB - -
@sentry/browser - with treeshaking flags 24.63 kB - -
@sentry/browser (incl. Tracing) 44.11 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 46.16 kB +0.11% +49 B 🔺
@sentry/browser (incl. Tracing, Profiling) 49.06 kB - -
@sentry/browser (incl. Tracing, Replay) 83.36 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 72.84 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 88.03 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 100.69 kB - -
@sentry/browser (incl. Feedback) 43.4 kB - -
@sentry/browser (incl. sendFeedback) 30.96 kB - -
@sentry/browser (incl. FeedbackAsync) 36.14 kB - -
@sentry/browser (incl. Metrics) 27.44 kB - -
@sentry/browser (incl. Logs) 27.59 kB - -
@sentry/browser (incl. Metrics & Logs) 28.28 kB - -
@sentry/react 27.9 kB - -
@sentry/react (incl. Tracing) 46.35 kB - -
@sentry/vue 31.03 kB - -
@sentry/vue (incl. Tracing) 45.95 kB - -
@sentry/svelte 26.18 kB - -
CDN Bundle 28.84 kB - -
CDN Bundle (incl. Tracing) 46.71 kB +0.13% +60 B 🔺
CDN Bundle (incl. Logs, Metrics) 30.25 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 47.8 kB +0.14% +65 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 69.25 kB - -
CDN Bundle (incl. Tracing, Replay) 83.79 kB +0.06% +42 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 84.86 kB +0.05% +40 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 89.61 kB +0.05% +37 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 90.7 kB +0.06% +49 B 🔺
CDN Bundle - uncompressed 84.55 kB - -
CDN Bundle (incl. Tracing) - uncompressed 139.68 kB +0.1% +127 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 88.75 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 143.14 kB +0.09% +127 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 212.39 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 257.17 kB +0.04% +98 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 260.61 kB +0.04% +98 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 270.86 kB +0.04% +98 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 274.3 kB +0.04% +98 B 🔺
@sentry/nextjs (client) 48.84 kB - -
@sentry/sveltekit (client) 44.56 kB - -
@sentry/node-core 59 kB +0.28% +162 B 🔺
@sentry/node 170.11 kB +0.09% +145 B 🔺
@sentry/node - without tracing 97.81 kB +0.18% +170 B 🔺
@sentry/aws-serverless 114.53 kB +0.16% +173 B 🔺
@sentry/cloudflare (withSentry) - minified 164.13 kB +0.3% +485 B 🔺
@sentry/cloudflare (withSentry) 415.2 kB +0.25% +1.03 kB 🔺

View base workflow run

@nicohrubec nicohrubec marked this pull request as ready for review April 21, 2026 07:11
@nicohrubec nicohrubec requested a review from chargome April 21, 2026 07:12
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 a98a9ce. Configure here.

Comment thread packages/core/src/tracing/spans/envelope.ts Outdated
Comment thread packages/core/test/lib/tracing/spans/envelope.test.ts
Comment thread packages/core/src/tracing/spans/envelope.ts Outdated
@nicohrubec
Copy link
Copy Markdown
Member Author

@chargome updated the detection to use isBrowser from core. what do you think about the PII gating?

@nicohrubec nicohrubec requested a review from chargome April 21, 2026 09:16
@chargome chargome marked this pull request as draft April 21, 2026 12:51
@chargome
Copy link
Copy Markdown
Member

We'll wait on getsentry/relay#5869 to be implemented before sending this.

@nicohrubec nicohrubec assigned nicohrubec and unassigned nicohrubec Apr 22, 2026
@nicohrubec
Copy link
Copy Markdown
Member Author

@chargome I'll do a full e2e test on Monday with a sample app, but should be good for another review now that this is implemented for spans in relay.

@nicohrubec nicohrubec marked this pull request as ready for review April 24, 2026 11:54
@nicohrubec nicohrubec merged commit dd4766c into develop Apr 28, 2026
494 of 502 checks passed
@nicohrubec nicohrubec deleted the nh/span-streaming-ingest-settings branch April 28, 2026 13:40
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.

Add ingest_settings property on span envelope container to infer IP addresses

2 participants