o11y 252.6.0 → 252.8.0
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/modules/o11y/client/client.js +88 -87
- package/dist/modules/o11y/client/client.js.map +1 -1
- package/dist/modules/o11y/client/interfaces/Co11y.d.ts +5 -0
- package/dist/modules/o11y/client/interfaces/index.d.ts +1 -0
- package/dist/modules/o11y/client/library/InstrumentationImpl.d.ts +2 -1
- package/dist/modules/o11y/client/library/MetricsImpl.d.ts +2 -2
- package/dist/modules/o11y/client/library/Tracing.d.ts +1 -0
- package/dist/modules/o11y/client/shared/Co11yImpl.d.ts +13 -0
- package/dist/modules/o11y/client/shared/PublicSafety.d.ts +6 -2
- package/dist/modules/o11y/client/{library → shared}/UpCounterImpl.d.ts +1 -1
- package/dist/modules/o11y/client/shared/index.d.ts +2 -0
- package/dist/modules/o11y/client/version.d.ts +1 -1
- package/dist/modules/o11y/collectors/interfaces/Co11y.d.ts +5 -0
- package/dist/modules/o11y/collectors/interfaces/index.d.ts +1 -0
- package/dist/modules/o11y/collectors/library/InstrumentationImpl.d.ts +2 -1
- package/dist/modules/o11y/collectors/library/MetricsImpl.d.ts +2 -2
- package/dist/modules/o11y/collectors/library/Tracing.d.ts +1 -0
- package/dist/modules/o11y/collectors/shared/Co11yImpl.d.ts +13 -0
- package/dist/modules/o11y/collectors/shared/PublicSafety.d.ts +6 -2
- package/dist/modules/o11y/collectors/{library → shared}/UpCounterImpl.d.ts +1 -1
- package/dist/modules/o11y/collectors/shared/index.d.ts +2 -0
- package/dist/modules/o11y/collectors/version.d.ts +1 -1
- package/dist/modules/o11y/core_envelope/interfaces/Co11y.d.ts +5 -0
- package/dist/modules/o11y/core_envelope/interfaces/index.d.ts +1 -0
- package/dist/modules/o11y/core_envelope/library/InstrumentationImpl.d.ts +2 -1
- package/dist/modules/o11y/core_envelope/library/MetricsImpl.d.ts +2 -2
- package/dist/modules/o11y/core_envelope/library/Tracing.d.ts +1 -0
- package/dist/modules/o11y/core_envelope/shared/Co11yImpl.d.ts +13 -0
- package/dist/modules/o11y/core_envelope/shared/PublicSafety.d.ts +6 -2
- package/dist/modules/o11y/core_envelope/{library → shared}/UpCounterImpl.d.ts +1 -1
- package/dist/modules/o11y/core_envelope/shared/index.d.ts +2 -0
- package/dist/modules/o11y/core_envelope/version.d.ts +1 -1
- package/dist/modules/o11y/shared/interfaces/Co11y.d.ts +5 -0
- package/dist/modules/o11y/shared/interfaces/index.d.ts +1 -0
- package/dist/modules/o11y/shared/library/InstrumentationImpl.d.ts +2 -1
- package/dist/modules/o11y/shared/library/MetricsImpl.d.ts +2 -2
- package/dist/modules/o11y/shared/library/Tracing.d.ts +1 -0
- package/dist/modules/o11y/shared/shared/Co11yImpl.d.ts +13 -0
- package/dist/modules/o11y/shared/shared/PublicSafety.d.ts +6 -2
- package/dist/modules/o11y/shared/{library → shared}/UpCounterImpl.d.ts +1 -1
- package/dist/modules/o11y/shared/shared/index.d.ts +2 -0
- package/dist/modules/o11y/shared/shared.js +174 -64
- package/dist/modules/o11y/shared/shared.js.map +1 -1
- package/dist/modules/o11y/shared/version.d.ts +1 -1
- package/dist/modules/o11y/simple_collector/interfaces/Co11y.d.ts +5 -0
- package/dist/modules/o11y/simple_collector/interfaces/index.d.ts +1 -0
- package/dist/modules/o11y/simple_collector/library/InstrumentationImpl.d.ts +2 -1
- package/dist/modules/o11y/simple_collector/library/MetricsImpl.d.ts +2 -2
- package/dist/modules/o11y/simple_collector/library/Tracing.d.ts +1 -0
- package/dist/modules/o11y/simple_collector/shared/Co11yImpl.d.ts +13 -0
- package/dist/modules/o11y/simple_collector/shared/PublicSafety.d.ts +6 -2
- package/dist/modules/o11y/simple_collector/shared/UpCounterImpl.d.ts +22 -0
- package/dist/modules/o11y/simple_collector/shared/index.d.ts +2 -0
- package/dist/modules/o11y/simple_collector/version.d.ts +1 -1
- package/dist/modules/o11y/web_vitals/interfaces/Co11y.d.ts +5 -0
- package/dist/modules/o11y/web_vitals/interfaces/index.d.ts +1 -0
- package/dist/modules/o11y/web_vitals/library/InstrumentationImpl.d.ts +2 -1
- package/dist/modules/o11y/web_vitals/library/MetricsImpl.d.ts +2 -2
- package/dist/modules/o11y/web_vitals/library/Tracing.d.ts +1 -0
- package/dist/modules/o11y/web_vitals/shared/Co11yImpl.d.ts +13 -0
- package/dist/modules/o11y/web_vitals/shared/PublicSafety.d.ts +6 -2
- package/dist/modules/o11y/web_vitals/shared/UpCounterImpl.d.ts +22 -0
- package/dist/modules/o11y/web_vitals/shared/index.d.ts +2 -0
- package/dist/modules/o11y/web_vitals/version.d.ts +1 -1
- package/dist/modules/o11y/web_vitals/web_vitals.js.map +1 -1
- package/package.json +1 -1
- package/dist/modules/o11y/simple_collector/library/UpCounterImpl.d.ts +0 -22
- package/dist/modules/o11y/web_vitals/library/UpCounterImpl.d.ts +0 -22
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { networkSchema, simpleSchema, payloadDiagsSchema, errorSchema, activitySchema, instrumentedEventSchema, idleDetectorReportSchema } from 'o11y_schema/sf_instrumentation';
|
|
2
|
-
import { utility, PublicSafety, schemaUtil, maxStringLengthAppLimit, payloadUtility, metricsUtility } from 'o11y/shared';
|
|
2
|
+
import { utility, PublicSafety, schemaUtil, UpCounterImpl, maxStringLengthAppLimit, payloadUtility, metricsUtility, co11y } from 'o11y/shared';
|
|
3
3
|
|
|
4
4
|
class TaskerImpl {
|
|
5
5
|
get isBusy() {
|
|
@@ -584,11 +584,11 @@ class Tracing {
|
|
|
584
584
|
}
|
|
585
585
|
_enableNetworkInstrumentation(instr, logErrors, activityName, useTracing, options, tasker, logPerformance, logPerformanceActivityName, skipUrls, fuzzyMapRange) {
|
|
586
586
|
if (typeof Tracing._global.fetch === 'function') {
|
|
587
|
-
this._overrideFetch(instr, logErrors, activityName, useTracing, options, tasker);
|
|
587
|
+
this._overrideFetch(instr, logErrors, activityName, useTracing, options, tasker, skipUrls);
|
|
588
588
|
Tracing._isNetworkInstrumentationEnabled = true;
|
|
589
589
|
}
|
|
590
590
|
if (typeof Tracing._global.XMLHttpRequest === 'function') {
|
|
591
|
-
this._overrideXhr(instr, logErrors, activityName, useTracing, options, tasker);
|
|
591
|
+
this._overrideXhr(instr, logErrors, activityName, useTracing, options, tasker, skipUrls);
|
|
592
592
|
Tracing._isNetworkInstrumentationEnabled = true;
|
|
593
593
|
}
|
|
594
594
|
if (logPerformance) {
|
|
@@ -597,8 +597,20 @@ class Tracing {
|
|
|
597
597
|
Tracing._isNetworkInstrumentationEnabled = true;
|
|
598
598
|
}
|
|
599
599
|
}
|
|
600
|
-
static _getTraceHeaders(activity, options, method, url) {
|
|
601
|
-
let traceHeaders
|
|
600
|
+
static _getTraceHeaders(activity, tracingInstr, options, method, url) {
|
|
601
|
+
let traceHeaders;
|
|
602
|
+
if (activity) {
|
|
603
|
+
traceHeaders = activity.getTraceHeaders(options) || {};
|
|
604
|
+
}
|
|
605
|
+
else {
|
|
606
|
+
const context = tracingInstr.internalInstrumentationContext;
|
|
607
|
+
if (context === null || context === void 0 ? void 0 : context.rootId) {
|
|
608
|
+
traceHeaders = Tracing.getHeaders(context.rootId, utility.generateUniqueId(), context.isRootActivitySampled, options);
|
|
609
|
+
}
|
|
610
|
+
else {
|
|
611
|
+
traceHeaders = {};
|
|
612
|
+
}
|
|
613
|
+
}
|
|
602
614
|
if (typeof (options === null || options === void 0 ? void 0 : options.headerProcessor) === 'function') {
|
|
603
615
|
traceHeaders = options.headerProcessor({
|
|
604
616
|
method,
|
|
@@ -635,7 +647,7 @@ class Tracing {
|
|
|
635
647
|
}
|
|
636
648
|
return undefined;
|
|
637
649
|
}
|
|
638
|
-
_overrideFetch(instr, logErrors, activityName, useTracing, tracingHeadersOptions, tasker) {
|
|
650
|
+
_overrideFetch(instr, logErrors, activityName, useTracing, tracingHeadersOptions, tasker, skipUrls) {
|
|
639
651
|
Tracing._originalFetch = Tracing._global.fetch;
|
|
640
652
|
const o11yFetch = async (resource, options, ...restArgs) => {
|
|
641
653
|
var _a;
|
|
@@ -644,14 +656,18 @@ class Tracing {
|
|
|
644
656
|
let absoluteUrl;
|
|
645
657
|
let method;
|
|
646
658
|
let fetchTime;
|
|
659
|
+
let suspendInstrumentation = false;
|
|
647
660
|
try {
|
|
648
661
|
tasker === null || tasker === void 0 ? void 0 : tasker.add();
|
|
649
662
|
method = options === null || options === void 0 ? void 0 : options.method;
|
|
650
663
|
const ofo = options === null || options === void 0 ? void 0 : options.o11y;
|
|
651
|
-
|
|
664
|
+
const isSkipInstrSet = ofo === null || ofo === void 0 ? void 0 : ofo.skipInstr;
|
|
665
|
+
suspendInstrumentation =
|
|
666
|
+
isSkipInstrSet || Tracing._shouldSkipUrl(skipUrls, resource);
|
|
667
|
+
if (!suspendInstrumentation) {
|
|
652
668
|
activity = instr.startActivity(activityName || defaultActivityNameForFetch);
|
|
653
669
|
}
|
|
654
|
-
else {
|
|
670
|
+
else if (isSkipInstrSet) {
|
|
655
671
|
Tracing._reqIndex += 1;
|
|
656
672
|
try {
|
|
657
673
|
if (resource instanceof URL) {
|
|
@@ -677,7 +693,7 @@ class Tracing {
|
|
|
677
693
|
url = resource.url;
|
|
678
694
|
absoluteUrl = utility.tryGetAbsoluteUrl(url);
|
|
679
695
|
}
|
|
680
|
-
const traceHeaders = Tracing._getTraceHeaders(activity, tracingHeadersOptions, method, absoluteUrl);
|
|
696
|
+
const traceHeaders = Tracing._getTraceHeaders(activity, instr, tracingHeadersOptions, method, absoluteUrl);
|
|
681
697
|
if (!this._applyTraceHeaders(resource, options, traceHeaders) &&
|
|
682
698
|
options === undefined) {
|
|
683
699
|
options = {
|
|
@@ -689,7 +705,7 @@ class Tracing {
|
|
|
689
705
|
return await Tracing._originalFetch.call(Tracing._global, resource, options, ...restArgs);
|
|
690
706
|
}
|
|
691
707
|
catch (ex) {
|
|
692
|
-
if (logErrors) {
|
|
708
|
+
if (logErrors && !suspendInstrumentation) {
|
|
693
709
|
if (activity) {
|
|
694
710
|
activity.error(ex);
|
|
695
711
|
}
|
|
@@ -735,7 +751,7 @@ class Tracing {
|
|
|
735
751
|
}
|
|
736
752
|
return undefined;
|
|
737
753
|
}
|
|
738
|
-
_overrideXhr(instr, logErrors, activityName, useTracing, options, tasker) {
|
|
754
|
+
_overrideXhr(instr, logErrors, activityName, useTracing, options, tasker, skipUrls) {
|
|
739
755
|
Tracing._originalXhr = Tracing._global.XMLHttpRequest;
|
|
740
756
|
Tracing._originalXhrOpen = Tracing._originalXhr.prototype.open;
|
|
741
757
|
Tracing._originalXhrSetRequestHeader = Tracing._originalXhr.prototype.setRequestHeader;
|
|
@@ -761,6 +777,7 @@ class Tracing {
|
|
|
761
777
|
url: url === null || url === void 0 ? void 0 : url.toString()
|
|
762
778
|
};
|
|
763
779
|
this._o11y.absoluteUrl = utility.tryGetAbsoluteUrl(this._o11y.url);
|
|
780
|
+
this._o11y.suspendInstrumentation = Tracing._shouldSkipUrl(skipUrls, this._o11y.absoluteUrl);
|
|
764
781
|
Tracing._originalXhrOpen.apply(this, arguments);
|
|
765
782
|
};
|
|
766
783
|
Tracing._originalXhr.prototype.setRequestHeader = function (name, value) {
|
|
@@ -771,14 +788,17 @@ class Tracing {
|
|
|
771
788
|
Tracing._originalXhrSetRequestHeader.apply(this, arguments);
|
|
772
789
|
};
|
|
773
790
|
Tracing._originalXhr.prototype.send = function (...args) {
|
|
791
|
+
var _a;
|
|
774
792
|
let activity;
|
|
775
793
|
const xhr = this;
|
|
776
794
|
try {
|
|
777
795
|
tasker === null || tasker === void 0 ? void 0 : tasker.add();
|
|
778
796
|
xhr._o11y = xhr._o11y || {};
|
|
779
|
-
xhr._o11y.
|
|
797
|
+
if (!xhr._o11y.suspendInstrumentation) {
|
|
798
|
+
xhr._o11y.activity = activity = instr.startActivity(activityName || defaultActivityNameForXhrSend);
|
|
799
|
+
}
|
|
780
800
|
if (useTracing) {
|
|
781
|
-
const traceHeaders = Tracing._getTraceHeaders(activity, options, xhr._o11y.method, xhr._o11y.absoluteUrl);
|
|
801
|
+
const traceHeaders = Tracing._getTraceHeaders(activity, instr, options, xhr._o11y.method, xhr._o11y.absoluteUrl);
|
|
782
802
|
Object.entries(traceHeaders).forEach((entry) => {
|
|
783
803
|
xhr.setRequestHeader(entry[0], entry[1]);
|
|
784
804
|
});
|
|
@@ -787,7 +807,7 @@ class Tracing {
|
|
|
787
807
|
Tracing._originalXhrSend.call(this, ...args);
|
|
788
808
|
}
|
|
789
809
|
catch (ex) {
|
|
790
|
-
if (logErrors) {
|
|
810
|
+
if (logErrors && !((_a = xhr._o11y) === null || _a === void 0 ? void 0 : _a.suspendInstrumentation)) {
|
|
791
811
|
if (activity) {
|
|
792
812
|
activity.error(ex);
|
|
793
813
|
}
|
|
@@ -808,11 +828,11 @@ class Tracing {
|
|
|
808
828
|
tasker === null || tasker === void 0 ? void 0 : tasker.done();
|
|
809
829
|
});
|
|
810
830
|
newXhr.addEventListener('error', (__err) => {
|
|
811
|
-
var _a;
|
|
831
|
+
var _a, _b;
|
|
812
832
|
try {
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
const activity = (
|
|
833
|
+
if (logErrors && !((_a = newXhr._o11y) === null || _a === void 0 ? void 0 : _a.suspendInstrumentation)) {
|
|
834
|
+
const error = new Error('XHR Network-Level Error');
|
|
835
|
+
const activity = (_b = newXhr._o11y) === null || _b === void 0 ? void 0 : _b.activity;
|
|
816
836
|
if (activity) {
|
|
817
837
|
activity.error(error);
|
|
818
838
|
}
|
|
@@ -883,6 +903,24 @@ class Tracing {
|
|
|
883
903
|
}
|
|
884
904
|
return false;
|
|
885
905
|
}
|
|
906
|
+
static _shouldSkipUrl(skipUrls, urlLike) {
|
|
907
|
+
var _a;
|
|
908
|
+
let url = urlLike;
|
|
909
|
+
if (urlLike instanceof URL) {
|
|
910
|
+
url = (_a = urlLike.toString) === null || _a === void 0 ? void 0 : _a.call(urlLike);
|
|
911
|
+
}
|
|
912
|
+
else if (urlLike instanceof Request) {
|
|
913
|
+
url = urlLike.url;
|
|
914
|
+
}
|
|
915
|
+
return skipUrls === null || skipUrls === void 0 ? void 0 : skipUrls.some((skipUrl) => {
|
|
916
|
+
if (skipUrl instanceof RegExp) {
|
|
917
|
+
return skipUrl.test(url);
|
|
918
|
+
}
|
|
919
|
+
else {
|
|
920
|
+
return url === skipUrl;
|
|
921
|
+
}
|
|
922
|
+
});
|
|
923
|
+
}
|
|
886
924
|
}
|
|
887
925
|
Tracing._global = utility.getGlobal();
|
|
888
926
|
Tracing._isNetworkInstrumentationEnabled = false;
|
|
@@ -961,7 +999,7 @@ class ActivityImpl {
|
|
|
961
999
|
error = new Error(error);
|
|
962
1000
|
}
|
|
963
1001
|
this._onError(error, this._getDetail(userSchemaOrText, userData));
|
|
964
|
-
});
|
|
1002
|
+
}, { op: 'activity.error' });
|
|
965
1003
|
}
|
|
966
1004
|
stop(userSchemaOrText, userData, options) {
|
|
967
1005
|
this._safety.tryCatch(() => {
|
|
@@ -990,7 +1028,7 @@ class ActivityImpl {
|
|
|
990
1028
|
}
|
|
991
1029
|
}
|
|
992
1030
|
this._stopInternal(userSchemaOrText, userData, options);
|
|
993
|
-
});
|
|
1031
|
+
}, { op: 'activity.stop' });
|
|
994
1032
|
}
|
|
995
1033
|
_overrideTimer(perfStartTime, perfStopTime) {
|
|
996
1034
|
if (perfStartTime !== undefined) {
|
|
@@ -1049,13 +1087,13 @@ class ActivityImpl {
|
|
|
1049
1087
|
this._safety.tryCatch(() => {
|
|
1050
1088
|
this._stopReason = this._stopReason || stopReason.discarded;
|
|
1051
1089
|
this.stop();
|
|
1052
|
-
});
|
|
1090
|
+
}, { op: 'activity.discard' });
|
|
1053
1091
|
}
|
|
1054
1092
|
terminate(userSchemaOrText, userData, options) {
|
|
1055
1093
|
this._safety.tryCatch(() => {
|
|
1056
1094
|
this._stopReason = this._stopReason || stopReason.terminated;
|
|
1057
1095
|
this.stop(userSchemaOrText, userData, options);
|
|
1058
|
-
});
|
|
1096
|
+
}, { op: 'activity.terminate' });
|
|
1059
1097
|
}
|
|
1060
1098
|
getIsSampled() {
|
|
1061
1099
|
return this._isSampled || false;
|
|
@@ -1249,56 +1287,6 @@ class BucketHistogramImpl {
|
|
|
1249
1287
|
}
|
|
1250
1288
|
}
|
|
1251
1289
|
|
|
1252
|
-
class UpCounterImpl {
|
|
1253
|
-
constructor(_name, _ownerName, _ownerAppName, _tags, createdOn, lastUpdatedOn, value) {
|
|
1254
|
-
this._name = _name;
|
|
1255
|
-
this._ownerName = _ownerName;
|
|
1256
|
-
this._ownerAppName = _ownerAppName;
|
|
1257
|
-
this._tags = _tags;
|
|
1258
|
-
this._value = 0;
|
|
1259
|
-
this._createdOn = createdOn === undefined ? utility.time().tsNow : createdOn;
|
|
1260
|
-
if (lastUpdatedOn !== undefined) {
|
|
1261
|
-
this._lastUpdatedOn = lastUpdatedOn;
|
|
1262
|
-
}
|
|
1263
|
-
if (value !== undefined) {
|
|
1264
|
-
this._value = value;
|
|
1265
|
-
}
|
|
1266
|
-
}
|
|
1267
|
-
getName() {
|
|
1268
|
-
return this._name;
|
|
1269
|
-
}
|
|
1270
|
-
getCreatedOn() {
|
|
1271
|
-
return this._createdOn;
|
|
1272
|
-
}
|
|
1273
|
-
getLastUpdatedOn() {
|
|
1274
|
-
return this._lastUpdatedOn;
|
|
1275
|
-
}
|
|
1276
|
-
getData() {
|
|
1277
|
-
return this._value;
|
|
1278
|
-
}
|
|
1279
|
-
increment(value = 1) {
|
|
1280
|
-
if (typeof value === 'number' && value > 0) {
|
|
1281
|
-
this._value += Math.round(value);
|
|
1282
|
-
this._lastUpdatedOn = utility.time().tsNow;
|
|
1283
|
-
return;
|
|
1284
|
-
}
|
|
1285
|
-
throw new Error('UpCounter can only increment positive numbers.');
|
|
1286
|
-
}
|
|
1287
|
-
reset() {
|
|
1288
|
-
this._lastUpdatedOn = undefined;
|
|
1289
|
-
this._value = 0;
|
|
1290
|
-
}
|
|
1291
|
-
getOwnerName() {
|
|
1292
|
-
return this._ownerName;
|
|
1293
|
-
}
|
|
1294
|
-
getOwnerAppName() {
|
|
1295
|
-
return this._ownerAppName;
|
|
1296
|
-
}
|
|
1297
|
-
getTags() {
|
|
1298
|
-
return this._tags;
|
|
1299
|
-
}
|
|
1300
|
-
}
|
|
1301
|
-
|
|
1302
1290
|
class ValueRecorderImpl {
|
|
1303
1291
|
constructor(_name, _ownerName, _ownerAppName, _tags, createdOn, lastUpdatedOn, values) {
|
|
1304
1292
|
this._name = _name;
|
|
@@ -1537,6 +1525,9 @@ class InstrumentationImpl {
|
|
|
1537
1525
|
var _a, _b;
|
|
1538
1526
|
return ((_b = (_a = options === null || options === void 0 ? void 0 : options.instrumentationContext) === null || _a === void 0 ? void 0 : _a.rootId) !== null && _b !== void 0 ? _b : this._nextGen.getDefaultInstrumentationContext().rootId);
|
|
1539
1527
|
}
|
|
1528
|
+
get internalInstrumentationContext() {
|
|
1529
|
+
return this._nextGen.getDefaultInstrumentationContext();
|
|
1530
|
+
}
|
|
1540
1531
|
log(userSchemaOrText, userData, options) {
|
|
1541
1532
|
this._safety.tryCatch(() => {
|
|
1542
1533
|
const timestamp = utility.time().tsNow;
|
|
@@ -1547,7 +1538,7 @@ class InstrumentationImpl {
|
|
|
1547
1538
|
if (userPayload === null || userPayload === void 0 ? void 0 : userPayload.payload) {
|
|
1548
1539
|
this._logInternal(this.name, userPayload.schema, userPayload.payload, timestamp, this._getEffectiveRootId(options));
|
|
1549
1540
|
}
|
|
1550
|
-
});
|
|
1541
|
+
}, { op: 'log' });
|
|
1551
1542
|
}
|
|
1552
1543
|
_logInternal(loggerName, schema, data, timestamp, rootId) {
|
|
1553
1544
|
const sequence = this._nextGen.addLog(loggerName, schema, data, timestamp, rootId);
|
|
@@ -1571,7 +1562,7 @@ class InstrumentationImpl {
|
|
|
1571
1562
|
utility.requireArgumentIfDefined(options, 'options', 'object');
|
|
1572
1563
|
const rootId = this._getEffectiveRootId(options);
|
|
1573
1564
|
this._errorInternal(error, userSchemaOrText, userData, undefined, rootId);
|
|
1574
|
-
});
|
|
1565
|
+
}, { op: 'error' });
|
|
1575
1566
|
}
|
|
1576
1567
|
_errorInternal(err, userSchemaOrText, userData, activityId, rootActivityId) {
|
|
1577
1568
|
const loggedTimestamp = utility.time().tsNow;
|
|
@@ -1619,7 +1610,7 @@ class InstrumentationImpl {
|
|
|
1619
1610
|
}
|
|
1620
1611
|
const activity = new ActivityImpl(name, context.rootId, this._onActivityStoppedCallback, this._onActivityErrorCallback, maxActivityDurationMsecs, options === null || options === void 0 ? void 0 : options.id, context.isRootActivitySampled, options === null || options === void 0 ? void 0 : options.perfStartOverride, noRerooting);
|
|
1621
1612
|
return activity;
|
|
1622
|
-
}, activityNoOp);
|
|
1613
|
+
}, activityNoOp, { op: 'startActivity' });
|
|
1623
1614
|
}
|
|
1624
1615
|
_getActivityData(detail) {
|
|
1625
1616
|
const userPayload = this._wrapUserPayload(detail.userSchemaOrText, detail.userData, true);
|
|
@@ -1697,7 +1688,7 @@ class InstrumentationImpl {
|
|
|
1697
1688
|
default:
|
|
1698
1689
|
throw new Error(utility.notImplemented);
|
|
1699
1690
|
}
|
|
1700
|
-
});
|
|
1691
|
+
}, { op: 'domEvent' });
|
|
1701
1692
|
}
|
|
1702
1693
|
incrementCounter(operation, increment = 1, hasError = false, tags = {}) {
|
|
1703
1694
|
this._safety.tryCatch(() => {
|
|
@@ -1715,7 +1706,7 @@ class InstrumentationImpl {
|
|
|
1715
1706
|
]);
|
|
1716
1707
|
});
|
|
1717
1708
|
this._metrics.incrementCounter(operation, increment, hasError, tags);
|
|
1718
|
-
});
|
|
1709
|
+
}, { op: 'incrementCounter' });
|
|
1719
1710
|
}
|
|
1720
1711
|
trackValue(operation, value, hasError = false, tags = {}) {
|
|
1721
1712
|
this._safety.tryCatch(() => {
|
|
@@ -1733,7 +1724,7 @@ class InstrumentationImpl {
|
|
|
1733
1724
|
]);
|
|
1734
1725
|
});
|
|
1735
1726
|
this._metrics.trackValue(operation, value, hasError, tags);
|
|
1736
|
-
});
|
|
1727
|
+
}, { op: 'trackValue' });
|
|
1737
1728
|
}
|
|
1738
1729
|
bucketValue(operation, value, buckets = [], hasError = false, tags = {}) {
|
|
1739
1730
|
this._safety.tryCatch(() => {
|
|
@@ -1755,7 +1746,7 @@ class InstrumentationImpl {
|
|
|
1755
1746
|
]);
|
|
1756
1747
|
});
|
|
1757
1748
|
this._metrics.bucketValue(operation, value, buckets, hasError, tags);
|
|
1758
|
-
});
|
|
1749
|
+
}, { op: 'bucketValue' });
|
|
1759
1750
|
}
|
|
1760
1751
|
getUpCounters() {
|
|
1761
1752
|
return this._metrics.getUpCounters().filter((m) => m.getLastUpdatedOn());
|
|
@@ -1942,7 +1933,7 @@ class AppInstrumentationImpl extends InstrumentationImpl {
|
|
|
1942
1933
|
this._singleRootActivity = newRootActivity;
|
|
1943
1934
|
}
|
|
1944
1935
|
return newRootActivity;
|
|
1945
|
-
}, rootActivityNoOp);
|
|
1936
|
+
}, rootActivityNoOp, { op: 'startRootActivity' });
|
|
1946
1937
|
}
|
|
1947
1938
|
_handleRootActivityStop(detail) {
|
|
1948
1939
|
const historyEntry = this._rootActivityHistory.findById(detail.id);
|
|
@@ -2268,6 +2259,7 @@ class NextgenImpl {
|
|
|
2268
2259
|
if (instr) {
|
|
2269
2260
|
throw new Error(`The instrumentation name ${name} is already taken`);
|
|
2270
2261
|
}
|
|
2262
|
+
co11y.setOwnerAppName(name);
|
|
2271
2263
|
this._initOpMode(options === null || options === void 0 ? void 0 : options.operationMode);
|
|
2272
2264
|
this._isSender = this._opMode === 'sender';
|
|
2273
2265
|
this._isReceiver = this._opMode === 'receiver';
|
|
@@ -2492,18 +2484,27 @@ class NextgenImpl {
|
|
|
2492
2484
|
}
|
|
2493
2485
|
_getAllUpCounters() {
|
|
2494
2486
|
var _a;
|
|
2495
|
-
|
|
2496
|
-
|
|
2487
|
+
return (((_a = this._metricsStore) === null || _a === void 0 ? void 0 : _a.getUpCounters()) || [])
|
|
2488
|
+
.concat(Array.from(this._instruments.values())
|
|
2489
|
+
.map((instr) => instr.getUpCounters())
|
|
2490
|
+
.flat())
|
|
2491
|
+
.concat(co11y.getUpCounters());
|
|
2497
2492
|
}
|
|
2498
2493
|
_getAllValueRecorders() {
|
|
2499
2494
|
var _a;
|
|
2500
|
-
|
|
2501
|
-
|
|
2495
|
+
return (((_a = this._metricsStore) === null || _a === void 0 ? void 0 : _a.getValueRecorders()) || [])
|
|
2496
|
+
.concat(Array.from(this._instruments.values())
|
|
2497
|
+
.map((instr) => instr.getValueRecorders())
|
|
2498
|
+
.flat())
|
|
2499
|
+
.concat(co11y.getValueRecorders());
|
|
2502
2500
|
}
|
|
2503
2501
|
_getAllBucketHistograms() {
|
|
2504
2502
|
var _a;
|
|
2505
|
-
|
|
2506
|
-
|
|
2503
|
+
return (((_a = this._metricsStore) === null || _a === void 0 ? void 0 : _a.getBucketHistograms()) || [])
|
|
2504
|
+
.concat(Array.from(this._instruments.values())
|
|
2505
|
+
.map((instr) => instr.getBucketHistograms())
|
|
2506
|
+
.flat())
|
|
2507
|
+
.concat(co11y.getBucketHistograms());
|
|
2507
2508
|
}
|
|
2508
2509
|
registerForLogPrompt(listener) {
|
|
2509
2510
|
this._logCollectionListeners.add(listener);
|
|
@@ -2654,7 +2655,7 @@ class ConsoleCollector {
|
|
|
2654
2655
|
}
|
|
2655
2656
|
}
|
|
2656
2657
|
|
|
2657
|
-
const version = '252.
|
|
2658
|
+
const version = '252.8.0';
|
|
2658
2659
|
|
|
2659
2660
|
const idleDetector = new IdleDetectorImpl({
|
|
2660
2661
|
logThreshold: 300,
|