@microsoft/applicationinsights-common 3.0.3-nightly3.2308-10 → 3.0.3-nightly3.2308-16
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/browser/es5/applicationinsights-common.cjs.js +51 -22
- package/browser/es5/applicationinsights-common.cjs.js.map +1 -1
- package/browser/es5/applicationinsights-common.cjs.min.js +2 -2
- package/browser/es5/applicationinsights-common.cjs.min.js.map +1 -1
- package/browser/es5/applicationinsights-common.gbl.js +53 -24
- package/browser/es5/applicationinsights-common.gbl.js.map +1 -1
- package/browser/es5/applicationinsights-common.gbl.min.js +2 -2
- package/browser/es5/applicationinsights-common.gbl.min.js.map +1 -1
- package/browser/es5/applicationinsights-common.integrity.json +25 -25
- package/browser/es5/applicationinsights-common.js +53 -24
- package/browser/es5/applicationinsights-common.js.map +1 -1
- package/browser/es5/applicationinsights-common.min.js +2 -2
- package/browser/es5/applicationinsights-common.min.js.map +1 -1
- package/dist/es5/applicationinsights-common.js +51 -22
- package/dist/es5/applicationinsights-common.js.map +1 -1
- package/dist/es5/applicationinsights-common.min.js +2 -2
- package/dist/es5/applicationinsights-common.min.js.map +1 -1
- package/dist-es5/ConnectionStringParser.js +1 -1
- package/dist-es5/Constants.js +1 -1
- package/dist-es5/DomHelperFuncs.js +1 -1
- package/dist-es5/Enums.js +1 -1
- package/dist-es5/HelperFuncs.js +1 -1
- package/dist-es5/Interfaces/ConnectionString.js +1 -1
- package/dist-es5/Interfaces/Context/IApplication.js +1 -1
- package/dist-es5/Interfaces/Context/IDevice.js +1 -1
- package/dist-es5/Interfaces/Context/IInternal.js +1 -1
- package/dist-es5/Interfaces/Context/ILocation.js +1 -1
- package/dist-es5/Interfaces/Context/IOperatingSystem.js +1 -1
- package/dist-es5/Interfaces/Context/ISample.js +1 -1
- package/dist-es5/Interfaces/Context/ISession.js +1 -1
- package/dist-es5/Interfaces/Context/ISessionManager.js +1 -1
- package/dist-es5/Interfaces/Context/ITelemetryTrace.js +1 -1
- package/dist-es5/Interfaces/Context/IUser.js +1 -1
- package/dist-es5/Interfaces/Context/IWeb.js +1 -1
- package/dist-es5/Interfaces/Contracts/AvailabilityData.js +1 -1
- package/dist-es5/Interfaces/Contracts/ContextTagKeys.js +1 -1
- package/dist-es5/Interfaces/Contracts/DataPointType.js +1 -1
- package/dist-es5/Interfaces/Contracts/DependencyKind.js +1 -1
- package/dist-es5/Interfaces/Contracts/DependencySourceType.js +1 -1
- package/dist-es5/Interfaces/Contracts/IBase.js +1 -1
- package/dist-es5/Interfaces/Contracts/IData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IDataPoint.js +1 -1
- package/dist-es5/Interfaces/Contracts/IDomain.js +1 -1
- package/dist-es5/Interfaces/Contracts/IEnvelope.js +1 -1
- package/dist-es5/Interfaces/Contracts/IEventData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IExceptionData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IExceptionDetails.js +1 -1
- package/dist-es5/Interfaces/Contracts/IMessageData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IMetricData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IPageViewData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IPageViewPerfData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IRemoteDependencyData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IStackFrame.js +1 -1
- package/dist-es5/Interfaces/Contracts/RequestData.js +1 -1
- package/dist-es5/Interfaces/Contracts/SeverityLevel.js +1 -1
- package/dist-es5/Interfaces/IAppInsights.js +1 -1
- package/dist-es5/Interfaces/IConfig.js +1 -1
- package/dist-es5/Interfaces/ICorrelationConfig.js +1 -1
- package/dist-es5/Interfaces/IDependencyTelemetry.js +1 -1
- package/dist-es5/Interfaces/IEventTelemetry.js +1 -1
- package/dist-es5/Interfaces/IExceptionTelemetry.js +1 -1
- package/dist-es5/Interfaces/IMetricTelemetry.js +1 -1
- package/dist-es5/Interfaces/IPageViewPerformanceTelemetry.js +1 -1
- package/dist-es5/Interfaces/IPageViewTelemetry.js +1 -1
- package/dist-es5/Interfaces/IPartC.js +1 -1
- package/dist-es5/Interfaces/IPropertiesPlugin.js +1 -1
- package/dist-es5/Interfaces/IRequestContext.js +1 -1
- package/dist-es5/Interfaces/IStorageBuffer.js +1 -1
- package/dist-es5/Interfaces/ITelemetryContext.js +1 -1
- package/dist-es5/Interfaces/IThrottleMgr.js +1 -1
- package/dist-es5/Interfaces/ITraceTelemetry.js +1 -1
- package/dist-es5/Interfaces/PartAExtensions.js +1 -1
- package/dist-es5/Interfaces/Telemetry/IEnvelope.js +1 -1
- package/dist-es5/Interfaces/Telemetry/ISerializable.js +1 -1
- package/dist-es5/RequestResponseHeaders.js +1 -1
- package/dist-es5/StorageHelperFuncs.js +1 -1
- package/dist-es5/Telemetry/Common/Data.js +1 -1
- package/dist-es5/Telemetry/Common/DataPoint.js +1 -1
- package/dist-es5/Telemetry/Common/DataSanitizer.js +1 -1
- package/dist-es5/Telemetry/Common/Envelope.js +1 -1
- package/dist-es5/Telemetry/Event.js +1 -1
- package/dist-es5/Telemetry/Exception.js +1 -1
- package/dist-es5/Telemetry/Metric.js +1 -1
- package/dist-es5/Telemetry/PageView.js +1 -1
- package/dist-es5/Telemetry/PageViewPerformance.js +1 -1
- package/dist-es5/Telemetry/RemoteDependencyData.js +1 -1
- package/dist-es5/Telemetry/Trace.js +1 -1
- package/dist-es5/TelemetryItemCreator.js +1 -1
- package/dist-es5/ThrottleMgr.js +44 -18
- package/dist-es5/ThrottleMgr.js.map +1 -1
- package/dist-es5/UrlHelperFuncs.js +1 -1
- package/dist-es5/Util.js +1 -1
- package/dist-es5/__DynamicConstants.js +1 -1
- package/dist-es5/applicationinsights-common.js +1 -1
- package/package.json +2 -2
- package/types/applicationinsights-common.d.ts +5 -3
- package/types/applicationinsights-common.namespaced.d.ts +5 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - Common, 3.0.3-nightly3.2308-
|
|
2
|
+
* Application Insights JavaScript SDK - Common, 3.0.3-nightly3.2308-16
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
@@ -689,6 +689,7 @@
|
|
|
689
689
|
var _DYN_MESSAGE$1 = "message";
|
|
690
690
|
var _DYN_DIAG_LOG = "diagLog";
|
|
691
691
|
var _DYN_USER_AGENT = "userAgent";
|
|
692
|
+
var _DYN_SPLIT$1 = "split";
|
|
692
693
|
var _DYN_REPLACE = "replace";
|
|
693
694
|
var _DYN_LOG_INTERNAL_MESSAGE = "logInternalMessage";
|
|
694
695
|
var _DYN_TRACE_ID = "traceId";
|
|
@@ -1207,7 +1208,7 @@
|
|
|
1207
1208
|
return result;
|
|
1208
1209
|
}
|
|
1209
1210
|
|
|
1210
|
-
var version = '3.0.3-nightly3.2308-
|
|
1211
|
+
var version = '3.0.3-nightly3.2308-16';
|
|
1211
1212
|
var instanceName = "." + newId(6);
|
|
1212
1213
|
var _dataUid = 0;
|
|
1213
1214
|
function createUniqueNamespace(name, includeVersion) {
|
|
@@ -2081,7 +2082,7 @@
|
|
|
2081
2082
|
_a.traceFlags = flags >= 0 && flags <= 0xFF ? flags : 1,
|
|
2082
2083
|
_a;
|
|
2083
2084
|
}
|
|
2084
|
-
function parseTraceParent(value) {
|
|
2085
|
+
function parseTraceParent(value, selectIdx) {
|
|
2085
2086
|
var _a;
|
|
2086
2087
|
if (!value) {
|
|
2087
2088
|
return null;
|
|
@@ -2092,6 +2093,10 @@
|
|
|
2092
2093
|
if (!value || !isString(value) || value[_DYN_LENGTH$1 ] > 8192) {
|
|
2093
2094
|
return null;
|
|
2094
2095
|
}
|
|
2096
|
+
if (value.indexOf(",") !== -1) {
|
|
2097
|
+
var values = value[_DYN_SPLIT$1 ](",");
|
|
2098
|
+
value = values[selectIdx > 0 && values[_DYN_LENGTH$1 ] > selectIdx ? selectIdx : 0];
|
|
2099
|
+
}
|
|
2095
2100
|
var match = TRACE_PARENT_REGEX.exec(strTrim(value));
|
|
2096
2101
|
if (!match ||
|
|
2097
2102
|
match[1] === INVALID_VERSION ||
|
|
@@ -2143,11 +2148,11 @@
|
|
|
2143
2148
|
}
|
|
2144
2149
|
return "";
|
|
2145
2150
|
}
|
|
2146
|
-
function findW3cTraceParent() {
|
|
2151
|
+
function findW3cTraceParent(selectIdx) {
|
|
2147
2152
|
var name = "traceparent";
|
|
2148
|
-
var traceParent = parseTraceParent(findMetaTag(name));
|
|
2153
|
+
var traceParent = parseTraceParent(findMetaTag(name), selectIdx);
|
|
2149
2154
|
if (!traceParent) {
|
|
2150
|
-
traceParent = parseTraceParent(findNamedServerTiming(name));
|
|
2155
|
+
traceParent = parseTraceParent(findNamedServerTiming(name), selectIdx);
|
|
2151
2156
|
}
|
|
2152
2157
|
return traceParent;
|
|
2153
2158
|
}
|
|
@@ -2738,7 +2743,8 @@
|
|
|
2738
2743
|
};
|
|
2739
2744
|
_self.canThrottle = function (msgId) {
|
|
2740
2745
|
var localObj = _getLocalStorageObjByKey(msgId);
|
|
2741
|
-
|
|
2746
|
+
var cfg = _getCfgByKey(msgId);
|
|
2747
|
+
return _canThrottle(cfg, _canUseLocalStorage, localObj);
|
|
2742
2748
|
};
|
|
2743
2749
|
_self.isTriggered = function (msgId) {
|
|
2744
2750
|
return _isTrigger(msgId);
|
|
@@ -2790,18 +2796,19 @@
|
|
|
2790
2796
|
};
|
|
2791
2797
|
function _flushMessage(msgID, message, severity, saveUnsentMsg) {
|
|
2792
2798
|
if (_isReady) {
|
|
2793
|
-
var isSampledIn = _canSampledIn();
|
|
2799
|
+
var isSampledIn = _canSampledIn(msgID);
|
|
2794
2800
|
if (!isSampledIn) {
|
|
2795
2801
|
return;
|
|
2796
2802
|
}
|
|
2803
|
+
var cfg = _getCfgByKey(msgID);
|
|
2797
2804
|
var localStorageObj = _getLocalStorageObjByKey(msgID);
|
|
2798
|
-
var canThrottle = _canThrottle(
|
|
2805
|
+
var canThrottle = _canThrottle(cfg, _canUseLocalStorage, localStorageObj);
|
|
2799
2806
|
var throttled = false;
|
|
2800
2807
|
var number = 0;
|
|
2801
2808
|
var isTriggered = _isTrigger(msgID);
|
|
2802
2809
|
try {
|
|
2803
2810
|
if (canThrottle && !isTriggered) {
|
|
2804
|
-
number = Math.min(
|
|
2811
|
+
number = Math.min(cfg.limit.maxSendNumber, localStorageObj[_DYN_COUNT ] + 1);
|
|
2805
2812
|
localStorageObj[_DYN_COUNT ] = 0;
|
|
2806
2813
|
throttled = true;
|
|
2807
2814
|
_isTriggered[msgID] = true;
|
|
@@ -2841,23 +2848,39 @@
|
|
|
2841
2848
|
_isTriggered = {};
|
|
2842
2849
|
_localStorageObj = {};
|
|
2843
2850
|
_queue = {};
|
|
2851
|
+
_config = {};
|
|
2852
|
+
_setCfgByKey(109 );
|
|
2844
2853
|
_namePrefix = isNotNullOrUndefined(namePrefix) ? namePrefix : "";
|
|
2845
2854
|
core.addUnloadHook(onConfigChange(core.config, function (details) {
|
|
2846
|
-
var _a, _b;
|
|
2847
2855
|
var coreConfig = details.cfg;
|
|
2848
2856
|
_canUseLocalStorage = utlCanUseLocalStorage();
|
|
2849
2857
|
var configMgr = coreConfig.throttleMgrCfg || {};
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2858
|
+
objForEachKey(configMgr, function (key, cfg) {
|
|
2859
|
+
_setCfgByKey(parseInt(key), cfg);
|
|
2860
|
+
});
|
|
2861
|
+
}));
|
|
2862
|
+
}
|
|
2863
|
+
function _getCfgByKey(msgID) {
|
|
2864
|
+
return _config[msgID] || _config[109 ];
|
|
2865
|
+
}
|
|
2866
|
+
function _setCfgByKey(msgID, config) {
|
|
2867
|
+
var _a, _b;
|
|
2868
|
+
try {
|
|
2869
|
+
var cfg = config || {};
|
|
2870
|
+
var curCfg = {};
|
|
2871
|
+
curCfg[_DYN_DISABLED ] = !!cfg[_DYN_DISABLED ];
|
|
2872
|
+
var configInterval = cfg[_DYN_INTERVAL ] || {};
|
|
2853
2873
|
_isSpecificDaysGiven = (configInterval === null || configInterval === void 0 ? void 0 : configInterval.daysOfMonth) && (configInterval === null || configInterval === void 0 ? void 0 : configInterval.daysOfMonth[_DYN_LENGTH ]) > 0;
|
|
2854
|
-
|
|
2874
|
+
curCfg[_DYN_INTERVAL ] = _getIntervalConfig(configInterval);
|
|
2855
2875
|
var limit = {
|
|
2856
|
-
samplingRate: ((_a =
|
|
2857
|
-
maxSendNumber: ((_b =
|
|
2876
|
+
samplingRate: ((_a = cfg.limit) === null || _a === void 0 ? void 0 : _a.samplingRate) || 100,
|
|
2877
|
+
maxSendNumber: ((_b = cfg.limit) === null || _b === void 0 ? void 0 : _b.maxSendNumber) || 1
|
|
2858
2878
|
};
|
|
2859
|
-
|
|
2860
|
-
|
|
2879
|
+
curCfg.limit = limit;
|
|
2880
|
+
_config[msgID] = curCfg;
|
|
2881
|
+
}
|
|
2882
|
+
catch (e) {
|
|
2883
|
+
}
|
|
2861
2884
|
}
|
|
2862
2885
|
function _getIntervalConfig(interval) {
|
|
2863
2886
|
interval = interval || {};
|
|
@@ -2878,7 +2901,7 @@
|
|
|
2878
2901
|
return interval;
|
|
2879
2902
|
}
|
|
2880
2903
|
function _canThrottle(config, canUseLocalStorage, localStorageObj) {
|
|
2881
|
-
if (!config[_DYN_DISABLED ] && canUseLocalStorage && isNotNullOrUndefined(localStorageObj)) {
|
|
2904
|
+
if (config && !config[_DYN_DISABLED ] && canUseLocalStorage && isNotNullOrUndefined(localStorageObj)) {
|
|
2882
2905
|
var curDate = _getThrottleDate();
|
|
2883
2906
|
var date = localStorageObj[_DYN_DATE ];
|
|
2884
2907
|
var interval = config[_DYN_INTERVAL ];
|
|
@@ -2976,8 +2999,14 @@
|
|
|
2976
2999
|
function _sendMessage(msgID, logger, message, severity) {
|
|
2977
3000
|
_throwInternal(logger, severity || 1 , msgID, message);
|
|
2978
3001
|
}
|
|
2979
|
-
function _canSampledIn() {
|
|
2980
|
-
|
|
3002
|
+
function _canSampledIn(msgID) {
|
|
3003
|
+
try {
|
|
3004
|
+
var cfg = _getCfgByKey(msgID);
|
|
3005
|
+
return randomValue(1000000) <= cfg.limit.samplingRate;
|
|
3006
|
+
}
|
|
3007
|
+
catch (e) {
|
|
3008
|
+
}
|
|
3009
|
+
return false;
|
|
2981
3010
|
}
|
|
2982
3011
|
function _getLocalStorageObjByKey(key) {
|
|
2983
3012
|
try {
|