Skip to content

Conversation

chargome
Copy link
Member

Adds an option to getSessionId and getSessionId to only return a value if the replay is sampled.

ref #17676

@chargome chargome self-assigned this Sep 24, 2025
Copy link
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 24.26 kB - -
@sentry/browser - with treeshaking flags 22.77 kB - -
@sentry/browser (incl. Tracing) 40.4 kB - -
@sentry/browser (incl. Tracing, Replay) 78.78 kB +0.01% +7 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 68.45 kB +0.01% +4 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 83.45 kB +0.02% +11 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 95.66 kB +0.01% +3 B 🔺
@sentry/browser (incl. Feedback) 40.97 kB - -
@sentry/browser (incl. sendFeedback) 28.91 kB - -
@sentry/browser (incl. FeedbackAsync) 33.84 kB - -
@sentry/react 25.98 kB - -
@sentry/react (incl. Tracing) 42.38 kB - -
@sentry/vue 28.78 kB - -
@sentry/vue (incl. Tracing) 42.21 kB - -
@sentry/svelte 24.29 kB - -
CDN Bundle 25.77 kB - -
CDN Bundle (incl. Tracing) 40.3 kB - -
CDN Bundle (incl. Tracing, Replay) 76.53 kB +0.02% +10 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 82.03 kB +0.02% +11 B 🔺
CDN Bundle - uncompressed 75.37 kB - -
CDN Bundle (incl. Tracing) - uncompressed 119.29 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 234.45 kB +0.02% +37 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 247.21 kB +0.02% +37 B 🔺
@sentry/nextjs (client) 44.4 kB - -
@sentry/sveltekit (client) 40.82 kB - -
@sentry/node-core 50.02 kB - -
@sentry/node 152.83 kB - -
@sentry/node - without tracing 91.94 kB - -
@sentry/aws-serverless 105.39 kB - -

View base workflow run

Copy link
Contributor

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 8,662 - 9,293 -7%
GET With Sentry 1,377 16% 1,378 -0%
GET With Sentry (error only) 6,023 70% 6,195 -3%
POST Baseline 1,203 - 1,200 +0%
POST With Sentry 510 42% 514 -1%
POST With Sentry (error only) 1,047 87% 1,066 -2%
MYSQL Baseline 3,320 - 3,388 -2%
MYSQL With Sentry 435 13% 448 -3%
MYSQL With Sentry (error only) 2,681 81% 2,737 -2%

View base workflow run

@chargome chargome changed the title feat(replay): Only attach sampled replay Ids to logs feat(replay/logs): Only attach sampled replay Ids to logs Sep 24, 2025
@mydea
Copy link
Member

mydea commented Sep 24, 2025

Adds an option to getSessionId and getSessionId to only return a value if the replay is sampled.

ref #17676

If replay is not sampled, should there not be no session ID at all, as we should not record...?

@chargome
Copy link
Member Author

I think the Id is always created, regardless of the sampling decision

@chargome chargome marked this pull request as ready for review September 25, 2025 13:19
@chargome chargome requested a review from a team as a code owner September 25, 2025 13:19
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.

4 participants