Skip to content

Add integration with Session Replay product for native platforms#1445

Merged
tustanivsky merged 25 commits into
mainfrom
feat/session-replay-envelope
Jul 7, 2026
Merged

Add integration with Session Replay product for native platforms#1445
tustanivsky merged 25 commits into
mainfrom
feat/session-replay-envelope

Conversation

@tustanivsky

@tustanivsky tustanivsky commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

This PR adds Session Replay product integration for platforms where sentry-native is used (desktop, both crashpad and native backends supported). The gameplay recorded in the rolling buffer before a crash is now delivered to Sentry as a separate session replay envelope (discoverable in the Replays dashboard and associated with the crash) instead of only being attached to the event as an MP4 file.

Example replay capture.

Key Changes

  • The session-replay recorder now writes a small JSON metadata sidecar (replay-<id>.json) next to the rolling MP4.
  • On crash, the recording's replay_id is set on the event's replay context so the crash and the replay are linked.
  • The bundled sentry-native backend builds the replay_video envelope from the sidecar + MP4 and sends it to Sentry:
    • crashpad: writes the envelope to the run directory via the disk transport, where it is picked up on the next application launch.
    • native: uploads the envelope out of process during the same crashed session.
  • Replay is enriched from the crash event's scope (tags, contexts, release, environment, user) and the matching trace id, so the it correlates with the crash's events/spans.

Known Limitations

  • On Windows and Linux, when the crashpad backend (default) is used, the replay envelope is uploaded on the next application launch after the crash occurs. With the native backend (opt-in), the replay envelope is uploaded to Sentry during the same crashed session.
  • On macOS, when the cocoa backend is used, the replay clip remains attached to the crash event as an MP4 attachment.

Depends on:

Related items

@github-actions

github-actions Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor
Fails
🚫 Please consider adding a changelog entry for the next release.
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

### Features

- Add integration with Session Replay product for native platforms ([#1445](https://github.com/getsentry/sentry-unreal/pull/1445))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against f39ee2a

@tustanivsky tustanivsky force-pushed the feat/session-replay-envelope branch from 4bd006c to 1ae3c03 Compare June 25, 2026 07:32
@tustanivsky tustanivsky changed the title Add integration with Session Replay product Add integration with Session Replay product (native backend) Jun 29, 2026
@tustanivsky tustanivsky changed the title Add integration with Session Replay product (native backend) Add integration with Session Replay product for native backend Jun 29, 2026
@tustanivsky tustanivsky marked this pull request as ready for review June 29, 2026 10:34
Comment thread plugin-dev/Source/Sentry/Private/Mac/MacSentrySubsystem.cpp
@jpnurmi

jpnurmi commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Is this ready to go, or waiting for a sentry-native release?

@tustanivsky

Copy link
Copy Markdown
Collaborator Author

Is this ready to go, or waiting for a sentry-native release?

Technically, this can be merged as-is. However, I'd like to add end-to-end tests for replay envelope capturing and to do that we'll first need to pull in the native changes introduced in getsentry/sentry-native#1809.

@tustanivsky tustanivsky changed the title Add integration with Session Replay product for native backend Add integration with Session Replay product for native platforms Jul 6, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 48652af. Configure here.

@tustanivsky tustanivsky merged commit cf88eec into main Jul 7, 2026
135 of 138 checks passed
@tustanivsky tustanivsky deleted the feat/session-replay-envelope branch July 7, 2026 08:37
tustanivsky added a commit to getsentry/sentry-docs that referenced this pull request Jul 8, 2026
This PR updates the Unreal SDK Session Replay documentation now that the
feature is fully integrated with the corresponding Sentry product.

Related items:
- getsentry/sentry-unreal#1445
- getsentry/sentry-unreal#1468
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.

3 participants