Skip to content

Commit 70a81be

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 bee8d52 commit 70a81be

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
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: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
import { getCurrentHub } from '@sentry/core';
22
import type { BrowserClientReplayOptions, Integration } from '@sentry/types';
33

4-
import {
5-
DEFAULT_ERROR_SAMPLE_RATE,
6-
DEFAULT_FLUSH_MAX_DELAY,
7-
DEFAULT_FLUSH_MIN_DELAY,
8-
DEFAULT_SESSION_SAMPLE_RATE,
9-
MASK_ALL_TEXT_SELECTOR,
10-
} from './constants';
4+
import { DEFAULT_FLUSH_MAX_DELAY, DEFAULT_FLUSH_MIN_DELAY, MASK_ALL_TEXT_SELECTOR } from './constants';
115
import { ReplayContainer } from './replay';
126
import type { RecordingOptions, ReplayConfiguration, ReplayPluginOptions } from './types';
137
import { isBrowser } from './util/isBrowser';
@@ -71,8 +65,8 @@ export class Replay implements Integration {
7165
flushMinDelay,
7266
flushMaxDelay,
7367
stickySession,
74-
sessionSampleRate: DEFAULT_SESSION_SAMPLE_RATE,
75-
errorSampleRate: DEFAULT_ERROR_SAMPLE_RATE,
68+
sessionSampleRate: 0,
69+
errorSampleRate: 0,
7670
useCompression,
7771
maskAllText: typeof maskAllText === 'boolean' ? maskAllText : !maskTextSelector,
7872
blockAllMedia,

0 commit comments

Comments
 (0)