Skip to content

Structured logs include replay_id when replay is not sampled #17676

@kerenkhatiwada

Description

@kerenkhatiwada

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/react

SDK Version

10.12.0

Framework Version

No response

Link to Sentry event

No response

Reproduction Example/SDK Setup

No response

Steps to Reproduce

Structured logs are showing a replay_id even when the replay was not sampled due to replaysOnErrorSampleRate. This causes confusion since the replay can’t be found in Sentry.

  1. Configure SDK with replaysOnErrorSampleRate: 0.2 (or any low sample rate).
  2. Trigger an error in the app that incudes logs
  3. Notice that a replay_id tag is in the logs even when the replay was not actually captured / attatched to the error due to replaysOnErrorSampleRate

example issue here where logs include a replay_id but no replay is associated with the error or found in replays search

Image

Expected Result

If a replay isn’t sampled and won’t be sent to Sentry, the associated error/log should not include a replay_id

Actual Result

Structured logs still contain a replay_id, even when the replay is skipped due to sampling. This creates confusion for users who try to search for the replay in Sentry but can’t find it.

Additional Context

Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions