Skip to content

Commit

Permalink
feat(replays): Add react_component_name column (#5232)
Browse files Browse the repository at this point in the history
* Add react_component_name to replays click processor

* Update entity and storage yaml

* React component name might not be available yet

* Add react_component_name to rust processor

* Rename react_component_name to component_name

* Bump sentry-kafka-schemas version

* Bump rust version

* Revert "Bump rust version"

This reverts commit d9992a4.

* Revert "Bump sentry-kafka-schemas version"

This reverts commit e080449.
  • Loading branch information
cmanallen authored Dec 20, 2023
1 parent 66728f7 commit 67f0371
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rust_snuba/src/processors/replays.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ pub fn process_message(
click_is_dead: click.is_dead,
click_is_rage: click.is_rage,
click_node_id: click.node_id,
click_component_name: click.component_name,
click_role: click.role,
click_tag: click.tag,
click_testid: click.testid,
Expand Down Expand Up @@ -198,6 +199,8 @@ struct ReplayClickEventClick {
is_dead: u8,
is_rage: u8,
node_id: u32,
#[serde(default)]
component_name: String,
role: String,
tag: String,
testid: String,
Expand Down Expand Up @@ -395,6 +398,8 @@ struct ReplayRow {
click_aria_label: String,
#[serde(skip_serializing_if = "String::is_empty")]
click_title: String,
#[serde(skip_serializing_if = "String::is_empty")]
click_component_name: String,
#[serde(skip_serializing_if = "is_u8_zero")]
click_is_dead: u8,
#[serde(skip_serializing_if = "is_u8_zero")]
Expand Down Expand Up @@ -507,6 +512,7 @@ mod tests {
"is_dead": 0,
"is_rage": 1,
"node_id": 320,
"component_name": "SignUpButton",
"role": "button",
"tag": "div",
"testid": "",
Expand Down
1 change: 1 addition & 0 deletions snuba/datasets/configuration/replays/entities/replays.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ schema:
{ name: click_testid, type: String, args: {} },
{ name: click_aria_label, type: String, args: {} },
{ name: click_title, type: String, args: {} },
{ name: click_component_name, type: String, args: {} },
{ name: click_is_dead, type: UInt, args: { size: 8 } },
{ name: click_is_rage, type: UInt, args: { size: 8 } },
{ name: count_error_events, type: UInt, args: { size: 8 } },
Expand Down
1 change: 1 addition & 0 deletions snuba/datasets/configuration/replays/storages/replays.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ schema:
{ name: click_testid, type: String, args: {} },
{ name: click_aria_label, type: String, args: {} },
{ name: click_title, type: String, args: {} },
{ name: click_component_name, type: String, args: {} },
{ name: click_is_dead, type: UInt, args: { size: 8 } },
{ name: click_is_rage, type: UInt, args: { size: 8 } },
{ name: count_error_events, type: UInt, args: { size: 8 } },
Expand Down
1 change: 1 addition & 0 deletions snuba/datasets/processors/replays_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ def process_replay_actions(
"click_testid": to_string(click["testid"])[:64],
"click_aria_label": to_string(click["aria_label"])[:64],
"click_title": to_string(click["title"])[:64],
"click_component_name": to_string(click.get("component_name", ""))[:64],
"click_is_dead": to_uint1(click["is_dead"]),
"click_is_rage": to_uint1(click["is_rage"]),
}
Expand Down
2 changes: 2 additions & 0 deletions tests/datasets/test_replays_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,7 @@ def test_replay_actions(self) -> None:
"testid": "",
"title": "",
"text": "text",
"component_name": "SignUpButton",
"timestamp": int(now.timestamp()),
"event_hash": "df3c3aa2daae465e89f1169e49139827",
"is_dead": 0,
Expand Down Expand Up @@ -783,6 +784,7 @@ def test_replay_actions(self) -> None:
assert row["click_alt"] == ""
assert row["click_testid"] == ""
assert row["click_title"] == ""
assert row["click_component_name"] == "SignUpButton"
assert row["click_is_dead"] == 0
assert row["click_is_rage"] == 1

Expand Down

0 comments on commit 67f0371

Please sign in to comment.