Skip to content

feat(core): Apply request data to segment spans in span streaming#20654

Open
chargome wants to merge 2 commits intodevelopfrom
cg-req-data-integration-span-streaming
Open

feat(core): Apply request data to segment spans in span streaming#20654
chargome wants to merge 2 commits intodevelopfrom
cg-req-data-integration-span-streaming

Conversation

@chargome
Copy link
Copy Markdown
Member

@chargome chargome commented May 4, 2026

Implements the span-streaming counterpart of the requestDataIntegration.processEvent hook.

Request data from the scope's sdkProcessingMetadata is mapped to span attributes following sentry-conventions, reusing httpHeadersToSpanAttributes for sensitivity filtering and gating IP extraction behind sendDefaultPii.

Note: The logic is also guarded by client.getIntegrationByName('RequestData') so users who opt out of the integration don't get request data on streamed spans either.

This approach was chosen over adding a processSegmentSpan hook to the integration because captureSpan is tree-shakeable for non-streaming users, keeping the request data code out of bundles that don't need it (see linked ticket).

Closes #20380

@chargome chargome self-assigned this May 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

size-limit report 📦

Path Size % Change Change
@sentry/browser 26.31 kB - -
@sentry/browser - with treeshaking flags 24.8 kB - -
@sentry/browser (incl. Tracing) 44.2 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 47.69 kB +2.73% +1.26 kB 🔺
@sentry/browser (incl. Tracing, Profiling) 49.16 kB - -
@sentry/browser (incl. Tracing, Replay) 83.58 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 73.04 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 88.26 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 100.87 kB - -
@sentry/browser (incl. Feedback) 43.47 kB - -
@sentry/browser (incl. sendFeedback) 31.12 kB - -
@sentry/browser (incl. FeedbackAsync) 36.21 kB - -
@sentry/browser (incl. Metrics) 27.62 kB - -
@sentry/browser (incl. Logs) 27.75 kB - -
@sentry/browser (incl. Metrics & Logs) 28.45 kB - -
@sentry/react 28.05 kB - -
@sentry/react (incl. Tracing) 46.42 kB - -
@sentry/vue 31.18 kB - -
@sentry/vue (incl. Tracing) 46.04 kB - -
@sentry/svelte 26.34 kB - -
CDN Bundle 28.91 kB - -
CDN Bundle (incl. Tracing) 48.22 kB +2.71% +1.27 kB 🔺
CDN Bundle (incl. Logs, Metrics) 30.34 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 49.32 kB +2.61% +1.25 kB 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 69.41 kB - -
CDN Bundle (incl. Tracing, Replay) 85.34 kB +1.47% +1.23 kB 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.38 kB +1.44% +1.22 kB 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 91.14 kB +1.38% +1.24 kB 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.23 kB +1.34% +1.22 kB 🔺
CDN Bundle - uncompressed 84.72 kB - -
CDN Bundle (incl. Tracing) - uncompressed 144.41 kB +2.93% +4.1 kB 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 88.92 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 147.87 kB +2.86% +4.1 kB 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 212.86 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 262.21 kB +1.59% +4.1 kB 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 265.65 kB +1.57% +4.1 kB 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 275.92 kB +1.52% +4.11 kB 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 279.35 kB +1.5% +4.11 kB 🔺
@sentry/nextjs (client) 48.92 kB - -
@sentry/sveltekit (client) 44.67 kB - -
@sentry/node-core 59.37 kB +0.42% +248 B 🔺
@sentry/node 170.79 kB +0.14% +234 B 🔺
@sentry/node - without tracing 98.02 kB +0.89% +863 B 🔺
@sentry/aws-serverless 114.25 kB +0.26% +286 B 🔺
@sentry/cloudflare (withSentry) - minified 166.19 kB +0.6% +990 B 🔺
@sentry/cloudflare (withSentry) 420.39 kB +0.65% +2.68 kB 🔺

View base workflow run

@chargome chargome requested a review from nicohrubec May 4, 2026 15:00
@chargome chargome marked this pull request as ready for review May 4, 2026 15:00
@chargome chargome requested a review from a team as a code owner May 4, 2026 15:00
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.

Event processor migration: RequestData integration

1 participant