Skip to content

Conversation

@jamescrosswell
Copy link
Collaborator

@jamescrosswell jamescrosswell commented Apr 23, 2025

Part of #2136

Associate Errors and Traces with the active Session Replay (if one exists) on Android.

Protocol

Although there is a new Replay context, I found that just setting the replay_id on that context (e.g. for an event) did not result in the event showing in the errors pane for session replays.

What was recommended, and work better, is to store the replay_id on the DSC (which will accompany all events) and let Relay unpack it from there. The DSC specification mentions replay_id as an optional property on the dynamic sampling context.

Getting the Replay ID

There are three ways the DSC can be created:

  1. From the currently active transaction
  2. From the propagation context
  3. From a BaggageHeader (in distributed tracing scenarios)

In all 3 cases, we check to see if there's a Session Replay actively being recorded. If there is, we either set (or overwrite) the replay_id that int he DSC. If there's not, we just propagate whatever is in the header.

This is a bit different to what we normally do with the baggage headers, so there are quite a few new scenarios to unit test.

Part of #2136

Associate Errors and Traces with the active Session Replay (if one exists) on Android.
@github-actions
Copy link
Contributor

github-actions bot commented Apr 23, 2025

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

Generated by 🚫 dangerJS against 438c4e6

@jamescrosswell jamescrosswell marked this pull request as ready for review April 28, 2025 08:42
@jamescrosswell jamescrosswell marked this pull request as draft April 29, 2025 06:16
@jamescrosswell jamescrosswell marked this pull request as ready for review April 29, 2025 22:43
@jamescrosswell jamescrosswell marked this pull request as draft April 29, 2025 22:53
@jamescrosswell jamescrosswell merged commit 2e1fff1 into main May 13, 2025
26 checks passed
@jamescrosswell jamescrosswell deleted the replay-link-events branch May 13, 2025 11:15
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.

6 participants