Skip to content

Conversation

cliffordxing
Copy link
Contributor

This PR modifies ReplayRow Type for a new event, and creates a new type ReplayTapEvent. Then, a new case is added to the deserializer function to parse tap event and convert to ReplayRow type.

Relates to: https://linear.app/getsentry/issue/REPLAY-760/modify-replay-processor

@cliffordxing cliffordxing requested a review from a team as a code owner October 2, 2025 20:59
Copy link

linear bot commented Oct 2, 2025

Comment on lines +549 to +551
tap_message: String,
tap_view_class: String,
tap_view_id: String,
Copy link

Choose a reason for hiding this comment

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

Potential bug: The new fields tap_message, tap_view_class, and tap_view_id added to ReplayRow are missing corresponding columns in the ClickHouse database schema, which will cause insertion failures.
  • Description: The ReplayRow struct has been updated with new fields tap_message, tap_view_class, and tap_view_id to support tap events. However, the corresponding columns have not been added to the ClickHouse database schema. The schema definition in snuba/datasets/configuration/replays/storages/replays.yaml and the lack of a new database migration file confirm this omission. When the Rust processor serializes a tap event, the resulting JSON will contain these new fields. The subsequent attempt to insert this data into the replays table will fail with a "Missing columns" error from ClickHouse, preventing tap event data from being saved.

  • Suggested fix: Create a new database migration to add the tap_message, tap_view_class, and tap_view_id columns to the replays_local and replays_dist tables in ClickHouse. Also, update the YAML schema configuration at snuba/datasets/configuration/replays/storages/replays.yaml to include these new columns.
    severity: 0.85, confidence: 0.98

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

@cliffordxing cliffordxing requested a review from a team as a code owner October 2, 2025 21:49
Copy link
Member

@cmanallen cmanallen left a comment

Choose a reason for hiding this comment

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

Looks good to me. Let's add a simple unit test in replay.rs to verify the behavior explicitly and then we'll go over next steps.

event_hash: tap.event_hash,
offset,
partition,
platform: "".to_string(),
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need this since empty string is the default value for String and platform is String.

tap_message: tap.message,
tap_view_class: tap.view_class,
tap_view_id: tap.view_id,
environment: event.environment.clone().unwrap_or("".to_string()),
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
environment: event.environment.clone().unwrap_or("".to_string()),
environment: event.environment.clone().unwrap_or_default(),

@cliffordxing cliffordxing merged commit 4184d46 into master Oct 9, 2025
33 of 34 checks passed
@cliffordxing cliffordxing deleted the replay_processor_change_for_taps branch October 9, 2025 21:00
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.

4 participants