Skip to content

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

Open
nicohrubec wants to merge 3 commits intodevelopfrom
nh/span-streaming-ingest-settings
Open

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

Conversation

@nicohrubec
Copy link
Copy Markdown
Member

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, but maybe we should confirm this).

Logs and metrics will follow in separate PRs.

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 25.88 kB - -
@sentry/browser - with treeshaking flags 24.35 kB - -
@sentry/browser (incl. Tracing) 43.81 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 45.56 kB +0.12% +53 B 🔺
@sentry/browser (incl. Tracing, Profiling) 48.73 kB - -
@sentry/browser (incl. Tracing, Replay) 82.98 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 72.5 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 87.67 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 99.93 kB - -
@sentry/browser (incl. Feedback) 42.7 kB - -
@sentry/browser (incl. sendFeedback) 30.55 kB - -
@sentry/browser (incl. FeedbackAsync) 35.55 kB - -
@sentry/browser (incl. Metrics) 27.16 kB - -
@sentry/browser (incl. Logs) 27.29 kB - -
@sentry/browser (incl. Metrics & Logs) 27.98 kB - -
@sentry/react 27.62 kB - -
@sentry/react (incl. Tracing) 46.05 kB - -
@sentry/vue 30.71 kB - -
@sentry/vue (incl. Tracing) 45.62 kB - -
@sentry/svelte 25.89 kB - -
CDN Bundle 28.55 kB - -
CDN Bundle (incl. Tracing) 44.94 kB - -
CDN Bundle (incl. Logs, Metrics) 29.93 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 46.03 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 68.89 kB -0.01% -1 B 🔽
CDN Bundle (incl. Tracing, Replay) 81.96 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 83.02 kB -0.01% -1 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) 87.47 kB +0.01% +2 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 88.55 kB +0.01% +1 B 🔺
CDN Bundle - uncompressed 83.4 kB - -
CDN Bundle (incl. Tracing) - uncompressed 134.3 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 87.55 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 137.72 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 211.12 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 251.75 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 255.14 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 264.66 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 268.05 kB - -
@sentry/nextjs (client) 48.58 kB - -
@sentry/sveltekit (client) 44.22 kB - -
@sentry/node-core 58.16 kB +0.26% +147 B 🔺
@sentry/node 175.02 kB +0.09% +140 B 🔺
@sentry/node - without tracing 98.13 kB +0.17% +165 B 🔺
@sentry/aws-serverless 115.36 kB +0.15% +164 B 🔺

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
...(!!tunnel && dsn && { dsn: dsnToString(dsn) }),
};

const isBrowserSdk = options._metadata?.sdk?.name === 'sentry.javascript.browser';
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.

As discussed offline, we'll likely need better detection here for covering all browser based SDKs

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