From 8cae034f032ce0549038b4158e3482cce2ceac42 Mon Sep 17 00:00:00 2001 From: Shannon Anahata Date: Mon, 2 Feb 2026 14:09:07 -0800 Subject: [PATCH 1/2] clarified how session replay works --- .../common/session-replay/index.mdx | 19 ++++++++++++++++++- .../session-replay/understanding-sessions.mdx | 8 +++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/docs/platforms/javascript/common/session-replay/index.mdx b/docs/platforms/javascript/common/session-replay/index.mdx index 76d2bfe6b7a6a3..28f958dc6d5506 100644 --- a/docs/platforms/javascript/common/session-replay/index.mdx +++ b/docs/platforms/javascript/common/session-replay/index.mdx @@ -270,7 +270,24 @@ Sentry.init({ ### How Sampling Works -Sampling begins as soon as a session starts. is evaluated first. If it's sampled, the replay recording will begin. Otherwise, is evaluated and if it's sampled, the integration will begin buffering the replay and will only upload it to Sentry if an error occurs. The remainder of the replay will behave similarly to a whole-session replay. +Sampling begins as soon as a session starts. When someone visits your application, sampling decisions happen in this order: + +1. ** is checked first** + - If sampled: Full session recording starts and is sent to Sentry in real-time + - If not sampled: Recording is buffered in memory only (last 60 seconds kept) + +2. **If an error occurs** (and session wasn't selected for full recording): + - is checked + - If sampled: Buffered 60 seconds + rest of session is sent to Sentry + - If not sampled: Buffer is discarded, nothing sent + +**When data leaves your browser:** + +| Scenario | Data Sent to Sentry | +|----------|---------------------| +| Selected for session sampling | Immediately (real-time chunks) | +| Not selected, no error occurs | Never (buffer discarded) | +| Not selected, error occurs & sampled | After error (60s before + everything after) | Read more about understanding sessions. diff --git a/docs/platforms/javascript/common/session-replay/understanding-sessions.mdx b/docs/platforms/javascript/common/session-replay/understanding-sessions.mdx index 6c57c234d75001..0fd59f0a7cb4c6 100644 --- a/docs/platforms/javascript/common/session-replay/understanding-sessions.mdx +++ b/docs/platforms/javascript/common/session-replay/understanding-sessions.mdx @@ -49,7 +49,13 @@ In `session` mode, Replay will continuously record and send data to Sentry. Afte ## Buffer Mode -In `buffer` mode, Replay will continuously record data, but won't send any of it. It will instead keep up to the last 60 seconds in memory. When an error occurs, `replaysOnErrorSampleRate` will be checked and if it's sampled, the replay will be uploaded to Sentry and continue recording normally. After 15 minutes of user inactivity, or a maximum duration of 60 minutes, the session will end and the replay will stop. +In `buffer` mode, Replay will continuously record data, but won't send any of it. It stores the last 60 seconds of event logs in a memory ring buffer (approximately 2-5MB). + + +**What's stored:** Web Session Replay captures lightweight DOM event logs (clicks, scrolls, mutations), not video files. These logs are automatically converted to video-like replays by Sentry's servers. + + +When an error occurs, `replaysOnErrorSampleRate` will be checked and if it's sampled, the buffered 60 seconds _before_ the error plus everything _after_ is uploaded to Sentry and recording continues normally. After 15 minutes of user inactivity, or a maximum duration of 60 minutes, the session will end and the replay will stop. ## Manually Add Replay Integration From 0eee9c146d8744df27a57a84299e05b35d531446 Mon Sep 17 00:00:00 2001 From: Shannon Anahata Date: Wed, 4 Feb 2026 10:05:39 -0800 Subject: [PATCH 2/2] chore: trigger CI checks Co-Authored-By: Claude Co-authored-by: Cursor