Skip to content

Conversation

@cmanallen
Copy link
Member

@cmanallen cmanallen requested a review from a team as a code owner August 27, 2025 16:14
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@cmanallen cmanallen requested a review from a team as a code owner August 28, 2025 14:09
cursor[bot]

This comment was marked as outdated.

@codecov
Copy link

codecov bot commented Aug 28, 2025

Codecov Report

❌ Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sentry/replays/usecases/ingest/__init__.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master   #98353    +/-   ##
========================================
  Coverage   80.99%   80.99%            
========================================
  Files        8566     8570     +4     
  Lines      376863   377127   +264     
  Branches    24148    24148            
========================================
+ Hits       305225   305462   +237     
- Misses      71261    71288    +27     
  Partials      377      377            

@bruno-garcia
Copy link
Member

@sentry review

Comment on lines +185 to +186
if recording.context["should_publish_replay_event"] and recording.replay_event:
publish_replay_event(json.dumps(recording.replay_event))
Copy link
Contributor

Choose a reason for hiding this comment

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

Potential bug: The feature to publish replay events to Snuba is non-functional due to a key mismatch. The code looks for relay_snuba_publish_disabled, but the option is named differently.
  • Description: There is a mismatch between the configuration option name replay.relay-snuba-publishing-disabled and the key the consumer code attempts to retrieve from the recording payload, relay_snuba_publish_disabled. Because recording.get("relay_snuba_publish_disabled") in src/sentry/replays/consumers/recording.py will always return None, the should_publish_replay_event context value is always None. This causes the conditional check in src/sentry/replays/usecases/ingest/__init__.py to always evaluate to false. As a consequence, the publish_replay_event function is never called, rendering the feature to publish replay events to Snuba completely non-functional regardless of its configuration.

  • Suggested fix: Correct the key used in src/sentry/replays/consumers/recording.py from relay_snuba_publish_disabled to match the key sent by Relay. Additionally, since the flag name implies disabling publishing, the conditional logic in src/sentry/replays/usecases/ingest/__init__.py may need to be inverted to correctly handle the flag's intent.
    severity: 0.8, confidence: 0.95

Did we get this right? 👍 / 👎 to inform future reviews.

@cmanallen cmanallen merged commit 1ae44fe into master Aug 28, 2025
64 checks passed
@cmanallen cmanallen deleted the cmanallen/replays-add-relay-snuba-option branch August 28, 2025 16:46
github-merge-queue bot pushed a commit to getsentry/relay that referenced this pull request Aug 28, 2025
…nts (#5088)

Checks the global config to see if it should or should not publish the
replay-event to Snuba. For now the option should always be false until
the recording consumer can be updated to handle publishing to Snuba.

Related: getsentry/sentry-kafka-schemas#434
Related: getsentry/sentry#98353

---------

Co-authored-by: David Herberth <david.herberth@sentry.io>
@github-actions github-actions bot locked and limited conversation to collaborators Sep 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants