Skip to content

Commit f0f3b7b

Browse files
cmanallenandrewshie-sentry
authored andcommitted
ref(replays): Add metrics for replay-event presence tracking (#96473)
1 parent c0fb8c0 commit f0f3b7b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/sentry/replays/consumers/recording.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
process_recording_event,
2626
track_recording_metadata,
2727
)
28-
from sentry.utils import json
28+
from sentry.utils import json, metrics
2929

3030
RECORDINGS_CODEC: Codec[ReplayRecording] = get_topic_codec(Topic.INGEST_REPLAYS_RECORDINGS)
3131

@@ -108,6 +108,9 @@ def parse_recording_event(message: bytes) -> Event:
108108
if replay_event_json:
109109
replay_event = json.loads(cast(bytes, replay_event_json))
110110
else:
111+
# Check if any events are not present in the pipeline. We need
112+
# to know because we want to write to Snuba from here soon.
113+
metrics.incr("sentry.replays.consumer.recording.missing-replay-event")
111114
replay_event = None
112115

113116
replay_video_raw = recording.get("replay_video")

0 commit comments

Comments
 (0)