@multiplayer-app/session-recorder-browser 1.3.22 → 1.3.23
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 +15 -14
- package/dist/exporters/index.js +1 -1
- package/dist/index.js +15 -14
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +15 -14
- package/dist/index.umd.js.map +1 -1
- package/dist/otel/index.d.ts +2 -2
- package/dist/otel/index.d.ts.map +1 -1
- package/dist/otel/index.js +14 -13
- package/dist/otel/index.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.23" || 0;
|
|
25058
25058
|
// Regex patterns for OpenTelemetry ignore URLs
|
|
25059
25059
|
const OTEL_IGNORE_URLS = [
|
|
25060
25060
|
// Traces endpoint
|
|
@@ -26063,13 +26063,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
26063
26063
|
|
|
26064
26064
|
|
|
26065
26065
|
|
|
26066
|
+
const clientIdGenerator = _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionRecorderSdk.getIdGenerator(_multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.MULTIPLAYER_TRACE_CLIENT_ID_LENGTH);
|
|
26066
26067
|
class TracerBrowserSDK {
|
|
26067
26068
|
constructor() {
|
|
26068
26069
|
this.clientId = '';
|
|
26069
26070
|
this.sessionId = '';
|
|
26070
26071
|
this.globalErrorListenersRegistered = false;
|
|
26071
26072
|
}
|
|
26072
|
-
|
|
26073
|
+
_setSessionId(sessionId, sessionType = _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionType.MANUAL) {
|
|
26073
26074
|
this.sessionId = sessionId;
|
|
26074
26075
|
if (!this.idGenerator) {
|
|
26075
26076
|
throw new Error('Id generator not initialized');
|
|
@@ -26078,10 +26079,10 @@ class TracerBrowserSDK {
|
|
|
26078
26079
|
}
|
|
26079
26080
|
init(options) {
|
|
26080
26081
|
this.config = options;
|
|
26081
|
-
this.clientId =
|
|
26082
|
+
this.clientId = clientIdGenerator();
|
|
26082
26083
|
const { application, version, environment } = this.config;
|
|
26083
26084
|
this.idGenerator = new _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionRecorderIdGenerator();
|
|
26084
|
-
this.
|
|
26085
|
+
this._setSessionId('', _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionType.SESSION_CACHE);
|
|
26085
26086
|
this.exporter = new _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionRecorderBrowserTraceExporter({
|
|
26086
26087
|
apiKey: options.apiKey,
|
|
26087
26088
|
url: (0,_helpers__WEBPACK_IMPORTED_MODULE_3__.getExporterEndpoint)(options.exporterEndpoint),
|
|
@@ -26215,13 +26216,13 @@ class TracerBrowserSDK {
|
|
|
26215
26216
|
if (!this.tracerProvider) {
|
|
26216
26217
|
throw new Error('Configuration not initialized. Call init() before start().');
|
|
26217
26218
|
}
|
|
26218
|
-
this.
|
|
26219
|
+
this._setSessionId(sessionId, sessionType);
|
|
26219
26220
|
}
|
|
26220
26221
|
stop() {
|
|
26221
26222
|
if (!this.tracerProvider) {
|
|
26222
26223
|
throw new Error('Configuration not initialized. Call init() before start().');
|
|
26223
26224
|
}
|
|
26224
|
-
this.
|
|
26225
|
+
this._setSessionId('', _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionType.SESSION_CACHE);
|
|
26225
26226
|
}
|
|
26226
26227
|
setApiKey(apiKey) {
|
|
26227
26228
|
if (!this.exporter) {
|
|
@@ -26229,6 +26230,14 @@ class TracerBrowserSDK {
|
|
|
26229
26230
|
}
|
|
26230
26231
|
this.exporter.setApiKey(apiKey);
|
|
26231
26232
|
}
|
|
26233
|
+
async exportTraces(spans) {
|
|
26234
|
+
var _a;
|
|
26235
|
+
if ((_a = this === null || this === void 0 ? void 0 : this.batchSpanProcessor) === null || _a === void 0 ? void 0 : _a.onEnd) {
|
|
26236
|
+
spans.map((span) => { var _a; return (_a = this === null || this === void 0 ? void 0 : this.batchSpanProcessor) === null || _a === void 0 ? void 0 : _a.onEnd(span); });
|
|
26237
|
+
// return this.batchSpanProcessor.onEnd()
|
|
26238
|
+
}
|
|
26239
|
+
throw new Error('Buffer span processor not initialized');
|
|
26240
|
+
}
|
|
26232
26241
|
/**
|
|
26233
26242
|
* Capture an exception as an error span/event.
|
|
26234
26243
|
* If there is an active span, the exception will be recorded on it.
|
|
@@ -26260,14 +26269,6 @@ class TracerBrowserSDK {
|
|
|
26260
26269
|
}
|
|
26261
26270
|
catch (_ignored) { }
|
|
26262
26271
|
}
|
|
26263
|
-
async exportTraces(spans) {
|
|
26264
|
-
var _a;
|
|
26265
|
-
if ((_a = this === null || this === void 0 ? void 0 : this.batchSpanProcessor) === null || _a === void 0 ? void 0 : _a.onEnd) {
|
|
26266
|
-
spans.map((span) => { var _a; return (_a = this === null || this === void 0 ? void 0 : this.batchSpanProcessor) === null || _a === void 0 ? void 0 : _a.onEnd(span); });
|
|
26267
|
-
// return this.batchSpanProcessor.onEnd()
|
|
26268
|
-
}
|
|
26269
|
-
throw new Error('Buffer span processor not initialized');
|
|
26270
|
-
}
|
|
26271
26272
|
_recordException(span, error, errorInfo) {
|
|
26272
26273
|
span.recordException(error);
|
|
26273
26274
|
span.setStatus({ code: _opentelemetry_api__WEBPACK_IMPORTED_MODULE_13__.SpanStatusCode.ERROR, message: error.message });
|