Skip to content

feat(replay): Remove default sample rates for replay #6878

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

Merged
merged 1 commit into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/replay/MIGRATION.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Upgrading Replay from 7.31.0 to 7.32.0

In 7.32.0, we have removed the default values for the replay sample rates.
Previously, they were:

* `replaysSessionSampleRate: 0.1`
* `replaysOnErrorSampleRate: 1.0`

Now, you have to explicitly set the sample rates, otherwise they default to 0.

# Upgrading Replay from 0.6.x to 7.24.0

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.
Expand Down
6 changes: 0 additions & 6 deletions packages/replay/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ export const VISIBILITY_CHANGE_TIMEOUT = SESSION_IDLE_DURATION;
// The maximum length of a session
export const MAX_SESSION_LIFE = 3_600_000; // 60 minutes

/**
* Defaults for sampling rates
*/
export const DEFAULT_SESSION_SAMPLE_RATE = 0.1;
export const DEFAULT_ERROR_SAMPLE_RATE = 1.0;

/** The select to use for the `maskAllText` option */
export const MASK_ALL_TEXT_SELECTOR = 'body *:not(style), body *:not(script)';

Expand Down
12 changes: 3 additions & 9 deletions packages/replay/src/integration.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import { getCurrentHub } from '@sentry/core';
import type { BrowserClientReplayOptions, Integration } from '@sentry/types';

import {
DEFAULT_ERROR_SAMPLE_RATE,
DEFAULT_FLUSH_MAX_DELAY,
DEFAULT_FLUSH_MIN_DELAY,
DEFAULT_SESSION_SAMPLE_RATE,
MASK_ALL_TEXT_SELECTOR,
} from './constants';
import { DEFAULT_FLUSH_MAX_DELAY, DEFAULT_FLUSH_MIN_DELAY, MASK_ALL_TEXT_SELECTOR } from './constants';
import { ReplayContainer } from './replay';
import type { RecordingOptions, ReplayConfiguration, ReplayPluginOptions } from './types';
import { isBrowser } from './util/isBrowser';
Expand Down Expand Up @@ -71,8 +65,8 @@ export class Replay implements Integration {
flushMinDelay,
flushMaxDelay,
stickySession,
sessionSampleRate: DEFAULT_SESSION_SAMPLE_RATE,
errorSampleRate: DEFAULT_ERROR_SAMPLE_RATE,
sessionSampleRate: 0,
errorSampleRate: 0,
useCompression,
maskAllText: typeof maskAllText === 'boolean' ? maskAllText : !maskTextSelector,
blockAllMedia,
Expand Down