@multiplayer-app/session-recorder-browser 1.3.13 → 1.3.14

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/index.umd.js CHANGED
@@ -24323,7 +24323,7 @@ const CONTINUOUS_DEBUGGING_TIMEOUT = 60000; // 1 minutes
24323
24323
  const DEBUG_SESSION_MAX_DURATION_SECONDS = 10 * 60 + 30; // TODO: move to shared config otel core
24324
24324
  const REMOTE_SESSION_RECORDING_START = 'remote-session-recording:start';
24325
24325
  const REMOTE_SESSION_RECORDING_STOP = 'remote-session-recording:stop';
24326
- const PACKAGE_VERSION_EXPORT = "1.3.13" || 0;
24326
+ const PACKAGE_VERSION_EXPORT = "1.3.14" || 0;
24327
24327
  // Regex patterns for OpenTelemetry ignore URLs
24328
24328
  const OTEL_IGNORE_URLS = [
24329
24329
  // Traces endpoint
@@ -25233,7 +25233,6 @@ const getElementTextContent = (element) => {
25233
25233
 
25234
25234
 
25235
25235
 
25236
-
25237
25236
  class TracerBrowserSDK {
25238
25237
  constructor() {
25239
25238
  this.sessionId = '';
@@ -25408,14 +25407,7 @@ class TracerBrowserSDK {
25408
25407
  try {
25409
25408
  const activeSpan = _opentelemetry_api__WEBPACK_IMPORTED_MODULE_10__.trace.getSpan(_opentelemetry_api__WEBPACK_IMPORTED_MODULE_11__.context.active());
25410
25409
  if (activeSpan) {
25411
- // Standard OTEL exception event + span status
25412
- _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionRecorderSdk.captureException(error);
25413
- activeSpan.addEvent('exception', {
25414
- 'exception.type': error.name || 'Error',
25415
- 'exception.message': error.message,
25416
- 'exception.stacktrace': error.stack || '',
25417
- ...(errorInfo || {}),
25418
- });
25410
+ this._recordException(activeSpan, error, errorInfo);
25419
25411
  return;
25420
25412
  }
25421
25413
  // eslint-disable-next-line
@@ -25425,19 +25417,24 @@ class TracerBrowserSDK {
25425
25417
  try {
25426
25418
  const tracer = _opentelemetry_api__WEBPACK_IMPORTED_MODULE_10__.trace.getTracer('exception');
25427
25419
  const span = tracer.startSpan(error.name || 'Error');
25428
- span.recordException(error);
25429
- span.setStatus({ code: _opentelemetry_api__WEBPACK_IMPORTED_MODULE_12__.SpanStatusCode.ERROR, message: error.message });
25430
- span.addEvent('exception', {
25431
- 'exception.type': error.name || 'Error',
25432
- 'exception.message': error.message,
25433
- 'exception.stacktrace': error.stack || '',
25434
- ...(errorInfo || {}),
25435
- });
25420
+ this._recordException(span, error, errorInfo);
25436
25421
  span.end();
25437
25422
  // eslint-disable-next-line
25438
25423
  }
25439
25424
  catch (_ignored) { }
25440
25425
  }
25426
+ _recordException(span, error, errorInfo) {
25427
+ span.recordException(error);
25428
+ span.setStatus({ code: _opentelemetry_api__WEBPACK_IMPORTED_MODULE_12__.SpanStatusCode.ERROR, message: error.message });
25429
+ span.setAttribute('exception.type', error.name || 'Error');
25430
+ span.setAttribute('exception.message', error.message);
25431
+ span.setAttribute('exception.stacktrace', error.stack || '');
25432
+ if (errorInfo) {
25433
+ Object.entries(errorInfo).forEach(([key, value]) => {
25434
+ span.setAttribute(`error_info.${key}`, value);
25435
+ });
25436
+ }
25437
+ }
25441
25438
  _getSpanSessionIdProcessor() {
25442
25439
  return {
25443
25440
  forceFlush: () => Promise.resolve(),