Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(browser): Add interactionsSampleRate to browserTracingIntegration options #12023

Merged
merged 2 commits into from
May 14, 2024

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented May 14, 2024

This PR forward-ports the interactionsSampleRate option for browserTracingIntegration introduced in 7.110.0 to v8. Looks like we missed this when forward-porting the INP implementation as reported in #12006, probably because these two things happened in parallel.

Generally, this PR orients itself on #11382 but I made a couple of changes (that are not API-breaking):

  • In v7 we used to sample the span completely manually. In v8 we no longer do this after migrating to using startInactiveSpan with standalone: true. This function internally samples the span based on tracesSampleRate and the usual sampling controlling SDK options. In an effort to keep things simple, I opted to simply sample twice - once on interactionsSampleRate and afterwards on tracesSampleRate. Unless my basic math skills left me, this should lead to the same outcome as sampling once on interactionsSampleRate * tracesSampleRate.
  • In case users set invalid sample rates, we'll fall back to the default value which for v8 is 100%/1. In v7, we discarded all INP spans in case of an invalid rate but given we switched defaults for recording and sending INP spans I think we're fine with defaulting to 100%.

Gonna tag @edwardgou-sentry please also take a look 🙏

closes #12006

Copy link
Contributor

size-limit report 📦

Path Size
@sentry/browser 21.65 KB (0%)
@sentry/browser (incl. Tracing) 32.77 KB (+0.25% 🔺)
@sentry/browser (incl. Tracing, Replay) 68.12 KB (+0.13% 🔺)
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 61.47 KB (+0.07% 🔺)
@sentry/browser (incl. Tracing, Replay with Canvas) 72.17 KB (+0.14% 🔺)
@sentry/browser (incl. Tracing, Replay, Feedback) 84.17 KB (+0.11% 🔺)
@sentry/browser (incl. Feedback) 37.57 KB (0%)
@sentry/browser (incl. sendFeedback) 26.21 KB (0%)
@sentry/browser (incl. FeedbackAsync) 30.57 KB (0%)
@sentry/react 24.33 KB (0%)
@sentry/react (incl. Tracing) 35.73 KB (+0.25% 🔺)
@sentry/vue 25.48 KB (0%)
@sentry/vue (incl. Tracing) 34.56 KB (+0.25% 🔺)
@sentry/svelte 21.77 KB (0%)
CDN Bundle 24.13 KB (0%)
CDN Bundle (incl. Tracing) 34.09 KB (+0.11% 🔺)
CDN Bundle (incl. Tracing, Replay) 67.79 KB (+0.09% 🔺)
CDN Bundle (incl. Tracing, Replay, Feedback) 72.76 KB (+0.08% 🔺)
CDN Bundle - uncompressed 70.98 KB (0%)
CDN Bundle (incl. Tracing) - uncompressed 101.14 KB (+0.12% 🔺)
CDN Bundle (incl. Tracing, Replay) - uncompressed 210.76 KB (+0.06% 🔺)
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 223.06 KB (+0.06% 🔺)
@sentry/nextjs (client) 34.96 KB (+0.25% 🔺)
@sentry/sveltekit (client) 33.34 KB (+0.26% 🔺)
@sentry/node 147.42 KB (0%)

@Lms24 Lms24 requested review from edwardgou-sentry, a team, stephanie-anderson, lforst and s1gr1d and removed request for a team and stephanie-anderson May 14, 2024 11:55
@Lms24 Lms24 mentioned this pull request May 14, 2024
3 tasks
Copy link
Member

@s1gr1d s1gr1d left a comment

Choose a reason for hiding this comment

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

Thanks for adding this!

Copy link

@edwardgou-sentry edwardgou-sentry left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@Lms24 Lms24 merged commit c2ae9bd into develop May 14, 2024
93 checks passed
@Lms24 Lms24 deleted the lms/feat-add-interactionSampleRate branch May 14, 2024 13:54
Lms24 added a commit that referenced this pull request May 15, 2024
Lms24 added a commit that referenced this pull request May 16, 2024
…ngIntegration` options (#12023)" (#12048)

The reason for the revert is that we're concerned about 1. the usefulness and 2. the
name of this option and would like to revisit this without blocking the
8.1.0 release. This is not semver-breaking because in 8.0.0, this API
did not exist.
andreiborza pushed a commit that referenced this pull request May 16, 2024
…tion` options (#12023)

This patch forward-ports the `interactionsSampleRate` option for
`browserTracingIntegration` introduced in 7.110.0 to v8. Looks like we
missed this when forward-porting the INP implementation as reported in
#12006, probably because these two things happened in parallel.
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.

interactionsSampleRate removed in v8
4 participants