Skip to content

Add replay DSC only when replay is in session mode #8013

@mydea

Description

@mydea

Currently, we set the replay_id on the DSC whenever the replay is enabled. However, due to recent changes to error sampling, you'll basically always have an active session, unless both sample rates are 0, because we always buffer. This means that when replay is enabled, and we want to sample all transactions that have a replay_id, all transactions would always be sampled (more or less).

I would propose to only add the replay_id to the DSC when the session is in session recording mode. This should ensure that it is only set on DSC when the session is actually being sent to Sentry (when an error happens, we swap the session to session mode, so it would then also be set afterwards). However, that means that any transaction created before in buffer mode would not have the DSC set. But I don't really see a good way to prevent this (ideas welcome!).

Metadata

Metadata

Assignees

Labels

Package: replayIssues related to the Sentry Replay SDK

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions