Skip to content

docs(android): Document manual Session Replay controls - #19077

Open
romtsn wants to merge 1 commit into
masterfrom
romtsn/docs/java-691-replay-controls
Open

docs(android): Document manual Session Replay controls#19077
romtsn wants to merge 1 commit into
masterfrom
romtsn/docs/java-691-replay-controls

Conversation

@romtsn

@romtsn romtsn commented Aug 19, 2026

Copy link
Copy Markdown
Member

DESCRIBE YOUR PR

Document manual Session Replay control for Android, including:

  • Starting full-session or buffered recording independently of automatic sampling
  • Pausing recording on sensitive screens and resuming the same replay
  • Stopping a replay or flushing pending data in session, buffer, and stopped states
  • Disabling automatic recording with both sample rates set to 0.0
  • Calling the APIs safely from any thread

This gives Android developers the same manual lifecycle guidance available for the JavaScript SDK while documenting Android-specific behavior such as the 30-second buffer and persistent manual pause.

Depends on getsentry/sentry-java#5978.

Refs JAVA-691

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.

Thanks in advance for your help!

PRE-MERGE CHECKLIST

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

Explain how to start full-session or buffered recording.

Document how pause, resume, stop, and flush affect the active replay.

Describe manual startup with zero sample rates and the remaining on-error sampling behavior.

Refs JAVA-691

Co-Authored-By: OpenAI Codex <noreply@openai.com>
@linear-code

linear-code Bot commented Aug 19, 2026

Copy link
Copy Markdown

JAVA-691

@vercel

vercel Bot commented Aug 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sentry-docs Ready Ready Preview Aug 19, 2026 1:16pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
develop-docs Ignored Ignored Aug 19, 2026 1:16pm

Request Review

@codeowner-assignment
codeowner-assignment Bot requested a review from a team August 19, 2026 13:15
@romtsn
romtsn marked this pull request as ready for review August 19, 2026 13:44

@runningcode runningcode left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just some questions for my understanding!


## Disable Automatic Replay Sampling

If Session Replay should start only after user consent or an app-specific condition, set both sample rates to `0.0` during initialization. This disables automatic session and error recording while keeping the Session Replay integration available for manual control.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make this active voice? like

Suggested change
If Session Replay should start only after user consent or an app-specific condition, set both sample rates to `0.0` during initialization. This disables automatic session and error recording while keeping the Session Replay integration available for manual control.
To configure Session Replay to start only after user consent or an app-specific condition, set both sample rates to `0.0` during initialization. This disables automatic session and error recording while keeping the Session Replay integration available for manual control.


### Pause Recording on Sensitive Screens

Pause recording before showing sensitive content, such as a PIN entry screen, and resume it after the content is hidden. A manually paused replay stays paused across app background and foreground transitions until you call `resume()`. Calling `resume()` when replay is stopped does nothing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add that you need to call start instead of resume here?

Suggested change
Pause recording before showing sensitive content, such as a PIN entry screen, and resume it after the content is hidden. A manually paused replay stays paused across app background and foreground transitions until you call `resume()`. Calling `resume()` when replay is stopped does nothing.
Pause recording before showing sensitive content, such as a PIN entry screen, and resume it after the content is hidden. A manually paused replay stays paused across app background and foreground transitions until you call `resume()`. Calling `resume()` when replay is stopped does nothing. Instead, call `start()` to start a new replay.


### Stop or Flush Recording

Call `stop()` to end the current replay. A later call to `start()` or `startBuffering()` creates a new replay session.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when is it sent up if flush() is never called?

</application>
```

Explicit calls to `Sentry.replay().start()` and `Sentry.replay().startBuffering()` bypass these sample rates when starting recording. With `onErrorSampleRate` set to `0.0`, call `flush()` to send a manually started buffer. See [Manual Control](/platforms/android/session-replay/#manual-control) for the complete API behavior.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Explicit calls to `Sentry.replay().start()` and `Sentry.replay().startBuffering()` bypass these sample rates when starting recording. With `onErrorSampleRate` set to `0.0`, call `flush()` to send a manually started buffer. See [Manual Control](/platforms/android/session-replay/#manual-control) for the complete API behavior.
Explicit calls to `Sentry.replay().start()` and `Sentry.replay().startBuffering()` bypass these sample rates. With `onErrorSampleRate` set to `0.0`, call `flush()` to send a manually started buffer. See [Manual Control](/platforms/android/session-replay/#manual-control) for the complete API behavior.

Choose the recording mode that fits your use case:

- `start()` starts a full-session replay.
- `startBuffering()` keeps a rolling buffer of up to 30 seconds. The SDK sends the buffer when an error is sampled or you call `flush()`, then continues recording in session mode.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `startBuffering()` keeps a rolling buffer of up to 30 seconds. The SDK sends the buffer when an error is sampled or you call `flush()`, then continues recording in session mode.
- `startBuffering()` keeps a rolling buffer of up to 30 seconds. The SDK sends the buffer when either an error is sampled or you call `flush()`, then continues recording in session mode.

Sentry.replay().stop();
```

Call `flush()` to send the current replay data without stopping recording. In session mode, it sends the pending segment and continues recording. In buffer mode, it sends the buffer and switches to session mode. Calling `flush()` while recording is stopped starts a new full-session replay.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Call `flush()` to send the current replay data without stopping recording. In session mode, it sends the pending segment and continues recording. In buffer mode, it sends the buffer and switches to session mode. Calling `flush()` while recording is stopped starts a new full-session replay.
Call `flush()` to send the current replay data without stopping the recording. In session mode, it sends the pending segment and continues recording. In buffer mode, it sends the buffer and switches to session mode. Calling `flush()` while recording is stopped starts a new full-session replay.

@coolguyzone coolguyzone left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for updating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants