@coralogix/browser 2.3.0 → 2.4.1
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/CHANGELOG.md +12 -0
- package/README.md +20 -2
- package/index.esm2.js +188 -179
- package/package.json +1 -1
- package/sessionRecorder.esm.js +36 -32
- package/src/instrumentations/CoralogixCustomLogInstrumentation.d.ts +9 -1
- package/src/session/sessionManager.d.ts +1 -0
- package/src/types.d.ts +7 -7
- package/src/version.d.ts +1 -1
package/index.esm2.js
CHANGED
|
@@ -17,7 +17,7 @@ function isRegExp(value) {
|
|
|
17
17
|
return value instanceof RegExp;
|
|
18
18
|
}
|
|
19
19
|
function isMatchingPattern(value, pattern, requireExactStringMatch) {
|
|
20
|
-
if (requireExactStringMatch ===
|
|
20
|
+
if (requireExactStringMatch === void 0) { requireExactStringMatch = false; }
|
|
21
21
|
if (!isString(value)) {
|
|
22
22
|
return false;
|
|
23
23
|
}
|
|
@@ -32,8 +32,8 @@ function isMatchingPattern(value, pattern, requireExactStringMatch) {
|
|
|
32
32
|
return false;
|
|
33
33
|
}
|
|
34
34
|
function stringMatchesSomePattern(testString, patterns, requireExactStringMatch) {
|
|
35
|
-
if (patterns ===
|
|
36
|
-
if (requireExactStringMatch ===
|
|
35
|
+
if (patterns === void 0) { patterns = []; }
|
|
36
|
+
if (requireExactStringMatch === void 0) { requireExactStringMatch = false; }
|
|
37
37
|
return patterns.some(function (pattern) {
|
|
38
38
|
return isMatchingPattern(testString, pattern, requireExactStringMatch);
|
|
39
39
|
});
|
|
@@ -324,7 +324,7 @@ function getCustomTracerIgnoredInstruments() {
|
|
|
324
324
|
function shouldAttachSpanToGlobalSpan(instrumentationType) {
|
|
325
325
|
var _a;
|
|
326
326
|
return (getGlobalSpan() &&
|
|
327
|
-
!((_a = getCustomTracerIgnoredInstruments()) === null || _a ===
|
|
327
|
+
!((_a = getCustomTracerIgnoredInstruments()) === null || _a === void 0 ? void 0 : _a.includes(instrumentationType)));
|
|
328
328
|
}
|
|
329
329
|
function attachChildSpanToGlobalSpan(name) {
|
|
330
330
|
var span;
|
|
@@ -370,13 +370,13 @@ function getAttrProcessor() {
|
|
|
370
370
|
}
|
|
371
371
|
|
|
372
372
|
function setCustomLabelsForSpan(span, labels) {
|
|
373
|
-
if (labels ===
|
|
373
|
+
if (labels === void 0) { labels = {}; }
|
|
374
374
|
span.setAttribute(CoralogixAttributes.CUSTOM_LABELS, JSON.stringify(getCustomMergedLabels(labels)));
|
|
375
375
|
}
|
|
376
376
|
function getCustomMergedLabels(labels) {
|
|
377
377
|
var _a;
|
|
378
|
-
if (labels ===
|
|
379
|
-
var globalLabels = ((_a = getAttrProcessor()) === null || _a ===
|
|
378
|
+
if (labels === void 0) { labels = {}; }
|
|
379
|
+
var globalLabels = ((_a = getAttrProcessor()) === null || _a === void 0 ? void 0 : _a.getCustomLabels()) || {};
|
|
380
380
|
return __assign(__assign({}, globalLabels), labels);
|
|
381
381
|
}
|
|
382
382
|
|
|
@@ -400,13 +400,13 @@ var ErrorSource;
|
|
|
400
400
|
ErrorSource["CAPTURED"] = "captured";
|
|
401
401
|
})(ErrorSource || (ErrorSource = {}));
|
|
402
402
|
function buildStacktrace(span, err) {
|
|
403
|
-
return __awaiter(this,
|
|
403
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
404
404
|
var stack, message, name, hasStack, supportMfe, stackFrames;
|
|
405
405
|
return __generator(this, function (_a) {
|
|
406
406
|
switch (_a.label) {
|
|
407
407
|
case 0:
|
|
408
408
|
stack = err.stack, message = err.message, name = err.name;
|
|
409
|
-
hasStack = !!(stack === null || stack ===
|
|
409
|
+
hasStack = !!(stack === null || stack === void 0 ? void 0 : stack.includes('at '));
|
|
410
410
|
if (!(err && hasStack)) return [3 /*break*/, 3];
|
|
411
411
|
supportMfe = getSdkConfig().supportMfe;
|
|
412
412
|
stackFrames = ErrorStackParser.parse({
|
|
@@ -436,7 +436,7 @@ function buildStacktrace(span, err) {
|
|
|
436
436
|
});
|
|
437
437
|
}
|
|
438
438
|
function handleMFE(stackFrames, span) {
|
|
439
|
-
return __awaiter(this,
|
|
439
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
440
440
|
var i, metadata, _a, lastFrame;
|
|
441
441
|
return __generator(this, function (_b) {
|
|
442
442
|
switch (_b.label) {
|
|
@@ -469,9 +469,9 @@ function addLabelForMFE(span, lastFrame) {
|
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
471
|
function extractMetadataFromMfeStacktrace() {
|
|
472
|
-
return __awaiter(this, arguments,
|
|
472
|
+
return __awaiter(this, arguments, void 0, function (fileName) {
|
|
473
473
|
var metadata, cachedMetadata, MFE_METADATA_KEY, _a, mfePath, response, _b, e_1;
|
|
474
|
-
if (fileName ===
|
|
474
|
+
if (fileName === void 0) { fileName = ''; }
|
|
475
475
|
return __generator(this, function (_c) {
|
|
476
476
|
switch (_c.label) {
|
|
477
477
|
case 0:
|
|
@@ -479,8 +479,8 @@ function extractMetadataFromMfeStacktrace() {
|
|
|
479
479
|
MFE_METADATA_KEY = 'cx-metadata.json';
|
|
480
480
|
_a = __read$1(fileName.match(/https?:\/\/.*\//), 1), mfePath = _a[0];
|
|
481
481
|
if (!mfePath) return [3 /*break*/, 7];
|
|
482
|
-
response =
|
|
483
|
-
if (!!(cachedMetadata === null || cachedMetadata ===
|
|
482
|
+
response = void 0;
|
|
483
|
+
if (!!(cachedMetadata === null || cachedMetadata === void 0 ? void 0 : cachedMetadata.has(mfePath))) return [3 /*break*/, 6];
|
|
484
484
|
_c.label = 1;
|
|
485
485
|
case 1:
|
|
486
486
|
_c.trys.push([1, 4, , 5]);
|
|
@@ -493,7 +493,7 @@ function extractMetadataFromMfeStacktrace() {
|
|
|
493
493
|
_b = [{}];
|
|
494
494
|
return [4 /*yield*/, response.json()];
|
|
495
495
|
case 3:
|
|
496
|
-
metadata = __assign.apply(
|
|
496
|
+
metadata = __assign.apply(void 0, [__assign.apply(void 0, _b.concat([(_c.sent())])), { mfePath: mfePath }]);
|
|
497
497
|
return [3 /*break*/, 5];
|
|
498
498
|
case 4:
|
|
499
499
|
e_1 = _c.sent();
|
|
@@ -505,7 +505,7 @@ function extractMetadataFromMfeStacktrace() {
|
|
|
505
505
|
CxGlobal[CACHED_METADATA_KEY] = cachedMetadata.set(mfePath, metadata);
|
|
506
506
|
return [3 /*break*/, 7];
|
|
507
507
|
case 6:
|
|
508
|
-
metadata = cachedMetadata === null || cachedMetadata ===
|
|
508
|
+
metadata = cachedMetadata === null || cachedMetadata === void 0 ? void 0 : cachedMetadata.get(mfePath);
|
|
509
509
|
_c.label = 7;
|
|
510
510
|
case 7: return [2 /*return*/, metadata];
|
|
511
511
|
}
|
|
@@ -549,7 +549,7 @@ var CoralogixErrorInstrumentation = /** @class */ (function (_super) {
|
|
|
549
549
|
var _this = _super.call(this, ERROR_INSTRUMENTATION_NAME, ERROR_INSTRUMENTATION_VERSION, config) || this;
|
|
550
550
|
_this.parseErrorObject = function (obj) {
|
|
551
551
|
var _a;
|
|
552
|
-
return (_a = obj === null || obj ===
|
|
552
|
+
return (_a = obj === null || obj === void 0 ? void 0 : obj.message) !== null && _a !== void 0 ? _a : JSON.stringify(obj, getCircularReplacer());
|
|
553
553
|
};
|
|
554
554
|
if (getSdkConfig().supportMfe) {
|
|
555
555
|
CxGlobal[CACHED_METADATA_KEY] = new Map();
|
|
@@ -607,7 +607,7 @@ var CoralogixErrorInstrumentation = /** @class */ (function (_super) {
|
|
|
607
607
|
}
|
|
608
608
|
};
|
|
609
609
|
CoralogixErrorInstrumentation.prototype.reportError = function (source, err, customData, labels) {
|
|
610
|
-
return __awaiter(this,
|
|
610
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
611
611
|
var message, name, span, cleanMessage;
|
|
612
612
|
return __generator(this, function (_a) {
|
|
613
613
|
switch (_a.label) {
|
|
@@ -635,7 +635,7 @@ var CoralogixErrorInstrumentation = /** @class */ (function (_super) {
|
|
|
635
635
|
});
|
|
636
636
|
};
|
|
637
637
|
CoralogixErrorInstrumentation.prototype.reportString = function (source, message, firstError) {
|
|
638
|
-
return __awaiter(this,
|
|
638
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
639
639
|
var span;
|
|
640
640
|
return __generator(this, function (_a) {
|
|
641
641
|
switch (_a.label) {
|
|
@@ -643,7 +643,7 @@ var CoralogixErrorInstrumentation = /** @class */ (function (_super) {
|
|
|
643
643
|
span = this.createSpan(source);
|
|
644
644
|
addErrorDefaultAttributes(span);
|
|
645
645
|
span.setAttribute(CoralogixAttributes.SOURCE, source);
|
|
646
|
-
span.setAttribute(ErrorAttributes.MESSAGE, message === null || message ===
|
|
646
|
+
span.setAttribute(ErrorAttributes.MESSAGE, message === null || message === void 0 ? void 0 : message.substring(0, MESSAGE_LIMIT));
|
|
647
647
|
if (!firstError) return [3 /*break*/, 2];
|
|
648
648
|
return [4 /*yield*/, buildStacktrace(span, firstError)];
|
|
649
649
|
case 1:
|
|
@@ -658,7 +658,7 @@ var CoralogixErrorInstrumentation = /** @class */ (function (_super) {
|
|
|
658
658
|
};
|
|
659
659
|
CoralogixErrorInstrumentation.prototype.reportErrorEvent = function (source, _a) {
|
|
660
660
|
var error = _a.error, message = _a.message;
|
|
661
|
-
var event = error !== null && error !==
|
|
661
|
+
var event = error !== null && error !== void 0 ? error : message;
|
|
662
662
|
this.report(source, event);
|
|
663
663
|
};
|
|
664
664
|
CoralogixErrorInstrumentation.prototype.reportEvent = function (source, ev) {
|
|
@@ -702,8 +702,8 @@ var CoralogixErrorInstrumentation = /** @class */ (function (_super) {
|
|
|
702
702
|
var propagateTraceHeaderCorsUrls = function (config) {
|
|
703
703
|
var _a;
|
|
704
704
|
var traceParentInHeader = config.traceParentInHeader;
|
|
705
|
-
var propagateCorsUrls = (_a = traceParentInHeader === null || traceParentInHeader ===
|
|
706
|
-
if ((traceParentInHeader === null || traceParentInHeader ===
|
|
705
|
+
var propagateCorsUrls = (_a = traceParentInHeader === null || traceParentInHeader === void 0 ? void 0 : traceParentInHeader.options) === null || _a === void 0 ? void 0 : _a.propagateTraceHeaderCorsUrls;
|
|
706
|
+
if ((traceParentInHeader === null || traceParentInHeader === void 0 ? void 0 : traceParentInHeader.enabled) && propagateCorsUrls) {
|
|
707
707
|
config.propagateTraceHeaderCorsUrls = propagateCorsUrls;
|
|
708
708
|
}
|
|
709
709
|
};
|
|
@@ -712,7 +712,7 @@ var NetworkDataManager = /** @class */ (function () {
|
|
|
712
712
|
function NetworkDataManager() {
|
|
713
713
|
var _this = this;
|
|
714
714
|
this.responseBodyParsers = new Map([
|
|
715
|
-
[MimeType.Json, function (body) { return __awaiter(_this,
|
|
715
|
+
[MimeType.Json, function (body) { return __awaiter(_this, void 0, void 0, function () { var _a, _b; return __generator(this, function (_c) {
|
|
716
716
|
switch (_c.label) {
|
|
717
717
|
case 0:
|
|
718
718
|
_b = (_a = JSON).stringify;
|
|
@@ -720,37 +720,37 @@ var NetworkDataManager = /** @class */ (function () {
|
|
|
720
720
|
case 1: return [2 /*return*/, _b.apply(_a, [_c.sent()])];
|
|
721
721
|
}
|
|
722
722
|
}); }); }],
|
|
723
|
-
[MimeType.TextPlain, function (body) { return __awaiter(_this,
|
|
723
|
+
[MimeType.TextPlain, function (body) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
724
724
|
switch (_a.label) {
|
|
725
725
|
case 0: return [4 /*yield*/, body.text()];
|
|
726
726
|
case 1: return [2 /*return*/, _a.sent()];
|
|
727
727
|
}
|
|
728
728
|
}); }); }],
|
|
729
|
-
[MimeType.TextHtml, function (body) { return __awaiter(_this,
|
|
729
|
+
[MimeType.TextHtml, function (body) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
730
730
|
switch (_a.label) {
|
|
731
731
|
case 0: return [4 /*yield*/, body.text()];
|
|
732
732
|
case 1: return [2 /*return*/, _a.sent()];
|
|
733
733
|
}
|
|
734
734
|
}); }); }],
|
|
735
|
-
[MimeType.TextCss, function (body) { return __awaiter(_this,
|
|
735
|
+
[MimeType.TextCss, function (body) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
736
736
|
switch (_a.label) {
|
|
737
737
|
case 0: return [4 /*yield*/, body.text()];
|
|
738
738
|
case 1: return [2 /*return*/, _a.sent()];
|
|
739
739
|
}
|
|
740
740
|
}); }); }],
|
|
741
|
-
[MimeType.TextJavascript, function (body) { return __awaiter(_this,
|
|
741
|
+
[MimeType.TextJavascript, function (body) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
742
742
|
switch (_a.label) {
|
|
743
743
|
case 0: return [4 /*yield*/, body.text()];
|
|
744
744
|
case 1: return [2 /*return*/, _a.sent()];
|
|
745
745
|
}
|
|
746
746
|
}); }); }],
|
|
747
|
-
[MimeType.Xml, function (body) { return __awaiter(_this,
|
|
747
|
+
[MimeType.Xml, function (body) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
748
748
|
switch (_a.label) {
|
|
749
749
|
case 0: return [4 /*yield*/, body.text()];
|
|
750
750
|
case 1: return [2 /*return*/, _a.sent()];
|
|
751
751
|
}
|
|
752
752
|
}); }); }],
|
|
753
|
-
[MimeType.FormData, function (body) { return __awaiter(_this,
|
|
753
|
+
[MimeType.FormData, function (body) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
754
754
|
switch (_a.label) {
|
|
755
755
|
case 0: return [4 /*yield*/, body.text()];
|
|
756
756
|
case 1: return [2 /*return*/, _a.sent()];
|
|
@@ -758,31 +758,31 @@ var NetworkDataManager = /** @class */ (function () {
|
|
|
758
758
|
}); }); }],
|
|
759
759
|
]);
|
|
760
760
|
this.requestBodySerializers = new Map([
|
|
761
|
-
[BodyType.String, function (body) { return __awaiter(_this,
|
|
761
|
+
[BodyType.String, function (body) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
762
762
|
return [2 /*return*/, body];
|
|
763
763
|
}); }); }],
|
|
764
|
-
[BodyType.Blob, function (body) { return __awaiter(_this,
|
|
764
|
+
[BodyType.Blob, function (body) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
765
765
|
return [2 /*return*/, body.text()];
|
|
766
766
|
}); }); }],
|
|
767
767
|
[
|
|
768
768
|
BodyType.FormData,
|
|
769
|
-
function (body) { return __awaiter(_this,
|
|
769
|
+
function (body) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
770
770
|
return [2 /*return*/, this.serializeFormData(body)];
|
|
771
771
|
}); }); },
|
|
772
772
|
],
|
|
773
773
|
[
|
|
774
774
|
BodyType.URLSearchParams,
|
|
775
|
-
function (body) { return __awaiter(_this,
|
|
775
|
+
function (body) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
776
776
|
return [2 /*return*/, body.toString()];
|
|
777
777
|
}); }); },
|
|
778
778
|
],
|
|
779
|
-
[BodyType.JsonObject, function (body) { return __awaiter(_this,
|
|
779
|
+
[BodyType.JsonObject, function (body) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
780
780
|
return [2 /*return*/, JSON.stringify(body)];
|
|
781
781
|
}); }); }],
|
|
782
782
|
]);
|
|
783
783
|
}
|
|
784
784
|
NetworkDataManager.prototype.resolveConfigForUrl = function (url, configs) {
|
|
785
|
-
if (configs ===
|
|
785
|
+
if (configs === void 0) { configs = []; }
|
|
786
786
|
return configs.find(function (_a) {
|
|
787
787
|
var configUrl = _a.url;
|
|
788
788
|
return configUrl === url ||
|
|
@@ -790,12 +790,12 @@ var NetworkDataManager = /** @class */ (function () {
|
|
|
790
790
|
});
|
|
791
791
|
};
|
|
792
792
|
NetworkDataManager.prototype.stringifyRequestBody = function (request) {
|
|
793
|
-
return __awaiter(this,
|
|
793
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
794
794
|
var bodyContent;
|
|
795
795
|
return __generator(this, function (_a) {
|
|
796
796
|
switch (_a.label) {
|
|
797
797
|
case 0:
|
|
798
|
-
if (!(request === null || request ===
|
|
798
|
+
if (!(request === null || request === void 0 ? void 0 : request.body))
|
|
799
799
|
return [2 /*return*/, ''];
|
|
800
800
|
return [4 /*yield*/, this.serializeRequestBody(request.body)];
|
|
801
801
|
case 1:
|
|
@@ -806,7 +806,7 @@ var NetworkDataManager = /** @class */ (function () {
|
|
|
806
806
|
});
|
|
807
807
|
};
|
|
808
808
|
NetworkDataManager.prototype.stringifyResponseBody = function (response) {
|
|
809
|
-
return __awaiter(this,
|
|
809
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
810
810
|
var contentType, mimeType, parser, parsedContent;
|
|
811
811
|
return __generator(this, function (_a) {
|
|
812
812
|
switch (_a.label) {
|
|
@@ -828,7 +828,7 @@ var NetworkDataManager = /** @class */ (function () {
|
|
|
828
828
|
return content.length > MAX_CHARACTERS ? undefined : content;
|
|
829
829
|
};
|
|
830
830
|
NetworkDataManager.prototype.serializeRequestBody = function (body) {
|
|
831
|
-
return __awaiter(this,
|
|
831
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
832
832
|
var handler, _a;
|
|
833
833
|
return __generator(this, function (_b) {
|
|
834
834
|
switch (_b.label) {
|
|
@@ -880,7 +880,7 @@ var HeadersManager = /** @class */ (function () {
|
|
|
880
880
|
function HeadersManager() {
|
|
881
881
|
}
|
|
882
882
|
HeadersManager.prototype.filterHeaders = function (headersInit, allowedKeys) {
|
|
883
|
-
if (allowedKeys ===
|
|
883
|
+
if (allowedKeys === void 0) { allowedKeys = []; }
|
|
884
884
|
if (!headersInit) {
|
|
885
885
|
return new Map();
|
|
886
886
|
}
|
|
@@ -958,7 +958,7 @@ var CoralogixFetchInstrumentation = /** @class */ (function (_super) {
|
|
|
958
958
|
return _this;
|
|
959
959
|
}
|
|
960
960
|
CoralogixFetchInstrumentation.prototype.setNetworkSpanAttributes = function (span, request, response) {
|
|
961
|
-
return __awaiter(this,
|
|
961
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
962
962
|
var status, networkExtraConfig, url, resolvedConfig;
|
|
963
963
|
var _a;
|
|
964
964
|
return __generator(this, function (_b) {
|
|
@@ -991,7 +991,7 @@ var CoralogixFetchInstrumentation = /** @class */ (function (_super) {
|
|
|
991
991
|
});
|
|
992
992
|
};
|
|
993
993
|
CoralogixFetchInstrumentation.prototype.setRequestAttributes = function (span, request, networkExtraConfig) {
|
|
994
|
-
return __awaiter(this,
|
|
994
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
995
995
|
var reqHeaders, collectReqPayload, requestPayload, _a, sanitizedHeaders, error_1;
|
|
996
996
|
return __generator(this, function (_b) {
|
|
997
997
|
switch (_b.label) {
|
|
@@ -1010,12 +1010,12 @@ var CoralogixFetchInstrumentation = /** @class */ (function (_super) {
|
|
|
1010
1010
|
_b.label = 4;
|
|
1011
1011
|
case 4:
|
|
1012
1012
|
requestPayload = _a;
|
|
1013
|
-
sanitizedHeaders = (reqHeaders === null || reqHeaders ===
|
|
1013
|
+
sanitizedHeaders = (reqHeaders === null || reqHeaders === void 0 ? void 0 : reqHeaders.length)
|
|
1014
1014
|
? this.headersManager.filterHeaders(request.headers, reqHeaders)
|
|
1015
1015
|
: undefined;
|
|
1016
1016
|
if (requestPayload)
|
|
1017
1017
|
span[NetworkInstrumentationAttributes.REQUEST_PAYLOAD] = requestPayload;
|
|
1018
|
-
if (sanitizedHeaders === null || sanitizedHeaders ===
|
|
1018
|
+
if (sanitizedHeaders === null || sanitizedHeaders === void 0 ? void 0 : sanitizedHeaders.size) {
|
|
1019
1019
|
span[NetworkInstrumentationAttributes.REQUEST_HEADERS] =
|
|
1020
1020
|
Object.fromEntries(sanitizedHeaders);
|
|
1021
1021
|
}
|
|
@@ -1032,7 +1032,7 @@ var CoralogixFetchInstrumentation = /** @class */ (function (_super) {
|
|
|
1032
1032
|
});
|
|
1033
1033
|
};
|
|
1034
1034
|
CoralogixFetchInstrumentation.prototype.setResponseAttributes = function (span, result, networkExtraConfig) {
|
|
1035
|
-
return __awaiter(this,
|
|
1035
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1036
1036
|
var resHeaders, collectResPayload, responsePayload, _a, sanitizedHeaders, error_2;
|
|
1037
1037
|
return __generator(this, function (_b) {
|
|
1038
1038
|
switch (_b.label) {
|
|
@@ -1052,14 +1052,14 @@ var CoralogixFetchInstrumentation = /** @class */ (function (_super) {
|
|
|
1052
1052
|
_b.label = 4;
|
|
1053
1053
|
case 4:
|
|
1054
1054
|
responsePayload = _a;
|
|
1055
|
-
sanitizedHeaders = (resHeaders === null || resHeaders ===
|
|
1055
|
+
sanitizedHeaders = (resHeaders === null || resHeaders === void 0 ? void 0 : resHeaders.length)
|
|
1056
1056
|
? this.headersManager.filterHeaders(result.headers, resHeaders)
|
|
1057
1057
|
: undefined;
|
|
1058
1058
|
if (responsePayload) {
|
|
1059
1059
|
span[NetworkInstrumentationAttributes.RESPONSE_PAYLOAD] =
|
|
1060
1060
|
responsePayload;
|
|
1061
1061
|
}
|
|
1062
|
-
if (sanitizedHeaders === null || sanitizedHeaders ===
|
|
1062
|
+
if (sanitizedHeaders === null || sanitizedHeaders === void 0 ? void 0 : sanitizedHeaders.size) {
|
|
1063
1063
|
span[NetworkInstrumentationAttributes.RESPONSE_HEADERS] =
|
|
1064
1064
|
Object.fromEntries(sanitizedHeaders);
|
|
1065
1065
|
}
|
|
@@ -1118,13 +1118,13 @@ var CoralogixXhrInstrumentation = /** @class */ (function (_super) {
|
|
|
1118
1118
|
var responsePayload = collectResPayload
|
|
1119
1119
|
? this.networkDataManager.truncateIfExceedsLimit(xhr.responseText)
|
|
1120
1120
|
: undefined;
|
|
1121
|
-
var sanitizedHeaders = (resHeaders === null || resHeaders ===
|
|
1121
|
+
var sanitizedHeaders = (resHeaders === null || resHeaders === void 0 ? void 0 : resHeaders.length)
|
|
1122
1122
|
? this.headersManager.filterHeaders(xhr.getAllResponseHeaders(), resHeaders)
|
|
1123
1123
|
: undefined;
|
|
1124
1124
|
if (responsePayload) {
|
|
1125
1125
|
span[NetworkInstrumentationAttributes.RESPONSE_PAYLOAD] = responsePayload;
|
|
1126
1126
|
}
|
|
1127
|
-
if (sanitizedHeaders === null || sanitizedHeaders ===
|
|
1127
|
+
if (sanitizedHeaders === null || sanitizedHeaders === void 0 ? void 0 : sanitizedHeaders.size) {
|
|
1128
1128
|
span[NetworkInstrumentationAttributes.RESPONSE_HEADERS] =
|
|
1129
1129
|
Object.fromEntries(sanitizedHeaders);
|
|
1130
1130
|
}
|
|
@@ -1142,13 +1142,14 @@ var CoralogixCustomLogInstrumentation = /** @class */ (function (_super) {
|
|
|
1142
1142
|
function CoralogixCustomLogInstrumentation(config) {
|
|
1143
1143
|
var _a;
|
|
1144
1144
|
var _this = _super.call(this, CoralogixEventType.LOG, CUSTOM_INSTRUMENTATION_VERSION, config) || this;
|
|
1145
|
-
_this.stringifyCustomLogData = (_a = getSdkConfig()) === null || _a ===
|
|
1145
|
+
_this.stringifyCustomLogData = (_a = getSdkConfig()) === null || _a === void 0 ? void 0 : _a.stringifyCustomLogData;
|
|
1146
1146
|
return _this;
|
|
1147
1147
|
}
|
|
1148
1148
|
CoralogixCustomLogInstrumentation.prototype.init = function () { };
|
|
1149
1149
|
CoralogixCustomLogInstrumentation.prototype.disable = function () { };
|
|
1150
1150
|
CoralogixCustomLogInstrumentation.prototype.enable = function () { };
|
|
1151
|
-
CoralogixCustomLogInstrumentation.prototype.log = function (
|
|
1151
|
+
CoralogixCustomLogInstrumentation.prototype.log = function (_a) {
|
|
1152
|
+
var severity = _a.severity, message = _a.message, data = _a.data, labels = _a.labels;
|
|
1152
1153
|
var span = this.tracer.startSpan(CoralogixEventType.LOG);
|
|
1153
1154
|
span.setAttribute(CoralogixAttributes.EVENT_TYPE, CoralogixEventType.LOG);
|
|
1154
1155
|
span.setAttribute(CoralogixAttributes.SOURCE, LogSource.CODE);
|
|
@@ -1160,6 +1161,9 @@ var CoralogixCustomLogInstrumentation = /** @class */ (function (_super) {
|
|
|
1160
1161
|
? JSON.stringify(data, getCircularReplacer())
|
|
1161
1162
|
: data,
|
|
1162
1163
|
}));
|
|
1164
|
+
if (labels) {
|
|
1165
|
+
setCustomLabelsForSpan(span, labels);
|
|
1166
|
+
}
|
|
1163
1167
|
span.end();
|
|
1164
1168
|
};
|
|
1165
1169
|
return CoralogixCustomLogInstrumentation;
|
|
@@ -1203,7 +1207,7 @@ function isObject(value) {
|
|
|
1203
1207
|
* @returns Returns a new object with the specified paths omitted.
|
|
1204
1208
|
*/
|
|
1205
1209
|
function omit(object) {
|
|
1206
|
-
if (object ===
|
|
1210
|
+
if (object === void 0) { object = {}; }
|
|
1207
1211
|
var paths = [];
|
|
1208
1212
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
1209
1213
|
paths[_i - 1] = arguments[_i];
|
|
@@ -1603,7 +1607,7 @@ function observeIfSupported(observer, entryType) {
|
|
|
1603
1607
|
}
|
|
1604
1608
|
function isPerformanceObserverSupported() {
|
|
1605
1609
|
var _a;
|
|
1606
|
-
if (!((_a = CxGlobal === null || CxGlobal ===
|
|
1610
|
+
if (!((_a = CxGlobal === null || CxGlobal === void 0 ? void 0 : CxGlobal.PerformanceObserver) === null || _a === void 0 ? void 0 : _a.supportedEntryTypes)) {
|
|
1607
1611
|
console.warn('Coralogix Browser SDK - browser does not support the required APIs ');
|
|
1608
1612
|
return false;
|
|
1609
1613
|
}
|
|
@@ -1767,7 +1771,7 @@ var CoralogixWebVitalsInstrumentation = /** @class */ (function (_super) {
|
|
|
1767
1771
|
name: 'TBT',
|
|
1768
1772
|
id: generateWebVitalUniqueID(),
|
|
1769
1773
|
rating: rateForTBTMetricValue(totalBlockingTime),
|
|
1770
|
-
value: ((_a = tbtMetric === null || tbtMetric ===
|
|
1774
|
+
value: ((_a = tbtMetric === null || tbtMetric === void 0 ? void 0 : tbtMetric.value) !== null && _a !== void 0 ? _a : 0) + totalBlockingTime,
|
|
1771
1775
|
};
|
|
1772
1776
|
});
|
|
1773
1777
|
this.observers.push(totalBLockingTimeObserver);
|
|
@@ -1782,7 +1786,7 @@ var CoralogixWebVitalsInstrumentation = /** @class */ (function (_super) {
|
|
|
1782
1786
|
id: generateWebVitalUniqueID(),
|
|
1783
1787
|
});
|
|
1784
1788
|
totalBLockingTimeObserver.disconnect();
|
|
1785
|
-
(_b = (_a = CxGlobal.__tti) === null || _a ===
|
|
1789
|
+
(_b = (_a = CxGlobal.__tti) === null || _a === void 0 ? void 0 : _a.o) === null || _b === void 0 ? void 0 : _b.disconnect();
|
|
1786
1790
|
}
|
|
1787
1791
|
});
|
|
1788
1792
|
};
|
|
@@ -1833,7 +1837,7 @@ var CoralogixLongTaskInstrumentation = /** @class */ (function (_super) {
|
|
|
1833
1837
|
CoralogixLongTaskInstrumentation.prototype.enable = function () { };
|
|
1834
1838
|
CoralogixLongTaskInstrumentation.prototype.disable = function () {
|
|
1835
1839
|
var _a;
|
|
1836
|
-
(_a = this.longTaskObserver) === null || _a ===
|
|
1840
|
+
(_a = this.longTaskObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
1837
1841
|
};
|
|
1838
1842
|
CoralogixLongTaskInstrumentation.prototype.init = function () { };
|
|
1839
1843
|
return CoralogixLongTaskInstrumentation;
|
|
@@ -1882,7 +1886,7 @@ var CoralogixResourcesInstrumentation = /** @class */ (function (_super) {
|
|
|
1882
1886
|
function CoralogixResourcesInstrumentation(config) {
|
|
1883
1887
|
var _a;
|
|
1884
1888
|
var _this = _super.call(this, RESOURCES_INSTRUMENTATION_NAME, RESOURCES_INSTRUMENTATION_VERSION, config) || this;
|
|
1885
|
-
_this.ignoreUrls = (_a = getSdkConfig()) === null || _a ===
|
|
1889
|
+
_this.ignoreUrls = (_a = getSdkConfig()) === null || _a === void 0 ? void 0 : _a.ignoreUrls;
|
|
1886
1890
|
if (supportedPerformanceTypes.has(PerformanceTypes.Resource)) {
|
|
1887
1891
|
_this.registerToResources();
|
|
1888
1892
|
}
|
|
@@ -1914,7 +1918,7 @@ var CoralogixResourcesInstrumentation = /** @class */ (function (_super) {
|
|
|
1914
1918
|
};
|
|
1915
1919
|
CoralogixResourcesInstrumentation.prototype.isResourceIgnored = function (resourceName) {
|
|
1916
1920
|
var _a;
|
|
1917
|
-
if (!resourceName || !((_a = this.ignoreUrls) === null || _a ===
|
|
1921
|
+
if (!resourceName || !((_a = this.ignoreUrls) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
1918
1922
|
return false;
|
|
1919
1923
|
}
|
|
1920
1924
|
return isPatternMatch(resourceName, this.ignoreUrls, 'ignoreUrls');
|
|
@@ -1962,14 +1966,14 @@ var CoralogixResourcesInstrumentation = /** @class */ (function (_super) {
|
|
|
1962
1966
|
var _a;
|
|
1963
1967
|
var resourceSpan = this.tracer.startSpan(RESOURCES_INSTRUMENTATION_NAME);
|
|
1964
1968
|
resourceSpan.setAttribute(CoralogixAttributes.EVENT_TYPE, CoralogixEventType.RESOURCES);
|
|
1965
|
-
var newEntry = __assign(__assign({}, deepClone(entry)), { name: (_a = entry.name) === null || _a ===
|
|
1969
|
+
var newEntry = __assign(__assign({}, deepClone(entry)), { name: (_a = entry.name) === null || _a === void 0 ? void 0 : _a.slice(0, MAX_CHARACTERS) });
|
|
1966
1970
|
resourceSpan.setAttribute(RESOURCES_INSTRUMENTATION_NAME, JSON.stringify(newEntry));
|
|
1967
1971
|
resourceSpan.end();
|
|
1968
1972
|
};
|
|
1969
1973
|
CoralogixResourcesInstrumentation.prototype.enable = function () { };
|
|
1970
1974
|
CoralogixResourcesInstrumentation.prototype.disable = function () {
|
|
1971
1975
|
var _a;
|
|
1972
|
-
(_a = this.resourcesObserver) === null || _a ===
|
|
1976
|
+
(_a = this.resourcesObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
1973
1977
|
};
|
|
1974
1978
|
CoralogixResourcesInstrumentation.prototype.init = function () { };
|
|
1975
1979
|
return CoralogixResourcesInstrumentation;
|
|
@@ -1995,7 +1999,7 @@ function getZoneJsOriginalDom(target, name) {
|
|
|
1995
1999
|
* Add event listeners to an event target object.
|
|
1996
2000
|
*/
|
|
1997
2001
|
function addEventListeners(eventTarget, eventNames, listener, _a) {
|
|
1998
|
-
var _b = _a ===
|
|
2002
|
+
var _b = _a === void 0 ? {} : _a, once = _b.once, capture = _b.capture, passive = _b.passive;
|
|
1999
2003
|
var resolvedListener = once
|
|
2000
2004
|
? function (event) {
|
|
2001
2005
|
stop();
|
|
@@ -2048,7 +2052,7 @@ function getMaskedOrTextualContent(element, config) {
|
|
|
2048
2052
|
return getTextualContent(element);
|
|
2049
2053
|
}
|
|
2050
2054
|
function isParentMasked(element, maskClass, maxDepth) {
|
|
2051
|
-
if (maxDepth ===
|
|
2055
|
+
if (maxDepth === void 0) { maxDepth = PARENT_SEARCH_DEPTH; }
|
|
2052
2056
|
if (!element || maxDepth <= 0) {
|
|
2053
2057
|
return false;
|
|
2054
2058
|
}
|
|
@@ -2131,7 +2135,7 @@ var CoralogixUserInteractionInstrumentation = /** @class */ (function (_super) {
|
|
|
2131
2135
|
[CoralogixAttributes.TARGET_ELEMENT_TYPE, type],
|
|
2132
2136
|
[
|
|
2133
2137
|
CoralogixAttributes.ELEMENT_INNER_TEXT,
|
|
2134
|
-
elementText === null || elementText ===
|
|
2138
|
+
elementText === null || elementText === void 0 ? void 0 : elementText.slice(0, MAX_INTERACTION_ELEMENT_SIZE),
|
|
2135
2139
|
],
|
|
2136
2140
|
[CoralogixAttributes.TARGET_ELEMENT, nodeName],
|
|
2137
2141
|
].forEach(function (_a) {
|
|
@@ -2141,7 +2145,7 @@ var CoralogixUserInteractionInstrumentation = /** @class */ (function (_super) {
|
|
|
2141
2145
|
}
|
|
2142
2146
|
span.end();
|
|
2143
2147
|
};
|
|
2144
|
-
var eventsMap = __assign(__assign({}, DEFAULT_INSTRUMENTED_EVENTS), (_a = this._config) === null || _a ===
|
|
2148
|
+
var eventsMap = __assign(__assign({}, DEFAULT_INSTRUMENTED_EVENTS), (_a = this._config) === null || _a === void 0 ? void 0 : _a['events']);
|
|
2145
2149
|
var eventNames = Object.entries(eventsMap)
|
|
2146
2150
|
.filter(function (_a) {
|
|
2147
2151
|
var _b = __read$1(_a, 2); _b[0]; var enabled = _b[1];
|
|
@@ -2230,7 +2234,7 @@ var CoralogixMemoryUsageInstrumentation = /** @class */ (function (_super) {
|
|
|
2230
2234
|
this.createMemorySample().then(function () { return _this.runMemoryMeasurements(); });
|
|
2231
2235
|
};
|
|
2232
2236
|
CoralogixMemoryUsageInstrumentation.prototype.createMemorySample = function () {
|
|
2233
|
-
return __awaiter(this,
|
|
2237
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2234
2238
|
var memoryUsage, memoryUsageEntries, memoryUsageEntries_1, memoryUsageEntries_1_1, entry, memoryUsageSpan, error_1;
|
|
2235
2239
|
var e_1, _a;
|
|
2236
2240
|
return __generator(this, function (_b) {
|
|
@@ -2274,7 +2278,7 @@ var CoralogixMemoryUsageInstrumentation = /** @class */ (function (_super) {
|
|
|
2274
2278
|
this.timeoutId = setTimeout(function () { return _this.measureMemoryUsage(); }, this.memoryUsageInterval);
|
|
2275
2279
|
};
|
|
2276
2280
|
CoralogixMemoryUsageInstrumentation.prototype.measureMemoryUsage = function () {
|
|
2277
|
-
return __awaiter(this,
|
|
2281
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2278
2282
|
return __generator(this, function (_a) {
|
|
2279
2283
|
switch (_a.label) {
|
|
2280
2284
|
case 0: return [4 /*yield*/, this.createMemorySample()];
|
|
@@ -2393,7 +2397,7 @@ var CoralogixInternalInstrumentation = /** @class */ (function (_super) {
|
|
|
2393
2397
|
CoralogixInternalInstrumentation.prototype.disable = function () { };
|
|
2394
2398
|
CoralogixInternalInstrumentation.prototype.enable = function () { };
|
|
2395
2399
|
CoralogixInternalInstrumentation.prototype.reportInternalEvent = function (event, message) {
|
|
2396
|
-
if (message ===
|
|
2400
|
+
if (message === void 0) { message = ''; }
|
|
2397
2401
|
var span = this.tracer.startSpan(CoralogixEventType.INTERNAL);
|
|
2398
2402
|
var data;
|
|
2399
2403
|
span.setAttribute(CoralogixAttributes.EVENT_TYPE, CoralogixEventType.INTERNAL);
|
|
@@ -2638,11 +2642,11 @@ function saveInternalRumData(key, value) {
|
|
|
2638
2642
|
}
|
|
2639
2643
|
function getInternalRumData(key) {
|
|
2640
2644
|
var _a;
|
|
2641
|
-
return (_a = CxGlobal[RUM_INTERNAL_DATA_KEY]) === null || _a ===
|
|
2645
|
+
return (_a = CxGlobal[RUM_INTERNAL_DATA_KEY]) === null || _a === void 0 ? void 0 : _a[key];
|
|
2642
2646
|
}
|
|
2643
2647
|
|
|
2644
2648
|
var _a$1;
|
|
2645
|
-
var supportedPerformanceTypes = !((_a$1 = CxGlobal === null || CxGlobal ===
|
|
2649
|
+
var supportedPerformanceTypes = !((_a$1 = CxGlobal === null || CxGlobal === void 0 ? void 0 : CxGlobal.PerformanceObserver) === null || _a$1 === void 0 ? void 0 : _a$1.supportedEntryTypes)
|
|
2646
2650
|
? new Set()
|
|
2647
2651
|
: new Set(CxGlobal.PerformanceObserver.supportedEntryTypes);
|
|
2648
2652
|
function valueEndWithOrInclude(value, extensions) {
|
|
@@ -2655,7 +2659,7 @@ function getInstrumentationConfig(value, defaults, defaultDisable) {
|
|
|
2655
2659
|
if (value === undefined && defaultDisable) {
|
|
2656
2660
|
return false;
|
|
2657
2661
|
}
|
|
2658
|
-
if ((value === null || value ===
|
|
2662
|
+
if ((value === null || value === void 0 ? void 0 : value.enabled) === false) {
|
|
2659
2663
|
return false;
|
|
2660
2664
|
}
|
|
2661
2665
|
return Object.assign({}, defaults, value);
|
|
@@ -2675,9 +2679,9 @@ var getUrlFragments = function (url) {
|
|
|
2675
2679
|
if (!url) {
|
|
2676
2680
|
return '';
|
|
2677
2681
|
}
|
|
2678
|
-
var withoutProtocol = ((_a = url.split(PROTOCOL_SEPARATOR)) === null || _a ===
|
|
2679
|
-
var startPath = (_b = withoutProtocol.split(BASE_PATH)) === null || _b ===
|
|
2680
|
-
if (startPath === null || startPath ===
|
|
2682
|
+
var withoutProtocol = ((_a = url.split(PROTOCOL_SEPARATOR)) === null || _a === void 0 ? void 0 : _a[1]) || url;
|
|
2683
|
+
var startPath = (_b = withoutProtocol.split(BASE_PATH)) === null || _b === void 0 ? void 0 : _b[1];
|
|
2684
|
+
if (startPath === null || startPath === void 0 ? void 0 : startPath.startsWith(HASH_SEPARATOR)) {
|
|
2681
2685
|
var fragments = withoutProtocol.split(HASH_SEPARATOR)[1];
|
|
2682
2686
|
var cleanedFragments = fragments.split(PARAMS_SEPARATOR)[0];
|
|
2683
2687
|
var pathFragments = cleanedFragments.split(BASE_PATH);
|
|
@@ -2855,14 +2859,14 @@ function replacePatternsInUrl(_a) {
|
|
|
2855
2859
|
function applyUrlBluePrinters(_a) {
|
|
2856
2860
|
var url = _a.url, blueprinters = _a.blueprinters;
|
|
2857
2861
|
var blueprintedUrl = url;
|
|
2858
|
-
blueprinters === null || blueprinters ===
|
|
2862
|
+
blueprinters === null || blueprinters === void 0 ? void 0 : blueprinters.forEach(function (urlBlueprinter) { return (blueprintedUrl = urlBlueprinter(blueprintedUrl)); });
|
|
2859
2863
|
return blueprintedUrl;
|
|
2860
2864
|
}
|
|
2861
2865
|
function resolvePageContext(url) {
|
|
2862
2866
|
var _a;
|
|
2863
2867
|
var page_url_blueprint = applyUrlBluePrinters({
|
|
2864
2868
|
url: url,
|
|
2865
|
-
blueprinters: (_a = getSdkConfig().urlBlueprinters) === null || _a ===
|
|
2869
|
+
blueprinters: (_a = getSdkConfig().urlBlueprinters) === null || _a === void 0 ? void 0 : _a.pageUrlBlueprinters,
|
|
2866
2870
|
});
|
|
2867
2871
|
var page_fragments = getUrlFragments(page_url_blueprint);
|
|
2868
2872
|
return {
|
|
@@ -2911,7 +2915,7 @@ var CoralogixSpanAttributesProcessor = /** @class */ (function () {
|
|
|
2911
2915
|
}
|
|
2912
2916
|
}
|
|
2913
2917
|
CoralogixSpanAttributesProcessor.prototype.setCustomLabels = function (labels) {
|
|
2914
|
-
this.labels[CoralogixAttributes.CUSTOM_LABELS] = JSON.stringify(labels !== null && labels !==
|
|
2918
|
+
this.labels[CoralogixAttributes.CUSTOM_LABELS] = JSON.stringify(labels !== null && labels !== void 0 ? labels : {});
|
|
2915
2919
|
};
|
|
2916
2920
|
CoralogixSpanAttributesProcessor.prototype.setInternalLabels = function (labels) {
|
|
2917
2921
|
var _a;
|
|
@@ -3169,7 +3173,7 @@ var __values = (undefined && undefined.__values) || function(o) {
|
|
|
3169
3173
|
if (m) return m.call(o);
|
|
3170
3174
|
if (o && typeof o.length === "number") return {
|
|
3171
3175
|
next: function () {
|
|
3172
|
-
if (o && i >= o.length) o =
|
|
3176
|
+
if (o && i >= o.length) o = void 0;
|
|
3173
3177
|
return { value: o && o[i++], done: !o };
|
|
3174
3178
|
}
|
|
3175
3179
|
};
|
|
@@ -3183,9 +3187,9 @@ var CompositePropagator = /** @class */ (function () {
|
|
|
3183
3187
|
* @param [config] Configuration object for composite propagator
|
|
3184
3188
|
*/
|
|
3185
3189
|
function CompositePropagator(config) {
|
|
3186
|
-
if (config ===
|
|
3190
|
+
if (config === void 0) { config = {}; }
|
|
3187
3191
|
var _a;
|
|
3188
|
-
this._propagators = (_a = config.propagators) !== null && _a !==
|
|
3192
|
+
this._propagators = (_a = config.propagators) !== null && _a !== void 0 ? _a : [];
|
|
3189
3193
|
this._fields = Array.from(new Set(this._propagators
|
|
3190
3194
|
// older propagators may not have fields function, null check to be sure
|
|
3191
3195
|
.map(function (p) { return (typeof p.fields === 'function' ? p.fields() : []); })
|
|
@@ -3492,9 +3496,6 @@ var MAX_MS_RECORD_TIME = 60000;
|
|
|
3492
3496
|
var DEFAULT_RUM_EVENTS = 5000;
|
|
3493
3497
|
var DEFAULT_MS_RECORD_TIME = 10000;
|
|
3494
3498
|
({
|
|
3495
|
-
enable: true,
|
|
3496
|
-
maxRumEvents: DEFAULT_RUM_EVENTS,
|
|
3497
|
-
maxRecordTime: DEFAULT_MS_RECORD_TIME,
|
|
3498
3499
|
instrumentationsToSend: (_a = {},
|
|
3499
3500
|
_a[CoralogixEventType.WEB_VITALS] = true,
|
|
3500
3501
|
_a),
|
|
@@ -3562,7 +3563,7 @@ function resolveSessionWithErrorsConfig(config) {
|
|
|
3562
3563
|
if (!config) {
|
|
3563
3564
|
return { enable: false };
|
|
3564
3565
|
}
|
|
3565
|
-
return __assign(__assign({}, config), { maxRumEvents: resolveMaxRumEvents(config.maxRumEvents), maxRecordTime: resolveMaxRecordTime(config.maxRecordTime), instrumentationsToSend: (_b = config.instrumentationsToSend) !== null && _b !==
|
|
3566
|
+
return __assign(__assign({}, config), { maxRumEvents: resolveMaxRumEvents(config.maxRumEvents), maxRecordTime: resolveMaxRecordTime(config.maxRecordTime), instrumentationsToSend: (_b = config.instrumentationsToSend) !== null && _b !== void 0 ? _b : (_a = {},
|
|
3566
3567
|
_a[CoralogixEventType.WEB_VITALS] = true,
|
|
3567
3568
|
_a) });
|
|
3568
3569
|
}
|
|
@@ -3571,12 +3572,12 @@ function resolveSessionConfig(config) {
|
|
|
3571
3572
|
if (!config) {
|
|
3572
3573
|
return DEFAULT_SESSION_CONFIG;
|
|
3573
3574
|
}
|
|
3574
|
-
return __assign(__assign({}, config), { sessionSampleRate: (_a = config.sessionSampleRate) !== null && _a !==
|
|
3575
|
+
return __assign(__assign({}, config), { sessionSampleRate: (_a = config.sessionSampleRate) !== null && _a !== void 0 ? _a : 100, onlyWithErrorConfig: resolveSessionWithErrorsConfig(config.onlyWithErrorConfig) });
|
|
3575
3576
|
}
|
|
3576
3577
|
function resolveSessionRecordingConfig(config) {
|
|
3577
3578
|
var _a;
|
|
3578
3579
|
if (config) {
|
|
3579
|
-
return __assign(__assign({}, config), { sessionRecordingSampleRate: (_a = config.sessionRecordingSampleRate) !== null && _a !==
|
|
3580
|
+
return __assign(__assign({}, config), { sessionRecordingSampleRate: (_a = config.sessionRecordingSampleRate) !== null && _a !== void 0 ? _a : 100 });
|
|
3580
3581
|
}
|
|
3581
3582
|
return;
|
|
3582
3583
|
}
|
|
@@ -3595,7 +3596,7 @@ function getResolvedSampler(resolvedOptions) {
|
|
|
3595
3596
|
!isSamplingOn(sessionSampleRate) ||
|
|
3596
3597
|
!isSamplingOn(sessionConfig.sessionSampleRate);
|
|
3597
3598
|
if (shouldNotTrackSession) {
|
|
3598
|
-
var shouldAlwaysTrackSessionsWithErrors = sessionConfig === null || sessionConfig ===
|
|
3599
|
+
var shouldAlwaysTrackSessionsWithErrors = sessionConfig === null || sessionConfig === void 0 ? void 0 : sessionConfig.alwaysTrackSessionsWithErrors;
|
|
3599
3600
|
if (shouldAlwaysTrackSessionsWithErrors) {
|
|
3600
3601
|
sessionConfig.onlyWithErrorConfig = __assign(__assign({}, sessionConfig.onlyWithErrorConfig), { enable: true });
|
|
3601
3602
|
}
|
|
@@ -3616,7 +3617,7 @@ function getResolvedSampler(resolvedOptions) {
|
|
|
3616
3617
|
|
|
3617
3618
|
function isProcessorShouldStop(isActive) {
|
|
3618
3619
|
var _a;
|
|
3619
|
-
return !isActive || !!((_a = getSessionManager()) === null || _a ===
|
|
3620
|
+
return !isActive || !!((_a = getSessionManager()) === null || _a === void 0 ? void 0 : _a.isIdleActive);
|
|
3620
3621
|
}
|
|
3621
3622
|
|
|
3622
3623
|
var CoralogixExporter = /** @class */ (function () {
|
|
@@ -3630,7 +3631,7 @@ var CoralogixExporter = /** @class */ (function () {
|
|
|
3630
3631
|
});
|
|
3631
3632
|
this.batchTimeDelay = BATCH_TIME_DELAY;
|
|
3632
3633
|
this.invokeLogRequest = function (logs, markCachedLogsSent) {
|
|
3633
|
-
if (logs === null || logs ===
|
|
3634
|
+
if (logs === null || logs === void 0 ? void 0 : logs.length) {
|
|
3634
3635
|
_this.request
|
|
3635
3636
|
.send(JSON.stringify({
|
|
3636
3637
|
logs: logs,
|
|
@@ -3730,7 +3731,7 @@ var SessionIdle = /** @class */ (function () {
|
|
|
3730
3731
|
this.stopCallbacks = {};
|
|
3731
3732
|
this.resetTimeout = function () {
|
|
3732
3733
|
var _a, _b;
|
|
3733
|
-
(_b = (_a = _this.stopCallbacks).clearTimeout) === null || _b ===
|
|
3734
|
+
(_b = (_a = _this.stopCallbacks).clearTimeout) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
3734
3735
|
var id = setTimeout(function () {
|
|
3735
3736
|
_this._isIdleActive = true;
|
|
3736
3737
|
_this.idleConfig.onIdle();
|
|
@@ -3761,7 +3762,7 @@ var SessionIdle = /** @class */ (function () {
|
|
|
3761
3762
|
};
|
|
3762
3763
|
SessionIdle.prototype.trackActivity = function () {
|
|
3763
3764
|
var _a, _b;
|
|
3764
|
-
(_b = (_a = this.stopCallbacks).removeActivityListeners) === null || _b ===
|
|
3765
|
+
(_b = (_a = this.stopCallbacks).removeActivityListeners) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
3765
3766
|
if (typeof CxGlobal.addEventListener === 'function') {
|
|
3766
3767
|
var stop_1 = addEventListeners(CxGlobal, ["touchstart" /* DOM_EVENT.TOUCH_START */, "keydown" /* DOM_EVENT.KEY_DOWN */, "mousemove" /* DOM_EVENT.MOUSE_MOVE */], this.idlenessEventsHandler, { capture: true, passive: true }).stop;
|
|
3767
3768
|
this.stopCallbacks.removeActivityListeners = stop_1;
|
|
@@ -3773,6 +3774,7 @@ var SessionIdle = /** @class */ (function () {
|
|
|
3773
3774
|
var SessionManager = /** @class */ (function (_super) {
|
|
3774
3775
|
__extends(SessionManager, _super);
|
|
3775
3776
|
function SessionManager(recordConfig) {
|
|
3777
|
+
var _a;
|
|
3776
3778
|
var _this = _super.call(this, {
|
|
3777
3779
|
timeoutDelay: SESSION_IDLE_TIME,
|
|
3778
3780
|
onIdle: function () { return _this.clearSessionWhenIdle(); },
|
|
@@ -3782,13 +3784,14 @@ var SessionManager = /** @class */ (function (_super) {
|
|
|
3782
3784
|
_this._sessionHasError = false;
|
|
3783
3785
|
_this._cachedLogsSent = false;
|
|
3784
3786
|
_this._currentPageTimestamp = getNowTime();
|
|
3787
|
+
_this.debugMode = !!((_a = getSdkConfig()) === null || _a === void 0 ? void 0 : _a.debug);
|
|
3785
3788
|
_this.getPrevSession = function () {
|
|
3786
3789
|
var _a;
|
|
3787
|
-
return JSON.parse((_a = CxGlobal.sessionStorage) === null || _a ===
|
|
3790
|
+
return JSON.parse((_a = CxGlobal.sessionStorage) === null || _a === void 0 ? void 0 : _a.getItem(PREV_SESSION_KEY));
|
|
3788
3791
|
};
|
|
3789
3792
|
_this.getSession = function () {
|
|
3790
3793
|
var _a;
|
|
3791
|
-
var storedSession = JSON.parse((_a = CxGlobal.sessionStorage) === null || _a ===
|
|
3794
|
+
var storedSession = JSON.parse((_a = CxGlobal.sessionStorage) === null || _a === void 0 ? void 0 : _a.getItem(SESSION_KEY));
|
|
3792
3795
|
var now = getNowTime();
|
|
3793
3796
|
var session;
|
|
3794
3797
|
if (storedSession) {
|
|
@@ -3804,22 +3807,22 @@ var SessionManager = /** @class */ (function (_super) {
|
|
|
3804
3807
|
};
|
|
3805
3808
|
_this.setSession = function (afterIdle) {
|
|
3806
3809
|
var _a, _b, _c, _d;
|
|
3807
|
-
if (afterIdle ===
|
|
3808
|
-
var shouldkeepSessionAfterReload = (_a = _this._sessionConfig) === null || _a ===
|
|
3810
|
+
if (afterIdle === void 0) { afterIdle = false; }
|
|
3811
|
+
var shouldkeepSessionAfterReload = (_a = _this._sessionConfig) === null || _a === void 0 ? void 0 : _a.keepSessionAfterReload;
|
|
3809
3812
|
if (shouldkeepSessionAfterReload) {
|
|
3810
3813
|
_this.handleRefreshedSessions();
|
|
3811
3814
|
}
|
|
3812
3815
|
else {
|
|
3813
3816
|
_this.createNewSession();
|
|
3814
3817
|
}
|
|
3815
|
-
(_b = CxGlobal.sessionStorage) === null || _b ===
|
|
3818
|
+
(_b = CxGlobal.sessionStorage) === null || _b === void 0 ? void 0 : _b.setItem(SESSION_KEY, JSON.stringify(_this.activeSession));
|
|
3816
3819
|
var sessionRecorder = getSessionRecorder();
|
|
3817
3820
|
var shouldStartRecordingAfterIdle = afterIdle &&
|
|
3818
|
-
!!(sessionRecorder === null || sessionRecorder ===
|
|
3819
|
-
!!((_c = _this.sessionRecorderConfig) === null || _c ===
|
|
3821
|
+
!!(sessionRecorder === null || sessionRecorder === void 0 ? void 0 : sessionRecorder.recordingStopDueToTimeout) &&
|
|
3822
|
+
!!((_c = _this.sessionRecorderConfig) === null || _c === void 0 ? void 0 : _c.enable);
|
|
3820
3823
|
if (shouldStartRecordingAfterIdle ||
|
|
3821
|
-
(sessionRecorder === null || sessionRecorder ===
|
|
3822
|
-
(_d = _this.sessionRecorder) === null || _d ===
|
|
3824
|
+
(sessionRecorder === null || sessionRecorder === void 0 ? void 0 : sessionRecorder.getIsAutoStartRecording())) {
|
|
3825
|
+
(_d = _this.sessionRecorder) === null || _d === void 0 ? void 0 : _d.startRecording();
|
|
3823
3826
|
}
|
|
3824
3827
|
return _this.activeSession;
|
|
3825
3828
|
};
|
|
@@ -3919,14 +3922,14 @@ var SessionManager = /** @class */ (function (_super) {
|
|
|
3919
3922
|
this.stopIdleListener();
|
|
3920
3923
|
};
|
|
3921
3924
|
SessionManager.prototype.initializeSession = function (recordConfig) {
|
|
3922
|
-
return __awaiter(this,
|
|
3925
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3923
3926
|
var recordingSamplingEnabled, SessionRecorder_1;
|
|
3924
3927
|
return __generator(this, function (_a) {
|
|
3925
3928
|
switch (_a.label) {
|
|
3926
3929
|
case 0:
|
|
3927
3930
|
CxGlobal[SESSION_MANAGER_KEY] = this;
|
|
3928
3931
|
this.sessionRecorderConfig = recordConfig;
|
|
3929
|
-
if (!(recordConfig === null || recordConfig ===
|
|
3932
|
+
if (!(recordConfig === null || recordConfig === void 0 ? void 0 : recordConfig.enable)) return [3 /*break*/, 3];
|
|
3930
3933
|
recordingSamplingEnabled = isSamplingOn(recordConfig.sessionRecordingSampleRate);
|
|
3931
3934
|
if (!recordingSamplingEnabled) return [3 /*break*/, 2];
|
|
3932
3935
|
return [4 /*yield*/, import('./sessionRecorder.esm.js')];
|
|
@@ -3946,24 +3949,27 @@ var SessionManager = /** @class */ (function (_super) {
|
|
|
3946
3949
|
};
|
|
3947
3950
|
SessionManager.prototype.clearSessionWhenIdle = function () {
|
|
3948
3951
|
var _a;
|
|
3949
|
-
if ((_a = this.sessionRecorder) === null || _a ===
|
|
3952
|
+
if ((_a = this.sessionRecorder) === null || _a === void 0 ? void 0 : _a.getSessionHasRecording()) {
|
|
3950
3953
|
this.sessionRecorder.recordingStopDueToTimeout = true;
|
|
3951
3954
|
}
|
|
3952
3955
|
this.clearSession();
|
|
3953
3956
|
};
|
|
3954
3957
|
SessionManager.prototype.clearPrevSession = function () {
|
|
3955
3958
|
var _a;
|
|
3956
|
-
(_a = CxGlobal.sessionStorage) === null || _a ===
|
|
3959
|
+
(_a = CxGlobal.sessionStorage) === null || _a === void 0 ? void 0 : _a.removeItem(PREV_SESSION_KEY);
|
|
3957
3960
|
};
|
|
3958
3961
|
SessionManager.prototype.clearSession = function () {
|
|
3959
3962
|
var _a, _b, _c, _d, _e, _f;
|
|
3960
|
-
|
|
3963
|
+
if (this.debugMode) {
|
|
3964
|
+
console.debug('Coralogix Browser SDK - Session expired, clearing session');
|
|
3965
|
+
}
|
|
3966
|
+
(_a = CxGlobal.sessionStorage) === null || _a === void 0 ? void 0 : _a.setItem(PREV_SESSION_KEY, JSON.stringify(__assign(__assign({}, this.activeSession), { hasRecording: (_b = this.sessionRecorder) === null || _b === void 0 ? void 0 : _b.getSessionHasRecording(), hasScreenshot: (_c = this.sessionRecorder) === null || _c === void 0 ? void 0 : _c.getSessionHasScreenshot() })));
|
|
3961
3967
|
clearGlobalSpan();
|
|
3962
3968
|
this.clearSessionWithErrorMode();
|
|
3963
|
-
(_d = getSnapshotManager()) === null || _d ===
|
|
3969
|
+
(_d = getSnapshotManager()) === null || _d === void 0 ? void 0 : _d.resetSnapshot();
|
|
3964
3970
|
this._currentPageFragment = undefined;
|
|
3965
|
-
(_e = this.sessionRecorder) === null || _e ===
|
|
3966
|
-
(_f = CxGlobal.sessionStorage) === null || _f ===
|
|
3971
|
+
(_e = this.sessionRecorder) === null || _e === void 0 ? void 0 : _e.stopRecording();
|
|
3972
|
+
(_f = CxGlobal.sessionStorage) === null || _f === void 0 ? void 0 : _f.removeItem(SESSION_KEY);
|
|
3967
3973
|
};
|
|
3968
3974
|
SessionManager.prototype.clearSessionWithErrorMode = function () {
|
|
3969
3975
|
this.sessionHasError = false;
|
|
@@ -3972,9 +3978,9 @@ var SessionManager = /** @class */ (function (_super) {
|
|
|
3972
3978
|
SessionManager.prototype.handleRefreshedSessions = function () {
|
|
3973
3979
|
var _a, _b;
|
|
3974
3980
|
this.activeSession = this.getSession();
|
|
3975
|
-
var recordingSegmentMapFromStorage = JSON.parse(((_a = CxGlobal.sessionStorage) === null || _a ===
|
|
3981
|
+
var recordingSegmentMapFromStorage = JSON.parse(((_a = CxGlobal.sessionStorage) === null || _a === void 0 ? void 0 : _a.getItem(SESSION_RECORDER_SEGMENTS_MAP)) || '{}');
|
|
3976
3982
|
if (this.activeSession) {
|
|
3977
|
-
(_b = getSessionRecorder()) === null || _b ===
|
|
3983
|
+
(_b = getSessionRecorder()) === null || _b === void 0 ? void 0 : _b.updateSegmentIndexCounter(recordingSegmentMapFromStorage);
|
|
3978
3984
|
}
|
|
3979
3985
|
else {
|
|
3980
3986
|
this.createNewSession();
|
|
@@ -3982,6 +3988,9 @@ var SessionManager = /** @class */ (function (_super) {
|
|
|
3982
3988
|
};
|
|
3983
3989
|
SessionManager.prototype.createNewSession = function () {
|
|
3984
3990
|
var now = getNowTime();
|
|
3991
|
+
if (this.debugMode) {
|
|
3992
|
+
console.debug('Coralogix Browser SDK - Creating new session');
|
|
3993
|
+
}
|
|
3985
3994
|
this.activeSession = {
|
|
3986
3995
|
sessionId: generateUUID(),
|
|
3987
3996
|
sessionCreationDate: now,
|
|
@@ -3993,17 +4002,17 @@ var SessionManager = /** @class */ (function (_super) {
|
|
|
3993
4002
|
|
|
3994
4003
|
var reportInternalEvent = function (event, message) {
|
|
3995
4004
|
var internalInstrumentation = getInternalRumData(INTERNAL_INSTRUMENTATION_NAME);
|
|
3996
|
-
internalInstrumentation === null || internalInstrumentation ===
|
|
4005
|
+
internalInstrumentation === null || internalInstrumentation === void 0 ? void 0 : internalInstrumentation.reportInternalEvent(event, message);
|
|
3997
4006
|
};
|
|
3998
4007
|
|
|
3999
4008
|
function handlePropagators(config, tracerProvider) {
|
|
4000
|
-
return __awaiter(this,
|
|
4009
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4001
4010
|
var propagators, _a, propagateB3TraceHeader, propagateAwsXrayTraceHeader, singleHeader, multiHeader;
|
|
4002
4011
|
var _b, _c;
|
|
4003
4012
|
return __generator(this, function (_d) {
|
|
4004
|
-
if ((_b = config.traceParentInHeader) === null || _b ===
|
|
4013
|
+
if ((_b = config.traceParentInHeader) === null || _b === void 0 ? void 0 : _b.enabled) {
|
|
4005
4014
|
propagators = [];
|
|
4006
|
-
_a = ((_c = config.traceParentInHeader) === null || _c ===
|
|
4015
|
+
_a = ((_c = config.traceParentInHeader) === null || _c === void 0 ? void 0 : _c.options) || {}, propagateB3TraceHeader = _a.propagateB3TraceHeader, propagateAwsXrayTraceHeader = _a.propagateAwsXrayTraceHeader;
|
|
4007
4016
|
if (!propagateAwsXrayTraceHeader && !propagateB3TraceHeader) {
|
|
4008
4017
|
propagators = __spreadArray(__spreadArray([], __read$1(propagators), false), [
|
|
4009
4018
|
new W3CBaggagePropagator(),
|
|
@@ -4045,7 +4054,7 @@ var CxPropagator = /** @class */ (function () {
|
|
|
4045
4054
|
};
|
|
4046
4055
|
CxPropagator.prototype.inject = function (context, carrier, setter) {
|
|
4047
4056
|
var _a, _b;
|
|
4048
|
-
var allowedUrls = (_b = (_a = this.config.traceParentInHeader) === null || _a ===
|
|
4057
|
+
var allowedUrls = (_b = (_a = this.config.traceParentInHeader) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.allowedTracingUrls;
|
|
4049
4058
|
if (allowedUrls) {
|
|
4050
4059
|
var span = trace.getSpan(context);
|
|
4051
4060
|
var url = span.attributes[OtelNetworkAttrs.URL];
|
|
@@ -4100,14 +4109,14 @@ function validateAndResolveInitConfig(config) {
|
|
|
4100
4109
|
if (proxyUrl)
|
|
4101
4110
|
resolvedIgnoreUrls.push(new RegExp(proxyUrl));
|
|
4102
4111
|
OPTIONS_DEFAULTS.ignoreUrls && resolvedIgnoreUrls.push.apply(resolvedIgnoreUrls, __spreadArray([], __read$1(OPTIONS_DEFAULTS.ignoreUrls), false));
|
|
4103
|
-
return __assign(__assign(__assign({}, OPTIONS_DEFAULTS), config), { maskInputTypes: (_a = config.maskInputTypes) !== null && _a !==
|
|
4112
|
+
return __assign(__assign(__assign({}, OPTIONS_DEFAULTS), config), { maskInputTypes: (_a = config.maskInputTypes) !== null && _a !== void 0 ? _a : MASK_INPUT_TYPES_DEFAULT, maskClass: (_b = config.maskClass) !== null && _b !== void 0 ? _b : MASK_CLASS_DEFAULT, ignoreUrls: resolvedIgnoreUrls, urlBlueprinters: resolveUrlBlueprinters(urlBlueprinters), sessionSampleRate: (_c = config.sessionSampleRate) !== null && _c !== void 0 ? _c : 100, sessionConfig: resolveSessionConfig(config.sessionConfig), sessionRecordingConfig: resolveSessionRecordingConfig(config.sessionRecordingConfig), memoryUsageConfig: resolveMemoryUsageConfig(config.memoryUsageConfig), trackSoftNavigations: !!config.trackSoftNavigations, supportMfe: !!config.supportMfe });
|
|
4104
4113
|
}
|
|
4105
4114
|
function resolveMemoryUsageConfig(memoryUsageConfig) {
|
|
4106
4115
|
var _a;
|
|
4107
4116
|
if (!memoryUsageConfig) {
|
|
4108
4117
|
return { enabled: false };
|
|
4109
4118
|
}
|
|
4110
|
-
return __assign(__assign({}, memoryUsageConfig), { interval: (_a = memoryUsageConfig.interval) !== null && _a !==
|
|
4119
|
+
return __assign(__assign({}, memoryUsageConfig), { interval: (_a = memoryUsageConfig.interval) !== null && _a !== void 0 ? _a : MEMORY_USAGE_DEFAULT_INTERVAL });
|
|
4111
4120
|
}
|
|
4112
4121
|
function resolveUrlBlueprinters(urlBlueprinters) {
|
|
4113
4122
|
if (!urlBlueprinters) {
|
|
@@ -4134,7 +4143,7 @@ function resolveUrlBlueprinters(urlBlueprinters) {
|
|
|
4134
4143
|
return resolvedUrlBlueprinters;
|
|
4135
4144
|
}
|
|
4136
4145
|
|
|
4137
|
-
var SDK_VERSION = '2.
|
|
4146
|
+
var SDK_VERSION = '2.4.1';
|
|
4138
4147
|
|
|
4139
4148
|
function shouldDropEvent(cxRumEvent, options) {
|
|
4140
4149
|
if (isDocumentErrorWithoutMessage(cxRumEvent)) {
|
|
@@ -4151,10 +4160,10 @@ function isDocumentErrorWithoutMessage(cxRumEvent) {
|
|
|
4151
4160
|
var _a = cxRumEvent || {}, event_context = _a.event_context, error_context = _a.error_context;
|
|
4152
4161
|
return (event_context.type === CoralogixEventType.ERROR &&
|
|
4153
4162
|
event_context.source === ErrorSource.DOCUMENT &&
|
|
4154
|
-
!(error_context === null || error_context ===
|
|
4163
|
+
!(error_context === null || error_context === void 0 ? void 0 : error_context.error_message));
|
|
4155
4164
|
}
|
|
4156
4165
|
function isIgnoredError(cxRumEvent, ignoreErrors) {
|
|
4157
|
-
if (!cxRumEvent.error_context || !(ignoreErrors === null || ignoreErrors ===
|
|
4166
|
+
if (!cxRumEvent.error_context || !(ignoreErrors === null || ignoreErrors === void 0 ? void 0 : ignoreErrors.length)) {
|
|
4158
4167
|
return false;
|
|
4159
4168
|
}
|
|
4160
4169
|
var errorMessage = cxRumEvent.error_context.error_message || '';
|
|
@@ -4162,7 +4171,7 @@ function isIgnoredError(cxRumEvent, ignoreErrors) {
|
|
|
4162
4171
|
}
|
|
4163
4172
|
|
|
4164
4173
|
function processBeforeSend(cxSpan, options) {
|
|
4165
|
-
if (!(options === null || options ===
|
|
4174
|
+
if (!(options === null || options === void 0 ? void 0 : options.beforeSend)) {
|
|
4166
4175
|
return cxSpan;
|
|
4167
4176
|
}
|
|
4168
4177
|
var cxRumEvent = cxSpan.text.cx_rum;
|
|
@@ -4184,7 +4193,7 @@ function validateBeforeSendResult(beforeSendResult) {
|
|
|
4184
4193
|
'event_context',
|
|
4185
4194
|
];
|
|
4186
4195
|
var isMissingRequiredKey = function () {
|
|
4187
|
-
return requiredKeys.some(function (key) { return !(beforeSendResult === null || beforeSendResult ===
|
|
4196
|
+
return requiredKeys.some(function (key) { return !(beforeSendResult === null || beforeSendResult === void 0 ? void 0 : beforeSendResult[key]); });
|
|
4188
4197
|
};
|
|
4189
4198
|
if (!isObject(beforeSendResult) || isMissingRequiredKey()) {
|
|
4190
4199
|
console.warn('CoralogixRum: beforeSend must return null, undefined or a valid event.');
|
|
@@ -4212,8 +4221,8 @@ var CoralogixSpanMapProcessor = /** @class */ (function () {
|
|
|
4212
4221
|
}
|
|
4213
4222
|
var _c = getSessionManager(), onlySessionWithErrorMode = _c.onlySessionWithErrorMode, getPrevSession = _c.getPrevSession, getSession = _c.getSession, setSession = _c.setSession;
|
|
4214
4223
|
var session = getSession() || setSession();
|
|
4215
|
-
var sessionHasRecording = !!((_a = getSessionRecorder()) === null || _a ===
|
|
4216
|
-
var sessionHasScreenshot = !!((_b = getSessionRecorder()) === null || _b ===
|
|
4224
|
+
var sessionHasRecording = !!((_a = getSessionRecorder()) === null || _a === void 0 ? void 0 : _a.getSessionHasRecording());
|
|
4225
|
+
var sessionHasScreenshot = !!((_b = getSessionRecorder()) === null || _b === void 0 ? void 0 : _b.getSessionHasScreenshot());
|
|
4217
4226
|
var mappedCxSpan = this._mapToCxSpan(span, session, getPrevSession(), sessionHasRecording, sessionHasScreenshot, onlySessionWithErrorMode);
|
|
4218
4227
|
if (!shouldDropEvent(mappedCxSpan.text.cx_rum, this.sdkConfig)) {
|
|
4219
4228
|
var resolvedCxSpan = processBeforeSend(mappedCxSpan, this.sdkConfig);
|
|
@@ -4248,14 +4257,14 @@ var CoralogixSpanMapProcessor = /** @class */ (function () {
|
|
|
4248
4257
|
span[CoralogixAttributes.EVENT_TYPE];
|
|
4249
4258
|
var eventTypeContext = this._getEventTypeContext(attributes, eventType, span);
|
|
4250
4259
|
var _e = span.spanContext(), spanId = _e.spanId, traceId = _e.traceId;
|
|
4251
|
-
var resourceAttributes = __assign(__assign({}, (_a = span.resource) === null || _a ===
|
|
4260
|
+
var resourceAttributes = __assign(__assign({}, (_a = span.resource) === null || _a === void 0 ? void 0 : _a.attributes), { 'service.name': application });
|
|
4252
4261
|
var labels = JSON.parse(attributes[CoralogixAttributes.CUSTOM_LABELS]);
|
|
4253
|
-
var isErrorWithStacktrace = !!((_b = eventTypeContext === null || eventTypeContext ===
|
|
4262
|
+
var isErrorWithStacktrace = !!((_b = eventTypeContext === null || eventTypeContext === void 0 ? void 0 : eventTypeContext.error_context) === null || _b === void 0 ? void 0 : _b.original_stacktrace);
|
|
4254
4263
|
var version_metadata = {
|
|
4255
4264
|
app_name: application,
|
|
4256
4265
|
app_version: version,
|
|
4257
4266
|
};
|
|
4258
|
-
var severity = (attributes === null || attributes ===
|
|
4267
|
+
var severity = (attributes === null || attributes === void 0 ? void 0 : attributes[CoralogixAttributes.SEVERITY]) ||
|
|
4259
4268
|
CoralogixLogSeverity.Info;
|
|
4260
4269
|
var timestamp = attributes[CoralogixAttributes.TIMESTAMP] || getNowTime();
|
|
4261
4270
|
if (timestamp < sessionCreationDate) {
|
|
@@ -4352,7 +4361,7 @@ var CoralogixSpanMapProcessor = /** @class */ (function () {
|
|
|
4352
4361
|
var url = spanAttributes[OtelNetworkAttrs.URL];
|
|
4353
4362
|
var url_blueprint = applyUrlBluePrinters({
|
|
4354
4363
|
url: url,
|
|
4355
|
-
blueprinters: (_a = this.sdkConfig.urlBlueprinters) === null || _a ===
|
|
4364
|
+
blueprinters: (_a = this.sdkConfig.urlBlueprinters) === null || _a === void 0 ? void 0 : _a.networkUrlBlueprinters,
|
|
4356
4365
|
});
|
|
4357
4366
|
return {
|
|
4358
4367
|
network_request_context: {
|
|
@@ -4364,7 +4373,7 @@ var CoralogixSpanMapProcessor = /** @class */ (function () {
|
|
|
4364
4373
|
host: spanAttributes[OtelNetworkAttrs.HOST],
|
|
4365
4374
|
schema: spanAttributes[OtelNetworkAttrs.SCHEME],
|
|
4366
4375
|
status_text: spanAttributes[OtelNetworkAttrs.STATUS_TEXT],
|
|
4367
|
-
duration: hrTimeToMilliseconds(span === null || span ===
|
|
4376
|
+
duration: hrTimeToMilliseconds(span === null || span === void 0 ? void 0 : span.duration),
|
|
4368
4377
|
source: spanAttributes[CoralogixAttributes.SOURCE],
|
|
4369
4378
|
response_content_length: spanAttributes[OtelNetworkAttrs.RESPONSE_CONTENT_LENGTH],
|
|
4370
4379
|
request_headers: span[NetworkInstrumentationAttributes.REQUEST_HEADERS],
|
|
@@ -4380,7 +4389,7 @@ var CoralogixSpanMapProcessor = /** @class */ (function () {
|
|
|
4380
4389
|
return {
|
|
4381
4390
|
log_context: {
|
|
4382
4391
|
message: cxLog.message,
|
|
4383
|
-
data: cxLog === null || cxLog ===
|
|
4392
|
+
data: cxLog === null || cxLog === void 0 ? void 0 : cxLog.data,
|
|
4384
4393
|
},
|
|
4385
4394
|
};
|
|
4386
4395
|
}
|
|
@@ -4437,11 +4446,11 @@ var CoralogixSpanMapProcessor = /** @class */ (function () {
|
|
|
4437
4446
|
CoralogixSpanMapProcessor.prototype.resolveLabels = function (cxRumEvent) {
|
|
4438
4447
|
var _a, _b;
|
|
4439
4448
|
var allLabels = cxRumEvent.labels;
|
|
4440
|
-
var labelProviders = (_a = this.sdkConfig) === null || _a ===
|
|
4441
|
-
if (labelProviders === null || labelProviders ===
|
|
4449
|
+
var labelProviders = (_a = this.sdkConfig) === null || _a === void 0 ? void 0 : _a.labelProviders;
|
|
4450
|
+
if (labelProviders === null || labelProviders === void 0 ? void 0 : labelProviders.length) {
|
|
4442
4451
|
var pageUrlLabelProviders = getInternalRumData(PAGE_URL_LABEL_PROVIDERS_KEY);
|
|
4443
4452
|
var networkUrlLabelProviders = getInternalRumData(NETWORK_URL_LABEL_PROVIDERS_KEY);
|
|
4444
|
-
var networkRequestFragment = (_b = cxRumEvent.network_request_context) === null || _b ===
|
|
4453
|
+
var networkRequestFragment = (_b = cxRumEvent.network_request_context) === null || _b === void 0 ? void 0 : _b.fragments;
|
|
4445
4454
|
var labelsFromProviders = __assign(__assign({}, this.getLabelsByLabelProviders(pageUrlLabelProviders, cxRumEvent, cxRumEvent.page_context.page_fragments)), (networkRequestFragment
|
|
4446
4455
|
? this.getLabelsByLabelProviders(networkUrlLabelProviders, cxRumEvent, networkRequestFragment)
|
|
4447
4456
|
: {}));
|
|
@@ -4522,7 +4531,7 @@ var CoralogixSnapshotSpanProcessor = /** @class */ (function () {
|
|
|
4522
4531
|
});
|
|
4523
4532
|
shouldCreateSnapshot = true;
|
|
4524
4533
|
}
|
|
4525
|
-
if (((_a = getSessionRecorder()) === null || _a ===
|
|
4534
|
+
if (((_a = getSessionRecorder()) === null || _a === void 0 ? void 0 : _a.getSessionHasRecording()) &&
|
|
4526
4535
|
!isSnapshotSentDueToRecording) {
|
|
4527
4536
|
updateSnapshot({ timestamp: getNowTime(), hasRecording: true });
|
|
4528
4537
|
getSnapshotManager().isSnapshotSentDueToRecording = true;
|
|
@@ -4598,7 +4607,7 @@ var CoralogixNavigationProcessor = /** @class */ (function () {
|
|
|
4598
4607
|
CoralogixNavigationProcessor.prototype.onEnd = function (span) { };
|
|
4599
4608
|
CoralogixNavigationProcessor.prototype.onStart = function (span) {
|
|
4600
4609
|
var pageContext = resolvePageContext(location.href);
|
|
4601
|
-
{
|
|
4610
|
+
if (pageContext) {
|
|
4602
4611
|
span[CoralogixAttributes.PAGE_CONTEXT] = pageContext;
|
|
4603
4612
|
var currentPageFragment = getSessionManager().currentPageFragment;
|
|
4604
4613
|
var page_fragments = pageContext.page_fragments;
|
|
@@ -4686,9 +4695,9 @@ var CoralogixRum = {
|
|
|
4686
4695
|
var instrumentations = INSTRUMENTATIONS.map(function (_a) {
|
|
4687
4696
|
var _b, _c;
|
|
4688
4697
|
var Instrument = _a.Instrument, confKey = _a.confKey, disable = _a.disable;
|
|
4689
|
-
var pluginConf = getInstrumentationConfig((_b = resolvedOptions === null || resolvedOptions ===
|
|
4698
|
+
var pluginConf = getInstrumentationConfig((_b = resolvedOptions === null || resolvedOptions === void 0 ? void 0 : resolvedOptions.instrumentations) === null || _b === void 0 ? void 0 : _b[confKey], pluginDefaults, disable);
|
|
4690
4699
|
if (pluginConf) {
|
|
4691
|
-
var instrumentation =
|
|
4700
|
+
var instrumentation = void 0;
|
|
4692
4701
|
switch (confKey) {
|
|
4693
4702
|
case 'errors': {
|
|
4694
4703
|
instrumentation = new Instrument(pluginConf);
|
|
@@ -4707,7 +4716,7 @@ var CoralogixRum = {
|
|
|
4707
4716
|
break;
|
|
4708
4717
|
}
|
|
4709
4718
|
case SCREENSHOT_INSTRUMENTATION_NAME: {
|
|
4710
|
-
if ((_c = resolvedOptions.sessionRecordingConfig) === null || _c ===
|
|
4719
|
+
if ((_c = resolvedOptions.sessionRecordingConfig) === null || _c === void 0 ? void 0 : _c.enable) {
|
|
4711
4720
|
instrumentation = new Instrument(pluginConf);
|
|
4712
4721
|
screenshotInstrumentation =
|
|
4713
4722
|
instrumentation;
|
|
@@ -4779,7 +4788,7 @@ var CoralogixRum = {
|
|
|
4779
4788
|
saveInternalRumData(PAGE_URL_LABEL_PROVIDERS_KEY, pageUrlLabelProviders);
|
|
4780
4789
|
saveInternalRumData(NETWORK_URL_LABEL_PROVIDERS_KEY, networkUrlLabelProviders);
|
|
4781
4790
|
isInited = true;
|
|
4782
|
-
if (options === null || options ===
|
|
4791
|
+
if (options === null || options === void 0 ? void 0 : options.debug) {
|
|
4783
4792
|
console.info('CoralogixRum.init() complete');
|
|
4784
4793
|
}
|
|
4785
4794
|
reportInternalEvent('init');
|
|
@@ -4790,7 +4799,7 @@ var CoralogixRum = {
|
|
|
4790
4799
|
console.debug('CoralogixRum must be initiated before getting custom tracer');
|
|
4791
4800
|
return;
|
|
4792
4801
|
}
|
|
4793
|
-
if (!((_b = (_a = getSdkConfig()) === null || _a ===
|
|
4802
|
+
if (!((_b = (_a = getSdkConfig()) === null || _a === void 0 ? void 0 : _a.traceParentInHeader) === null || _b === void 0 ? void 0 : _b.enabled)) {
|
|
4794
4803
|
console.debug('Coralogix Browser SDK - TraceParentInHeader is not enabled');
|
|
4795
4804
|
return;
|
|
4796
4805
|
}
|
|
@@ -4806,7 +4815,7 @@ var CoralogixRum = {
|
|
|
4806
4815
|
console.warn('Coralogix Browser SDK - Global span already exists');
|
|
4807
4816
|
return;
|
|
4808
4817
|
}
|
|
4809
|
-
setCustomTracerIgnoredInstruments((ignoredList === null || ignoredList ===
|
|
4818
|
+
setCustomTracerIgnoredInstruments((ignoredList === null || ignoredList === void 0 ? void 0 : ignoredList.ignoredInstruments) || []);
|
|
4810
4819
|
var globalSpan = tracer.startSpan(name);
|
|
4811
4820
|
globalSpan[CoralogixAttributes.EVENT_TYPE] =
|
|
4812
4821
|
CoralogixEventType.CUSTOM_SPAN;
|
|
@@ -4820,7 +4829,7 @@ var CoralogixRum = {
|
|
|
4820
4829
|
return context.with(trace.setSpan(context.active(), globalSpan), fn);
|
|
4821
4830
|
},
|
|
4822
4831
|
endSpan: function () {
|
|
4823
|
-
globalSpan === null || globalSpan ===
|
|
4832
|
+
globalSpan === null || globalSpan === void 0 ? void 0 : globalSpan.end();
|
|
4824
4833
|
clearGlobalSpan();
|
|
4825
4834
|
},
|
|
4826
4835
|
startCustomSpan: function (name, labels) {
|
|
@@ -4834,7 +4843,7 @@ var CoralogixRum = {
|
|
|
4834
4843
|
return {
|
|
4835
4844
|
span: customSpan,
|
|
4836
4845
|
endSpan: function () {
|
|
4837
|
-
customSpan === null || customSpan ===
|
|
4846
|
+
customSpan === null || customSpan === void 0 ? void 0 : customSpan.end();
|
|
4838
4847
|
},
|
|
4839
4848
|
};
|
|
4840
4849
|
},
|
|
@@ -4849,15 +4858,15 @@ var CoralogixRum = {
|
|
|
4849
4858
|
if (!isInited) {
|
|
4850
4859
|
return;
|
|
4851
4860
|
}
|
|
4852
|
-
_deregisterInstrumentations === null || _deregisterInstrumentations ===
|
|
4861
|
+
_deregisterInstrumentations === null || _deregisterInstrumentations === void 0 ? void 0 : _deregisterInstrumentations();
|
|
4853
4862
|
_deregisterInstrumentations = undefined;
|
|
4854
4863
|
this.stopSessionRecording();
|
|
4855
|
-
(_a = getSessionManager()) === null || _a ===
|
|
4856
|
-
attributesProcessor === null || attributesProcessor ===
|
|
4857
|
-
navigationProcessor === null || navigationProcessor ===
|
|
4858
|
-
spanMapProcessor === null || spanMapProcessor ===
|
|
4859
|
-
snapshotProcessor === null || snapshotProcessor ===
|
|
4860
|
-
exporter === null || exporter ===
|
|
4864
|
+
(_a = getSessionManager()) === null || _a === void 0 ? void 0 : _a.stop();
|
|
4865
|
+
attributesProcessor === null || attributesProcessor === void 0 ? void 0 : attributesProcessor.shutdown();
|
|
4866
|
+
navigationProcessor === null || navigationProcessor === void 0 ? void 0 : navigationProcessor.shutdown();
|
|
4867
|
+
spanMapProcessor === null || spanMapProcessor === void 0 ? void 0 : spanMapProcessor.shutdown();
|
|
4868
|
+
snapshotProcessor === null || snapshotProcessor === void 0 ? void 0 : snapshotProcessor.shutdown();
|
|
4869
|
+
exporter === null || exporter === void 0 ? void 0 : exporter.shutdown();
|
|
4861
4870
|
isInited = false;
|
|
4862
4871
|
},
|
|
4863
4872
|
setApplicationContext: function (applicationContext) {
|
|
@@ -4866,21 +4875,21 @@ var CoralogixRum = {
|
|
|
4866
4875
|
console.debug('CoralogixRum must be initiated before setting application context');
|
|
4867
4876
|
return;
|
|
4868
4877
|
}
|
|
4869
|
-
attributesProcessor === null || attributesProcessor ===
|
|
4878
|
+
attributesProcessor === null || attributesProcessor === void 0 ? void 0 : attributesProcessor.setInternalLabels(__assign(__assign({}, attributesProcessor.getInternalLabels()), (_a = {}, _a[CoralogixAttributes.APPLICATION_CONTEXT] = applicationContext, _a)));
|
|
4870
4879
|
},
|
|
4871
4880
|
captureError: function (error, customData, labels) {
|
|
4872
4881
|
if (!isInited) {
|
|
4873
4882
|
console.debug('CoralogixRum must be initiated before reporting errors');
|
|
4874
4883
|
return;
|
|
4875
4884
|
}
|
|
4876
|
-
errorsInstrumentation === null || errorsInstrumentation ===
|
|
4885
|
+
errorsInstrumentation === null || errorsInstrumentation === void 0 ? void 0 : errorsInstrumentation.reportError(ErrorSource.CAPTURED, error, customData, labels);
|
|
4877
4886
|
},
|
|
4878
4887
|
sendCustomMeasurement: function (name, value) {
|
|
4879
4888
|
if (!isInited) {
|
|
4880
4889
|
console.debug('CoralogixRum must be initiated before sending custom measurement');
|
|
4881
4890
|
return;
|
|
4882
4891
|
}
|
|
4883
|
-
customMeasurementInstrumentation === null || customMeasurementInstrumentation ===
|
|
4892
|
+
customMeasurementInstrumentation === null || customMeasurementInstrumentation === void 0 ? void 0 : customMeasurementInstrumentation.createCustomMeasurement(name, value);
|
|
4884
4893
|
},
|
|
4885
4894
|
addTiming: function (name, duration) {
|
|
4886
4895
|
if (!isInited) {
|
|
@@ -4902,7 +4911,7 @@ var CoralogixRum = {
|
|
|
4902
4911
|
},
|
|
4903
4912
|
stopSessionRecording: function () {
|
|
4904
4913
|
var _a;
|
|
4905
|
-
(_a = getSessionRecorder()) === null || _a ===
|
|
4914
|
+
(_a = getSessionRecorder()) === null || _a === void 0 ? void 0 : _a.stopRecording();
|
|
4906
4915
|
},
|
|
4907
4916
|
startSessionRecording: function () {
|
|
4908
4917
|
if (getSessionRecorder()) {
|
|
@@ -4927,8 +4936,8 @@ var CoralogixRum = {
|
|
|
4927
4936
|
return;
|
|
4928
4937
|
}
|
|
4929
4938
|
var id = generateUUID();
|
|
4930
|
-
screenshotInstrumentation === null || screenshotInstrumentation ===
|
|
4931
|
-
(_a = getSessionRecorder()) === null || _a ===
|
|
4939
|
+
screenshotInstrumentation === null || screenshotInstrumentation === void 0 ? void 0 : screenshotInstrumentation.screenshot(id, description);
|
|
4940
|
+
(_a = getSessionRecorder()) === null || _a === void 0 ? void 0 : _a.screenshot(id);
|
|
4932
4941
|
return id;
|
|
4933
4942
|
},
|
|
4934
4943
|
setUserContext: function (userContext) {
|
|
@@ -4937,22 +4946,22 @@ var CoralogixRum = {
|
|
|
4937
4946
|
console.debug('CoralogixRum must be initiated before setting user context');
|
|
4938
4947
|
return;
|
|
4939
4948
|
}
|
|
4940
|
-
attributesProcessor === null || attributesProcessor ===
|
|
4949
|
+
attributesProcessor === null || attributesProcessor === void 0 ? void 0 : attributesProcessor.setInternalLabels(__assign(__assign({}, attributesProcessor.getInternalLabels()), (_a = {}, _a[CoralogixAttributes.USER_CONTEXT] = userContext, _a)));
|
|
4941
4950
|
},
|
|
4942
4951
|
getUserContext: function () {
|
|
4943
|
-
return attributesProcessor === null || attributesProcessor ===
|
|
4952
|
+
return attributesProcessor === null || attributesProcessor === void 0 ? void 0 : attributesProcessor.getUserContext();
|
|
4944
4953
|
},
|
|
4945
4954
|
setLabels: function (labels) {
|
|
4946
|
-
attributesProcessor === null || attributesProcessor ===
|
|
4955
|
+
attributesProcessor === null || attributesProcessor === void 0 ? void 0 : attributesProcessor.setCustomLabels(labels);
|
|
4947
4956
|
},
|
|
4948
4957
|
getLabels: function () {
|
|
4949
|
-
return (attributesProcessor === null || attributesProcessor ===
|
|
4958
|
+
return (attributesProcessor === null || attributesProcessor === void 0 ? void 0 : attributesProcessor.getCustomLabels()) || {};
|
|
4950
4959
|
},
|
|
4951
4960
|
getSessionId: function () {
|
|
4952
4961
|
var _a, _b;
|
|
4953
|
-
return (_b = (_a = getSessionManager()) === null || _a ===
|
|
4962
|
+
return (_b = (_a = getSessionManager()) === null || _a === void 0 ? void 0 : _a.getSession()) === null || _b === void 0 ? void 0 : _b.sessionId;
|
|
4954
4963
|
},
|
|
4955
|
-
log: function (severity, message, data) {
|
|
4964
|
+
log: function (severity, message, data, labels) {
|
|
4956
4965
|
if (!isInited) {
|
|
4957
4966
|
console.debug('CoralogixRum must be initiated before using log');
|
|
4958
4967
|
return;
|
|
@@ -4961,38 +4970,38 @@ var CoralogixRum = {
|
|
|
4961
4970
|
console.warn('Log was reported, but custom instrumentation is disabled.');
|
|
4962
4971
|
return;
|
|
4963
4972
|
}
|
|
4964
|
-
_customInstrumentation === null || _customInstrumentation ===
|
|
4973
|
+
_customInstrumentation === null || _customInstrumentation === void 0 ? void 0 : _customInstrumentation.log({ severity: severity, message: message, data: data, labels: labels });
|
|
4965
4974
|
},
|
|
4966
|
-
debug: function (message, data) {
|
|
4967
|
-
this.log(CoralogixLogSeverity.Debug, message, data);
|
|
4975
|
+
debug: function (message, data, labels) {
|
|
4976
|
+
this.log(CoralogixLogSeverity.Debug, message, data, labels);
|
|
4968
4977
|
},
|
|
4969
|
-
verbose: function (message, data) {
|
|
4970
|
-
this.log(CoralogixLogSeverity.Verbose, message, data);
|
|
4978
|
+
verbose: function (message, data, labels) {
|
|
4979
|
+
this.log(CoralogixLogSeverity.Verbose, message, data, labels);
|
|
4971
4980
|
},
|
|
4972
|
-
info: function (message, data) {
|
|
4973
|
-
this.log(CoralogixLogSeverity.Info, message, data);
|
|
4981
|
+
info: function (message, data, labels) {
|
|
4982
|
+
this.log(CoralogixLogSeverity.Info, message, data, labels);
|
|
4974
4983
|
},
|
|
4975
|
-
warn: function (message, data) {
|
|
4976
|
-
this.log(CoralogixLogSeverity.Warn, message, data);
|
|
4984
|
+
warn: function (message, data, labels) {
|
|
4985
|
+
this.log(CoralogixLogSeverity.Warn, message, data, labels);
|
|
4977
4986
|
},
|
|
4978
|
-
error: function (message, data) {
|
|
4979
|
-
this.log(CoralogixLogSeverity.Error, message, data);
|
|
4987
|
+
error: function (message, data, labels) {
|
|
4988
|
+
this.log(CoralogixLogSeverity.Error, message, data, labels);
|
|
4980
4989
|
},
|
|
4981
|
-
critical: function (message, data) {
|
|
4982
|
-
this.log(CoralogixLogSeverity.Critical, message, data);
|
|
4990
|
+
critical: function (message, data, labels) {
|
|
4991
|
+
this.log(CoralogixLogSeverity.Critical, message, data, labels);
|
|
4983
4992
|
},
|
|
4984
4993
|
startTimeMeasure: function (key, labels) {
|
|
4985
4994
|
if (!isInited) {
|
|
4986
4995
|
console.debug('CoralogixRum must be initiated before starting time measurement.');
|
|
4987
4996
|
return;
|
|
4988
4997
|
}
|
|
4989
|
-
timeMeasurementTracker === null || timeMeasurementTracker ===
|
|
4998
|
+
timeMeasurementTracker === null || timeMeasurementTracker === void 0 ? void 0 : timeMeasurementTracker.startMeasurement(key, labels);
|
|
4990
4999
|
},
|
|
4991
5000
|
endTimeMeasure: function (key) {
|
|
4992
|
-
var measurement = timeMeasurementTracker === null || timeMeasurementTracker ===
|
|
5001
|
+
var measurement = timeMeasurementTracker === null || timeMeasurementTracker === void 0 ? void 0 : timeMeasurementTracker.getMeasurement(key);
|
|
4993
5002
|
if (measurement) {
|
|
4994
5003
|
var duration = measurement.duration, labels = measurement.labels;
|
|
4995
|
-
customMeasurementInstrumentation === null || customMeasurementInstrumentation ===
|
|
5004
|
+
customMeasurementInstrumentation === null || customMeasurementInstrumentation === void 0 ? void 0 : customMeasurementInstrumentation.createCustomMeasurement(key, duration, getCustomMergedLabels(labels));
|
|
4996
5005
|
}
|
|
4997
5006
|
},
|
|
4998
5007
|
};
|
|
@@ -5047,4 +5056,4 @@ var SessionRecordingEventType;
|
|
|
5047
5056
|
SessionRecordingEventType[SessionRecordingEventType["Plugin"] = 6] = "Plugin";
|
|
5048
5057
|
})(SessionRecordingEventType || (SessionRecordingEventType = {}));
|
|
5049
5058
|
|
|
5050
|
-
export { BATCH_TIME_DELAY as B, CxGlobal as C, MAX_BATCH_TIME_MS as M, OtelNetworkAttrs as O, PerformanceTypes as P, Request as R, SESSION_RECORDER_SEGMENTS_MAP as S, UrlBasedLabelProvider as U, getNowTime as a, SESSION_RECORDING_NETWORK_ERR0R_MESSAGE as b,
|
|
5059
|
+
export { BATCH_TIME_DELAY as B, CxGlobal as C, MAX_BATCH_TIME_MS as M, OtelNetworkAttrs as O, PerformanceTypes as P, Request as R, SESSION_RECORDER_SEGMENTS_MAP as S, UrlBasedLabelProvider as U, getNowTime as a, SESSION_RECORDING_NETWORK_ERR0R_MESSAGE as b, SESSION_RECORDING_DEFAULT_HEADERS as c, SESSION_RECORDING_POSTFIX_URL as d, SESSION_RECORDER_KEY as e, MAX_MUTATIONS_FOR_SESSION_RECORDING as f, getSdkConfig as g, SESSION_RECORDING_DEFAULT_ERROR_MESSAGE as h, CoralogixRum as i, CoralogixLogSeverity as j, SessionRecordingEventType as k, CoralogixEventType as l, UrlType as m, reportInternalEvent as r };
|