@sentry/replay 10.63.0 → 10.64.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/npm/cjs/index.js +17 -16
- package/build/npm/cjs/index.js.map +1 -1
- package/build/npm/esm/index.js +18 -17
- package/build/npm/esm/index.js.map +1 -1
- package/build/npm/esm/package.json +1 -1
- package/build/npm/types/coreHandlers/handleProcessSegmentSpan.d.ts +6 -0
- package/build/npm/types/coreHandlers/handleProcessSegmentSpan.d.ts.map +1 -0
- package/build/npm/types/coreHandlers/util/addSegmentDetailsToContext.d.ts +3 -0
- package/build/npm/types/coreHandlers/util/addSegmentDetailsToContext.d.ts.map +1 -0
- package/build/npm/types/replay.d.ts.map +1 -1
- package/build/npm/types/types/replay.d.ts +8 -0
- package/build/npm/types/types/replay.d.ts.map +1 -1
- package/build/npm/types/util/sendReplayRequest.d.ts.map +1 -1
- package/build/npm/types-ts3.8/coreHandlers/handleProcessSegmentSpan.d.ts +6 -0
- package/build/npm/types-ts3.8/coreHandlers/util/addSegmentDetailsToContext.d.ts +3 -0
- package/build/npm/types-ts3.8/types/replay.d.ts +8 -0
- package/package.json +4 -4
- package/build/npm/types/coreHandlers/handleAfterSegmentSpanEnd.d.ts +0 -6
- package/build/npm/types/coreHandlers/handleAfterSegmentSpanEnd.d.ts.map +0 -1
- package/build/npm/types/coreHandlers/util/addTraceIdToContext.d.ts +0 -3
- package/build/npm/types/coreHandlers/util/addTraceIdToContext.d.ts.map +0 -1
- package/build/npm/types-ts3.8/coreHandlers/handleAfterSegmentSpanEnd.d.ts +0 -6
- package/build/npm/types-ts3.8/coreHandlers/util/addTraceIdToContext.d.ts +0 -3
package/build/npm/cjs/index.js
CHANGED
|
@@ -5869,23 +5869,23 @@ function maybeApplyCallback(event, callback) {
|
|
|
5869
5869
|
return event;
|
|
5870
5870
|
}
|
|
5871
5871
|
|
|
5872
|
-
const
|
|
5873
|
-
function
|
|
5872
|
+
const MAX_CONTEXT_VALUES = 100;
|
|
5873
|
+
function addSegmentDetailsToContext(replay, traceId, segmentName) {
|
|
5874
5874
|
const replayContext = replay.getContext();
|
|
5875
|
-
if (replayContext.traceIds.size <
|
|
5875
|
+
if (traceId && replayContext.traceIds.size < MAX_CONTEXT_VALUES) {
|
|
5876
5876
|
replayContext.traceIds.add(traceId);
|
|
5877
5877
|
}
|
|
5878
|
+
if (segmentName && replayContext.segmentNames.size < MAX_CONTEXT_VALUES) {
|
|
5879
|
+
replayContext.segmentNames.add(segmentName);
|
|
5880
|
+
}
|
|
5878
5881
|
}
|
|
5879
5882
|
|
|
5880
|
-
function
|
|
5881
|
-
return (
|
|
5882
|
-
if (!replay.isEnabled()
|
|
5883
|
+
function handleProcessSegmentSpan(replay) {
|
|
5884
|
+
return (spanJSON) => {
|
|
5885
|
+
if (!replay.isEnabled()) {
|
|
5883
5886
|
return;
|
|
5884
5887
|
}
|
|
5885
|
-
|
|
5886
|
-
if (traceId) {
|
|
5887
|
-
addTraceIdToContext(replay, traceId);
|
|
5888
|
-
}
|
|
5888
|
+
addSegmentDetailsToContext(replay, spanJSON.trace_id, spanJSON.name || void 0);
|
|
5889
5889
|
};
|
|
5890
5890
|
}
|
|
5891
5891
|
|
|
@@ -5919,10 +5919,7 @@ function handleAfterSendEvent(replay) {
|
|
|
5919
5919
|
};
|
|
5920
5920
|
}
|
|
5921
5921
|
function handleTransactionEvent(replay, event) {
|
|
5922
|
-
|
|
5923
|
-
if (traceId) {
|
|
5924
|
-
addTraceIdToContext(replay, traceId);
|
|
5925
|
-
}
|
|
5922
|
+
addSegmentDetailsToContext(replay, event.contexts?.trace?.trace_id, event.transaction);
|
|
5926
5923
|
}
|
|
5927
5924
|
function handleErrorEvent(replay, event) {
|
|
5928
5925
|
const replayContext = replay.getContext();
|
|
@@ -6781,7 +6778,7 @@ function addGlobalListeners(replay) {
|
|
|
6781
6778
|
}
|
|
6782
6779
|
}
|
|
6783
6780
|
});
|
|
6784
|
-
client.on("
|
|
6781
|
+
client.on("processSegmentSpan", handleProcessSegmentSpan(replay));
|
|
6785
6782
|
client.on("spanStart", (span) => {
|
|
6786
6783
|
replay.lastActiveSpan = span;
|
|
6787
6784
|
});
|
|
@@ -7046,7 +7043,7 @@ async function sendReplayRequest({
|
|
|
7046
7043
|
segment_id
|
|
7047
7044
|
}
|
|
7048
7045
|
});
|
|
7049
|
-
const { urls, errorIds, traceIds, initialTimestamp } = eventContext;
|
|
7046
|
+
const { urls, errorIds, traceIds, segmentNames, initialTimestamp } = eventContext;
|
|
7050
7047
|
const client = core.getClient();
|
|
7051
7048
|
const scope = core.getCurrentScope();
|
|
7052
7049
|
const transport = client?.getTransport();
|
|
@@ -7060,6 +7057,7 @@ async function sendReplayRequest({
|
|
|
7060
7057
|
timestamp: timestamp / 1e3,
|
|
7061
7058
|
error_ids: errorIds,
|
|
7062
7059
|
trace_ids: traceIds,
|
|
7060
|
+
segment_names: segmentNames,
|
|
7063
7061
|
urls,
|
|
7064
7062
|
replay_id: replayId,
|
|
7065
7063
|
segment_id,
|
|
@@ -7205,6 +7203,7 @@ class ReplayContainer {
|
|
|
7205
7203
|
this._context = {
|
|
7206
7204
|
errorIds: /* @__PURE__ */ new Set(),
|
|
7207
7205
|
traceIds: /* @__PURE__ */ new Set(),
|
|
7206
|
+
segmentNames: /* @__PURE__ */ new Set(),
|
|
7208
7207
|
urls: [],
|
|
7209
7208
|
initialTimestamp: Date.now(),
|
|
7210
7209
|
initialUrl: ""
|
|
@@ -7877,6 +7876,7 @@ class ReplayContainer {
|
|
|
7877
7876
|
_clearContext() {
|
|
7878
7877
|
this._context.errorIds.clear();
|
|
7879
7878
|
this._context.traceIds.clear();
|
|
7879
|
+
this._context.segmentNames.clear();
|
|
7880
7880
|
this._context.urls = [];
|
|
7881
7881
|
}
|
|
7882
7882
|
/** Update the initial timestamp based on the buffer content. */
|
|
@@ -7902,6 +7902,7 @@ class ReplayContainer {
|
|
|
7902
7902
|
initialUrl: this._context.initialUrl,
|
|
7903
7903
|
errorIds: Array.from(this._context.errorIds),
|
|
7904
7904
|
traceIds: Array.from(this._context.traceIds),
|
|
7905
|
+
segmentNames: Array.from(this._context.segmentNames),
|
|
7905
7906
|
urls: this._context.urls
|
|
7906
7907
|
};
|
|
7907
7908
|
this._clearContext();
|