Skip to content

feat(session-replay): upload replay envelope from the native crash daemon#1809

Draft
tustanivsky wants to merge 11 commits into
masterfrom
feat/session-replay-prod
Draft

feat(session-replay): upload replay envelope from the native crash daemon#1809
tustanivsky wants to merge 11 commits into
masterfrom
feat/session-replay-prod

Conversation

@tustanivsky

@tustanivsky tustanivsky commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

This PR adds Session Replay product support to the native backend. When a downstream SDK (e.g. sentry-unreal) has staged a recorded clip on disk, the crash daemon now builds a replay_video envelope from it and performs an upload so the clip becomes a first-class Session Replay in Sentry, linked to the crash instead of only being available as a file attachment.

Key Changes

  • New internal sentry__session_replay_flush_pending(): scans <database>/replays/ for embedder-staged clips (a replay-<id>.json metadata sidecar + its .mp4), builds the replay_event + replay_recording + video into a replay_video envelope, and hands it to the transport.
  • Scope/trace sync: the replay event reuses the crash event's already-applied scope (tags, contexts, release, environment, user, sdk) and lifts its trace_id, read back from <run>/__sentry-event. This makes the replay carry the same tags as the crash and correlate via the same trace.
  • Wired into the crash daemon: after the crash report is captured, the daemon calls flush_pending out-of-process, so the replay is sent in the same session as the crash (no next-launch step).
  • No new public API - the embedder communicates entirely through the on-disk replays/ convention.

Known Limitations

  • Native daemon backend only - not wired for crashpad / breakpad / inproc.

Related items

#skip-changelog

@github-actions

github-actions Bot commented Jun 20, 2026

Copy link
Copy Markdown
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 772dcbb

@tustanivsky tustanivsky force-pushed the feat/session-replay-prod branch from 154ce2f to b437853 Compare June 25, 2026 07:30
@tustanivsky tustanivsky changed the title feat: add Session Replay envelope capture utility feat(session-replay): upload replay envelope from the native crash daemon Jun 29, 2026
Comment thread src/session_replay/sentry_session_replay.c
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.

1 participant