@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/browser/index.js
CHANGED
|
@@ -25054,7 +25054,7 @@ const CONTINUOUS_DEBUGGING_TIMEOUT = 60000; // 1 minutes
|
|
|
25054
25054
|
const DEBUG_SESSION_MAX_DURATION_SECONDS = 10 * 60 + 30; // TODO: move to shared config otel core
|
|
25055
25055
|
const REMOTE_SESSION_RECORDING_START = 'remote-session-recording:start';
|
|
25056
25056
|
const REMOTE_SESSION_RECORDING_STOP = 'remote-session-recording:stop';
|
|
25057
|
-
const PACKAGE_VERSION_EXPORT = "1.3.
|
|
25057
|
+
const PACKAGE_VERSION_EXPORT = "1.3.33" || 0;
|
|
25058
25058
|
// Regex patterns for OpenTelemetry ignore URLs
|
|
25059
25059
|
const OTEL_IGNORE_URLS = [
|
|
25060
25060
|
// Traces endpoint
|
|
@@ -31663,7 +31663,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
31663
31663
|
"use strict";
|
|
31664
31664
|
__webpack_require__.r(__webpack_exports__);
|
|
31665
31665
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
31666
|
-
/* harmony export */ captureException: () => (/* binding */ captureException)
|
|
31666
|
+
/* harmony export */ captureException: () => (/* binding */ captureException),
|
|
31667
|
+
/* harmony export */ shouldCaptureException: () => (/* binding */ shouldCaptureException)
|
|
31667
31668
|
/* harmony export */ });
|
|
31668
31669
|
/* harmony import */ var _opentelemetry_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @opentelemetry/api */ "../../node_modules/@opentelemetry/api/build/esm/context-api.js");
|
|
31669
31670
|
/* harmony import */ var _opentelemetry_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @opentelemetry/api */ "../../node_modules/@opentelemetry/api/build/esm/trace-api.js");
|
|
@@ -31697,6 +31698,17 @@ var __read = (undefined && undefined.__read) || function (o, n) {
|
|
|
31697
31698
|
}
|
|
31698
31699
|
return ar;
|
|
31699
31700
|
};
|
|
31701
|
+
var __values = (undefined && undefined.__values) || function(o) {
|
|
31702
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
31703
|
+
if (m) return m.call(o);
|
|
31704
|
+
if (o && typeof o.length === "number") return {
|
|
31705
|
+
next: function () {
|
|
31706
|
+
if (o && i >= o.length) o = void 0;
|
|
31707
|
+
return { value: o && o[i++], done: !o };
|
|
31708
|
+
}
|
|
31709
|
+
};
|
|
31710
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
31711
|
+
};
|
|
31700
31712
|
|
|
31701
31713
|
|
|
31702
31714
|
|
|
@@ -31707,7 +31719,7 @@ var __read = (undefined && undefined.__read) || function (o, n) {
|
|
|
31707
31719
|
*/
|
|
31708
31720
|
var captureException = function (error, errorInfo) {
|
|
31709
31721
|
var _a, _b;
|
|
31710
|
-
if (!error) {
|
|
31722
|
+
if (!error || !shouldCaptureException(error)) {
|
|
31711
31723
|
return;
|
|
31712
31724
|
}
|
|
31713
31725
|
var activeContext = _opentelemetry_api__WEBPACK_IMPORTED_MODULE_1__.context.active();
|
|
@@ -31715,7 +31727,7 @@ var captureException = function (error, errorInfo) {
|
|
|
31715
31727
|
var isNewSpan = false;
|
|
31716
31728
|
if (!span || !span.isRecording()) {
|
|
31717
31729
|
span = _opentelemetry_api__WEBPACK_IMPORTED_MODULE_2__.trace.getTracer('exception').startSpan(error.name || 'Error', {
|
|
31718
|
-
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)())
|
|
31730
|
+
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)())
|
|
31719
31731
|
});
|
|
31720
31732
|
_opentelemetry_api__WEBPACK_IMPORTED_MODULE_2__.trace.setSpan(activeContext, span);
|
|
31721
31733
|
isNewSpan = true;
|
|
@@ -31736,12 +31748,57 @@ var captureException = function (error, errorInfo) {
|
|
|
31736
31748
|
span.recordException(error);
|
|
31737
31749
|
span.setStatus({
|
|
31738
31750
|
code: _opentelemetry_api__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR,
|
|
31739
|
-
message: error.message
|
|
31751
|
+
message: error.message
|
|
31740
31752
|
});
|
|
31741
31753
|
if (isNewSpan) {
|
|
31742
31754
|
span.end();
|
|
31743
31755
|
}
|
|
31744
31756
|
};
|
|
31757
|
+
/**
|
|
31758
|
+
* Best-effort deduplication of exceptions that fire multiple times
|
|
31759
|
+
* (e.g. framework handler + global handlers) within a short time window.
|
|
31760
|
+
*/
|
|
31761
|
+
var exceptionDedupeWindowMs = 2000;
|
|
31762
|
+
var recentExceptionFingerprints = new Map();
|
|
31763
|
+
var shouldCaptureException = function (error, _errorInfo) {
|
|
31764
|
+
var e_1, _a;
|
|
31765
|
+
if (!error)
|
|
31766
|
+
return false;
|
|
31767
|
+
var now = Date.now();
|
|
31768
|
+
// Build a fingerprint that is stable enough across repeated emissions
|
|
31769
|
+
// but not so broad that different errors collapse into one.
|
|
31770
|
+
var keyParts = [];
|
|
31771
|
+
keyParts.push(error.name || 'Error');
|
|
31772
|
+
keyParts.push(error.message || '');
|
|
31773
|
+
// First stack line tends to include file/line where it originated.
|
|
31774
|
+
if (typeof error.stack === 'string') {
|
|
31775
|
+
var firstFrame = error.stack.split('\n')[1] || '';
|
|
31776
|
+
keyParts.push(firstFrame.trim());
|
|
31777
|
+
}
|
|
31778
|
+
var fingerprint = keyParts.join('|').slice(0, 500);
|
|
31779
|
+
var lastSeen = recentExceptionFingerprints.get(fingerprint);
|
|
31780
|
+
if (lastSeen && now - lastSeen < exceptionDedupeWindowMs) {
|
|
31781
|
+
return false;
|
|
31782
|
+
}
|
|
31783
|
+
recentExceptionFingerprints.set(fingerprint, now);
|
|
31784
|
+
try {
|
|
31785
|
+
// Cheap cleanup of old entries to avoid unbounded growth.
|
|
31786
|
+
for (var recentExceptionFingerprints_1 = __values(recentExceptionFingerprints), recentExceptionFingerprints_1_1 = recentExceptionFingerprints_1.next(); !recentExceptionFingerprints_1_1.done; recentExceptionFingerprints_1_1 = recentExceptionFingerprints_1.next()) {
|
|
31787
|
+
var _b = __read(recentExceptionFingerprints_1_1.value, 2), key = _b[0], ts = _b[1];
|
|
31788
|
+
if (now - ts > exceptionDedupeWindowMs * 5) {
|
|
31789
|
+
recentExceptionFingerprints.delete(key);
|
|
31790
|
+
}
|
|
31791
|
+
}
|
|
31792
|
+
}
|
|
31793
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
31794
|
+
finally {
|
|
31795
|
+
try {
|
|
31796
|
+
if (recentExceptionFingerprints_1_1 && !recentExceptionFingerprints_1_1.done && (_a = recentExceptionFingerprints_1.return)) _a.call(recentExceptionFingerprints_1);
|
|
31797
|
+
}
|
|
31798
|
+
finally { if (e_1) throw e_1.error; }
|
|
31799
|
+
}
|
|
31800
|
+
return true;
|
|
31801
|
+
};
|
|
31745
31802
|
//# sourceMappingURL=capture-exception.js.map
|
|
31746
31803
|
|
|
31747
31804
|
/***/ }),
|
|
@@ -31802,7 +31859,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
31802
31859
|
/* harmony export */ setMessageBody: () => (/* reexport safe */ _set_attribute__WEBPACK_IMPORTED_MODULE_5__.setMessageBody),
|
|
31803
31860
|
/* harmony export */ setResourceAttributes: () => (/* reexport safe */ _set_resource_attributes__WEBPACK_IMPORTED_MODULE_7__.setResourceAttributes),
|
|
31804
31861
|
/* harmony export */ setRpcRequestMessage: () => (/* reexport safe */ _set_attribute__WEBPACK_IMPORTED_MODULE_5__.setRpcRequestMessage),
|
|
31805
|
-
/* harmony export */ setRpcResponseMessage: () => (/* reexport safe */ _set_attribute__WEBPACK_IMPORTED_MODULE_5__.setRpcResponseMessage)
|
|
31862
|
+
/* harmony export */ setRpcResponseMessage: () => (/* reexport safe */ _set_attribute__WEBPACK_IMPORTED_MODULE_5__.setRpcResponseMessage),
|
|
31863
|
+
/* harmony export */ shouldCaptureException: () => (/* reexport safe */ _capture_exception__WEBPACK_IMPORTED_MODULE_4__.shouldCaptureException)
|
|
31806
31864
|
/* harmony export */ });
|
|
31807
31865
|
/* harmony import */ var _mask__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mask */ "../session-recorder-common/dist/esm/sdk/mask.js");
|
|
31808
31866
|
/* harmony import */ var _schemify__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./schemify */ "../session-recorder-common/dist/esm/sdk/schemify.js");
|