Skip to content

Commit 9e00aa3

Browse files
ref(replay): update log messages to include timestamps (#94128)
timestamps should be included in all log messages to help the LLM create the timeranges. also feedback accidentally got merged back in which we should remove
1 parent 3f6fa5d commit 9e00aa3

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

src/sentry/replays/endpoints/project_replay_summarize_breadcrumbs.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,9 @@ def as_log_message(event: dict[str, Any]) -> str | None:
209209
case EventType.CONSOLE:
210210
return f"Logged: {event["data"]["payload"]["message"]} at {timestamp}"
211211
case EventType.UI_BLUR:
212-
return f"User looked away from the tab at {timestamp}."
212+
return f"User looked away from the tab at {timestamp}"
213213
case EventType.UI_FOCUS:
214-
return f"User returned to tab at {timestamp}."
214+
return f"User returned to tab at {timestamp}"
215215
case EventType.RESOURCE_FETCH:
216216
payload = event["data"]["payload"]
217217
parsed_url = urlparse(payload["description"])
@@ -243,19 +243,17 @@ def as_log_message(event: dict[str, Any]) -> str | None:
243243
case EventType.LCP:
244244
duration = event["data"]["payload"]["data"]["size"]
245245
rating = event["data"]["payload"]["data"]["rating"]
246-
return f"Application largest contentful paint: {duration} ms and has a {rating} rating"
246+
return f"Application largest contentful paint: {duration} ms and has a {rating} rating at {timestamp}"
247247
case EventType.FCP:
248248
duration = event["data"]["payload"]["data"]["size"]
249249
rating = event["data"]["payload"]["data"]["rating"]
250-
return f"Application first contentful paint: {duration} ms and has a {rating} rating"
250+
return f"Application first contentful paint: {duration} ms and has a {rating} rating at {timestamp}"
251251
case EventType.HYDRATION_ERROR:
252-
return f"There was a hydration error on the page at {timestamp}."
252+
return f"There was a hydration error on the page at {timestamp}"
253253
case EventType.MUTATIONS:
254254
return None
255255
case EventType.UNKNOWN:
256256
return None
257-
case EventType.FEEDBACK:
258-
return "The user filled out a feedback form describing their experience using the application."
259257
case EventType.CANVAS:
260258
return None
261259
case EventType.OPTIONS:

src/sentry/replays/usecases/ingest/event_parser.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,8 @@ class EventType(Enum):
7474
HYDRATION_ERROR = 11
7575
MUTATIONS = 12
7676
UNKNOWN = 13
77-
FEEDBACK = 14
78-
CANVAS = 15
79-
OPTIONS = 16
77+
CANVAS = 14
78+
OPTIONS = 15
8079

8180

8281
def which(event: dict[str, Any]) -> EventType:
@@ -136,8 +135,6 @@ def which(event: dict[str, Any]) -> EventType:
136135
return EventType.HYDRATION_ERROR
137136
elif category == "replay.mutations":
138137
return EventType.MUTATIONS
139-
elif category == "sentry.feedback":
140-
return EventType.FEEDBACK
141138
else:
142139
return EventType.UNKNOWN
143140
elif event["data"]["tag"] == "performanceSpan":

0 commit comments

Comments
 (0)