@multiplayer-app/session-recorder-browser 1.3.32 → 1.3.33
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/dist/browser/index.js +64 -6
- package/dist/exporters/index.js +1 -1
- package/dist/exporters/index.js.map +1 -1
- package/dist/index.js +64 -6
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +64 -6
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -24152,7 +24152,7 @@ const CONTINUOUS_DEBUGGING_TIMEOUT = 60000; // 1 minutes
|
|
|
24152
24152
|
const DEBUG_SESSION_MAX_DURATION_SECONDS = 10 * 60 + 30; // TODO: move to shared config otel core
|
|
24153
24153
|
const REMOTE_SESSION_RECORDING_START = 'remote-session-recording:start';
|
|
24154
24154
|
const REMOTE_SESSION_RECORDING_STOP = 'remote-session-recording:stop';
|
|
24155
|
-
const PACKAGE_VERSION_EXPORT = "1.3.
|
|
24155
|
+
const PACKAGE_VERSION_EXPORT = "1.3.33" || 0;
|
|
24156
24156
|
// Regex patterns for OpenTelemetry ignore URLs
|
|
24157
24157
|
const OTEL_IGNORE_URLS = [
|
|
24158
24158
|
// Traces endpoint
|
|
@@ -30578,7 +30578,8 @@ var SessionRecorderBrowserTraceExporter = /** @class */ (function () {
|
|
|
30578
30578
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
30579
30579
|
|
|
30580
30580
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
30581
|
-
/* harmony export */ captureException: () => (/* binding */ captureException)
|
|
30581
|
+
/* harmony export */ captureException: () => (/* binding */ captureException),
|
|
30582
|
+
/* harmony export */ shouldCaptureException: () => (/* binding */ shouldCaptureException)
|
|
30582
30583
|
/* harmony export */ });
|
|
30583
30584
|
/* harmony import */ var _opentelemetry_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @opentelemetry/api */ "../../node_modules/@opentelemetry/api/build/esm/context-api.js");
|
|
30584
30585
|
/* harmony import */ var _opentelemetry_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @opentelemetry/api */ "../../node_modules/@opentelemetry/api/build/esm/trace-api.js");
|
|
@@ -30612,6 +30613,17 @@ var __read = (undefined && undefined.__read) || function (o, n) {
|
|
|
30612
30613
|
}
|
|
30613
30614
|
return ar;
|
|
30614
30615
|
};
|
|
30616
|
+
var __values = (undefined && undefined.__values) || function(o) {
|
|
30617
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
30618
|
+
if (m) return m.call(o);
|
|
30619
|
+
if (o && typeof o.length === "number") return {
|
|
30620
|
+
next: function () {
|
|
30621
|
+
if (o && i >= o.length) o = void 0;
|
|
30622
|
+
return { value: o && o[i++], done: !o };
|
|
30623
|
+
}
|
|
30624
|
+
};
|
|
30625
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
30626
|
+
};
|
|
30615
30627
|
|
|
30616
30628
|
|
|
30617
30629
|
|
|
@@ -30622,7 +30634,7 @@ var __read = (undefined && undefined.__read) || function (o, n) {
|
|
|
30622
30634
|
*/
|
|
30623
30635
|
var captureException = function (error, errorInfo) {
|
|
30624
30636
|
var _a, _b;
|
|
30625
|
-
if (!error) {
|
|
30637
|
+
if (!error || !shouldCaptureException(error)) {
|
|
30626
30638
|
return;
|
|
30627
30639
|
}
|
|
30628
30640
|
var activeContext = _opentelemetry_api__WEBPACK_IMPORTED_MODULE_1__.context.active();
|
|
@@ -30630,7 +30642,7 @@ var captureException = function (error, errorInfo) {
|
|
|
30630
30642
|
var isNewSpan = false;
|
|
30631
30643
|
if (!span || !span.isRecording()) {
|
|
30632
30644
|
span = _opentelemetry_api__WEBPACK_IMPORTED_MODULE_2__.trace.getTracer('exception').startSpan(error.name || 'Error', {
|
|
30633
|
-
attributes: __assign((_a = {}, _a[_opentelemetry_semantic_conventions__WEBPACK_IMPORTED_MODULE_3__.ATTR_EXCEPTION_MESSAGE] = error.message, _a[_opentelemetry_semantic_conventions__WEBPACK_IMPORTED_MODULE_3__.ATTR_EXCEPTION_STACKTRACE] = error.stack, _a[_opentelemetry_semantic_conventions__WEBPACK_IMPORTED_MODULE_3__.ATTR_EXCEPTION_TYPE] = error.name, _a), (0,_set_resource_attributes__WEBPACK_IMPORTED_MODULE_0__.getResourceAttributes)())
|
|
30645
|
+
attributes: __assign((_a = {}, _a[_opentelemetry_semantic_conventions__WEBPACK_IMPORTED_MODULE_3__.ATTR_EXCEPTION_MESSAGE] = error.message, _a[_opentelemetry_semantic_conventions__WEBPACK_IMPORTED_MODULE_3__.ATTR_EXCEPTION_STACKTRACE] = error.stack, _a[_opentelemetry_semantic_conventions__WEBPACK_IMPORTED_MODULE_3__.ATTR_EXCEPTION_TYPE] = error.name, _a), (0,_set_resource_attributes__WEBPACK_IMPORTED_MODULE_0__.getResourceAttributes)())
|
|
30634
30646
|
});
|
|
30635
30647
|
_opentelemetry_api__WEBPACK_IMPORTED_MODULE_2__.trace.setSpan(activeContext, span);
|
|
30636
30648
|
isNewSpan = true;
|
|
@@ -30651,12 +30663,57 @@ var captureException = function (error, errorInfo) {
|
|
|
30651
30663
|
span.recordException(error);
|
|
30652
30664
|
span.setStatus({
|
|
30653
30665
|
code: _opentelemetry_api__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR,
|
|
30654
|
-
message: error.message
|
|
30666
|
+
message: error.message
|
|
30655
30667
|
});
|
|
30656
30668
|
if (isNewSpan) {
|
|
30657
30669
|
span.end();
|
|
30658
30670
|
}
|
|
30659
30671
|
};
|
|
30672
|
+
/**
|
|
30673
|
+
* Best-effort deduplication of exceptions that fire multiple times
|
|
30674
|
+
* (e.g. framework handler + global handlers) within a short time window.
|
|
30675
|
+
*/
|
|
30676
|
+
var exceptionDedupeWindowMs = 2000;
|
|
30677
|
+
var recentExceptionFingerprints = new Map();
|
|
30678
|
+
var shouldCaptureException = function (error, _errorInfo) {
|
|
30679
|
+
var e_1, _a;
|
|
30680
|
+
if (!error)
|
|
30681
|
+
return false;
|
|
30682
|
+
var now = Date.now();
|
|
30683
|
+
// Build a fingerprint that is stable enough across repeated emissions
|
|
30684
|
+
// but not so broad that different errors collapse into one.
|
|
30685
|
+
var keyParts = [];
|
|
30686
|
+
keyParts.push(error.name || 'Error');
|
|
30687
|
+
keyParts.push(error.message || '');
|
|
30688
|
+
// First stack line tends to include file/line where it originated.
|
|
30689
|
+
if (typeof error.stack === 'string') {
|
|
30690
|
+
var firstFrame = error.stack.split('\n')[1] || '';
|
|
30691
|
+
keyParts.push(firstFrame.trim());
|
|
30692
|
+
}
|
|
30693
|
+
var fingerprint = keyParts.join('|').slice(0, 500);
|
|
30694
|
+
var lastSeen = recentExceptionFingerprints.get(fingerprint);
|
|
30695
|
+
if (lastSeen && now - lastSeen < exceptionDedupeWindowMs) {
|
|
30696
|
+
return false;
|
|
30697
|
+
}
|
|
30698
|
+
recentExceptionFingerprints.set(fingerprint, now);
|
|
30699
|
+
try {
|
|
30700
|
+
// Cheap cleanup of old entries to avoid unbounded growth.
|
|
30701
|
+
for (var recentExceptionFingerprints_1 = __values(recentExceptionFingerprints), recentExceptionFingerprints_1_1 = recentExceptionFingerprints_1.next(); !recentExceptionFingerprints_1_1.done; recentExceptionFingerprints_1_1 = recentExceptionFingerprints_1.next()) {
|
|
30702
|
+
var _b = __read(recentExceptionFingerprints_1_1.value, 2), key = _b[0], ts = _b[1];
|
|
30703
|
+
if (now - ts > exceptionDedupeWindowMs * 5) {
|
|
30704
|
+
recentExceptionFingerprints.delete(key);
|
|
30705
|
+
}
|
|
30706
|
+
}
|
|
30707
|
+
}
|
|
30708
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
30709
|
+
finally {
|
|
30710
|
+
try {
|
|
30711
|
+
if (recentExceptionFingerprints_1_1 && !recentExceptionFingerprints_1_1.done && (_a = recentExceptionFingerprints_1.return)) _a.call(recentExceptionFingerprints_1);
|
|
30712
|
+
}
|
|
30713
|
+
finally { if (e_1) throw e_1.error; }
|
|
30714
|
+
}
|
|
30715
|
+
return true;
|
|
30716
|
+
};
|
|
30660
30717
|
//# sourceMappingURL=capture-exception.js.map
|
|
30661
30718
|
|
|
30662
30719
|
/***/ }),
|
|
@@ -30714,7 +30771,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
30714
30771
|
/* harmony export */ setMessageBody: () => (/* reexport safe */ _set_attribute__WEBPACK_IMPORTED_MODULE_5__.setMessageBody),
|
|
30715
30772
|
/* harmony export */ setResourceAttributes: () => (/* reexport safe */ _set_resource_attributes__WEBPACK_IMPORTED_MODULE_7__.setResourceAttributes),
|
|
30716
30773
|
/* harmony export */ setRpcRequestMessage: () => (/* reexport safe */ _set_attribute__WEBPACK_IMPORTED_MODULE_5__.setRpcRequestMessage),
|
|
30717
|
-
/* harmony export */ setRpcResponseMessage: () => (/* reexport safe */ _set_attribute__WEBPACK_IMPORTED_MODULE_5__.setRpcResponseMessage)
|
|
30774
|
+
/* harmony export */ setRpcResponseMessage: () => (/* reexport safe */ _set_attribute__WEBPACK_IMPORTED_MODULE_5__.setRpcResponseMessage),
|
|
30775
|
+
/* harmony export */ shouldCaptureException: () => (/* reexport safe */ _capture_exception__WEBPACK_IMPORTED_MODULE_4__.shouldCaptureException)
|
|
30718
30776
|
/* harmony export */ });
|
|
30719
30777
|
/* harmony import */ var _mask__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mask */ "../session-recorder-common/dist/esm/sdk/mask.js");
|
|
30720
30778
|
/* harmony import */ var _schemify__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./schemify */ "../session-recorder-common/dist/esm/sdk/schemify.js");
|