Skip to content

Commit 32f014f

Browse files
committed
feat(replay): Remove default sample rates for replay
Previously, they were: * `replaysSessionSampleRate: 0.1` * `replaysOnErrorSampleRate: 1.0` Now, you have to explicitly set the sample rates, otherwise they default to 0.
1 parent ae56638 commit 32f014f

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

packages/replay/MIGRATION.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# Upgrading Replay from 7.31.0 to 7.32.0
2+
3+
In 7.32.0, we have removed the default values for the replay sample rates.
4+
Previously, they were:
5+
6+
* `replaysSessionSampleRate: 0.1`
7+
* `replaysOnErrorSampleRate: 1.0`
8+
9+
Now, you have to explicitly set the sample rates, otherwise they default to 0.
10+
111
# Upgrading Replay from 0.6.x to 7.24.0
212

313
The Sentry Replay integration was moved to the Sentry JavaScript SDK monorepo. Hence we're jumping from version 0.x to the monorepo's 7.x version which is shared across all JS SDK packages.

packages/replay/src/constants.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@ export const VISIBILITY_CHANGE_TIMEOUT = SESSION_IDLE_DURATION;
2020
// The maximum length of a session
2121
export const MAX_SESSION_LIFE = 3_600_000; // 60 minutes
2222

23-
/**
24-
* Defaults for sampling rates
25-
*/
26-
export const DEFAULT_SESSION_SAMPLE_RATE = 0.1;
27-
export const DEFAULT_ERROR_SAMPLE_RATE = 1.0;
28-
2923
/** The select to use for the `maskAllText` option */
3024
export const MASK_ALL_TEXT_SELECTOR = 'body *:not(style), body *:not(script)';
3125

packages/replay/src/integration.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@ import { getCurrentHub } from '@sentry/core';
22
import type { BrowserClientReplayOptions, Integration } from '@sentry/types';
33

44
import {
5-
DEFAULT_ERROR_SAMPLE_RATE,
65
DEFAULT_FLUSH_MAX_DELAY,
76
DEFAULT_FLUSH_MIN_DELAY,
8-
DEFAULT_SESSION_SAMPLE_RATE,
97
INITIAL_FLUSH_DELAY,
108
MASK_ALL_TEXT_SELECTOR,
119
} from './constants';
@@ -74,8 +72,8 @@ export class Replay implements Integration {
7472
flushMaxDelay,
7573
stickySession,
7674
initialFlushDelay,
77-
sessionSampleRate: DEFAULT_SESSION_SAMPLE_RATE,
78-
errorSampleRate: DEFAULT_ERROR_SAMPLE_RATE,
75+
sessionSampleRate: 0,
76+
errorSampleRate: 0,
7977
useCompression,
8078
maskAllText: typeof maskAllText === 'boolean' ? maskAllText : !maskTextSelector,
8179
blockAllMedia,

0 commit comments

Comments
 (0)