-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(replay): Add traces_by_timestamp to replay event
#18048
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
c72a99c
ffc6cd9
1c9f09f
424964d
56599e5
ee2cba9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,12 +37,16 @@ export async function sendReplayRequest({ | |
| return Promise.resolve({}); | ||
| } | ||
|
|
||
| const uniqueTraceIds = Array.from(new Set(traceIds.map(([_ts, traceId]) => traceId))); | ||
| const baseEvent: ReplayEvent = { | ||
| type: REPLAY_EVENT_NAME, | ||
| replay_start_timestamp: initialTimestamp / 1000, | ||
| timestamp: timestamp / 1000, | ||
| error_ids: errorIds, | ||
| trace_ids: traceIds, | ||
| trace_ids: uniqueTraceIds, | ||
| traces_by_timestamp: traceIds | ||
| .filter(([_ts, traceId]) => uniqueTraceIds.includes(traceId)) | ||
| .map(([ts, traceId]) => [ts, traceId]), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Redundant Filter Causes Unnecessary Performance OverheadThe filter for |
||
| urls, | ||
| replay_id: replayId, | ||
| segment_id, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Timestamp Handling Ignores Valid Zero Value
The
event.start_timestampcheck inhandleTransactionEventuses a truthy evaluation, which causes trace IDs to not be recorded for transactions with astart_timestampof 0. Although rare, 0 is a valid Unix epoch timestamp.