From dd839c8e41f8cc9facb16c277dc99b0c0d9a1574 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Thu, 16 May 2024 10:22:55 +0200 Subject: [PATCH 1/2] doc(migration): Add entry for `interactionsSampleRate` --- MIGRATION.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/MIGRATION.md b/MIGRATION.md index edb03fa7f1c2..833f3c8a6f65 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -647,6 +647,38 @@ The `BrowserTracing` integration, together with the custom routing instrumentati Instead, you should use `Sentry.browserTracingIntegration()`. See examples [below](./MIGRATION.md#deprecated-browsertracing-integration) +#### Removal of `interactionsSampleRate` in `browserTracingIntegration` options + +The `interactionsSampleRate` option that could be passed to `browserTracingIntegration` or `new BrowserTracing()` was +removed in v8, due to the option being redundant and in favour of bundle size minimization. + +It's important to note that this sample rate only ever was applied when collecting INP (Interaction To Next Paint) +values. You most likely don't need to replace this option. Furthermore, INP values are already sampled by the +`tracesSampleRate` SDK option, like any regular span. At the time of writing, INP value collection does not deplete your +span or transaction quota. + +If you used `interactionsSampleRate` before, and still want to reduce INP value collection, we recommend using the +`tracesSampler` SDK option instead: + +```javascript +// v7 +Sentry.init({ + integrations: [new BrowserTracing({ interactionsSampleRate: 0.1 })], +}); +``` + +```javascript +// v8 - please read the text above, you most likely don't need this :) +Sentry.init({ + tracesSampler: (ctx) => { + if (ctx.attributes?['sentry.op']?.startsWith('ui.interaction')) { + return 0.1; + } + return 0.5; + } +}) +``` + #### Removal of the `Offline` integration The `Offline` integration has been removed in favor of the From 30197a956e563dd22d1e48cc3fc1c86a90d47d27 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Thu, 16 May 2024 10:31:35 +0200 Subject: [PATCH 2/2] add tracesSampler link --- MIGRATION.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MIGRATION.md b/MIGRATION.md index 833f3c8a6f65..14e5bdd79a93 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -654,8 +654,8 @@ removed in v8, due to the option being redundant and in favour of bundle size mi It's important to note that this sample rate only ever was applied when collecting INP (Interaction To Next Paint) values. You most likely don't need to replace this option. Furthermore, INP values are already sampled by the -`tracesSampleRate` SDK option, like any regular span. At the time of writing, INP value collection does not deplete your -span or transaction quota. +[`tracesSampleRate` SDK option](https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sampler), like +any regular span. At the time of writing, INP value collection does not deplete your span or transaction quota. If you used `interactionsSampleRate` before, and still want to reduce INP value collection, we recommend using the `tracesSampler` SDK option instead: