-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Note
The pull request "feat(replay): Add traces_by_timestamp to replay event" was created by @billyvg but did not reference an issue. Therefore this issue was created for better visibility in external tools like Linear.
In order to support moving our custom rrweb events to EAP, we need to send timestamps w/ trace ids so that we can identify which trace the event belongs to.
In order to avoid breaking changes, we should not change the current type of trace_ids field in the replay event, instead we add a new field traces_by_timestamp w/ type [transaction.start_timestamp, traceId][].
Previously, we would clear all trace ids after each replay segment. so if there is not a new transaction, segments would not have a trace id associated at all. I've changed this so that we always keep the most recent trace id in between segments.
Also previously, in order to associate a replay with a trace, we wait until after a type: transaction event is sent successfully. it's possible that the replay integration is loaded after this event is sent and never gets associated with any trace ids. in this case, I've changed it so that we take the trace id from current scope and propagation context, and I use -1 for the timestamp here, but could also change to use current ts.