@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,11 +1,11 @@
|
|
|
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) {
|
|
6
6
|
var undef = "undefined";
|
|
7
|
-
var nsKey, key, nm, theExports = {}, modName = "
|
|
8
|
-
var mods={}, modDetail=mods[modName]={}, ver="3.0.3-nightly3.2308-
|
|
7
|
+
var nsKey, key, nm, theExports = {}, modName = "es5_applicationinsights_common_3_0_3_nightly3_2308_16", msMod="__ms$mod__";
|
|
8
|
+
var mods={}, modDetail=mods[modName]={}, ver="3.0.3-nightly3.2308-16";
|
|
9
9
|
var baseNs=global, nsKey="Microsoft", baseNs=baseNs[nsKey]=(baseNs[nsKey]||{});
|
|
10
10
|
// Versioned namespace "Microsoft.ApplicationInsights3"
|
|
11
11
|
var exportNs=baseNs, nsKey="ApplicationInsights3", exportNs=exportNs[nsKey]=(exportNs[nsKey]||{});
|
|
@@ -707,6 +707,7 @@ var _DYN_MESSAGE_ID = "messageId";
|
|
|
707
707
|
var _DYN_MESSAGE$1 = "message";
|
|
708
708
|
var _DYN_DIAG_LOG = "diagLog";
|
|
709
709
|
var _DYN_USER_AGENT = "userAgent";
|
|
710
|
+
var _DYN_SPLIT$1 = "split";
|
|
710
711
|
var _DYN_REPLACE = "replace";
|
|
711
712
|
var _DYN_LOG_INTERNAL_MESSAGE = "logInternalMessage";
|
|
712
713
|
var _DYN_TRACE_ID = "traceId";
|
|
@@ -1225,7 +1226,7 @@ function newId(maxLength) {
|
|
|
1225
1226
|
return result;
|
|
1226
1227
|
}
|
|
1227
1228
|
|
|
1228
|
-
var version = '3.0.3-nightly3.2308-
|
|
1229
|
+
var version = '3.0.3-nightly3.2308-16';
|
|
1229
1230
|
var instanceName = "." + newId(6);
|
|
1230
1231
|
var _dataUid = 0;
|
|
1231
1232
|
function createUniqueNamespace(name, includeVersion) {
|
|
@@ -2099,7 +2100,7 @@ function createTraceParent(traceId, spanId, flags, version) {
|
|
|
2099
2100
|
_a.traceFlags = flags >= 0 && flags <= 0xFF ? flags : 1,
|
|
2100
2101
|
_a;
|
|
2101
2102
|
}
|
|
2102
|
-
function parseTraceParent(value) {
|
|
2103
|
+
function parseTraceParent(value, selectIdx) {
|
|
2103
2104
|
var _a;
|
|
2104
2105
|
if (!value) {
|
|
2105
2106
|
return null;
|
|
@@ -2110,6 +2111,10 @@ function parseTraceParent(value) {
|
|
|
2110
2111
|
if (!value || !isString(value) || value[_DYN_LENGTH$1 ] > 8192) {
|
|
2111
2112
|
return null;
|
|
2112
2113
|
}
|
|
2114
|
+
if (value.indexOf(",") !== -1) {
|
|
2115
|
+
var values = value[_DYN_SPLIT$1 ](",");
|
|
2116
|
+
value = values[selectIdx > 0 && values[_DYN_LENGTH$1 ] > selectIdx ? selectIdx : 0];
|
|
2117
|
+
}
|
|
2113
2118
|
var match = TRACE_PARENT_REGEX.exec(strTrim(value));
|
|
2114
2119
|
if (!match ||
|
|
2115
2120
|
match[1] === INVALID_VERSION ||
|
|
@@ -2161,11 +2166,11 @@ function formatTraceParent(value) {
|
|
|
2161
2166
|
}
|
|
2162
2167
|
return "";
|
|
2163
2168
|
}
|
|
2164
|
-
function findW3cTraceParent() {
|
|
2169
|
+
function findW3cTraceParent(selectIdx) {
|
|
2165
2170
|
var name = "traceparent";
|
|
2166
|
-
var traceParent = parseTraceParent(findMetaTag(name));
|
|
2171
|
+
var traceParent = parseTraceParent(findMetaTag(name), selectIdx);
|
|
2167
2172
|
if (!traceParent) {
|
|
2168
|
-
traceParent = parseTraceParent(findNamedServerTiming(name));
|
|
2173
|
+
traceParent = parseTraceParent(findNamedServerTiming(name), selectIdx);
|
|
2169
2174
|
}
|
|
2170
2175
|
return traceParent;
|
|
2171
2176
|
}
|
|
@@ -2756,7 +2761,8 @@ var ThrottleMgr = /** @class */ (function () {
|
|
|
2756
2761
|
};
|
|
2757
2762
|
_self.canThrottle = function (msgId) {
|
|
2758
2763
|
var localObj = _getLocalStorageObjByKey(msgId);
|
|
2759
|
-
|
|
2764
|
+
var cfg = _getCfgByKey(msgId);
|
|
2765
|
+
return _canThrottle(cfg, _canUseLocalStorage, localObj);
|
|
2760
2766
|
};
|
|
2761
2767
|
_self.isTriggered = function (msgId) {
|
|
2762
2768
|
return _isTrigger(msgId);
|
|
@@ -2808,18 +2814,19 @@ var ThrottleMgr = /** @class */ (function () {
|
|
|
2808
2814
|
};
|
|
2809
2815
|
function _flushMessage(msgID, message, severity, saveUnsentMsg) {
|
|
2810
2816
|
if (_isReady) {
|
|
2811
|
-
var isSampledIn = _canSampledIn();
|
|
2817
|
+
var isSampledIn = _canSampledIn(msgID);
|
|
2812
2818
|
if (!isSampledIn) {
|
|
2813
2819
|
return;
|
|
2814
2820
|
}
|
|
2821
|
+
var cfg = _getCfgByKey(msgID);
|
|
2815
2822
|
var localStorageObj = _getLocalStorageObjByKey(msgID);
|
|
2816
|
-
var canThrottle = _canThrottle(
|
|
2823
|
+
var canThrottle = _canThrottle(cfg, _canUseLocalStorage, localStorageObj);
|
|
2817
2824
|
var throttled = false;
|
|
2818
2825
|
var number = 0;
|
|
2819
2826
|
var isTriggered = _isTrigger(msgID);
|
|
2820
2827
|
try {
|
|
2821
2828
|
if (canThrottle && !isTriggered) {
|
|
2822
|
-
number = Math.min(
|
|
2829
|
+
number = Math.min(cfg.limit.maxSendNumber, localStorageObj[_DYN_COUNT ] + 1);
|
|
2823
2830
|
localStorageObj[_DYN_COUNT ] = 0;
|
|
2824
2831
|
throttled = true;
|
|
2825
2832
|
_isTriggered[msgID] = true;
|
|
@@ -2859,23 +2866,39 @@ var ThrottleMgr = /** @class */ (function () {
|
|
|
2859
2866
|
_isTriggered = {};
|
|
2860
2867
|
_localStorageObj = {};
|
|
2861
2868
|
_queue = {};
|
|
2869
|
+
_config = {};
|
|
2870
|
+
_setCfgByKey(109 );
|
|
2862
2871
|
_namePrefix = isNotNullOrUndefined(namePrefix) ? namePrefix : "";
|
|
2863
2872
|
core.addUnloadHook(onConfigChange(core.config, function (details) {
|
|
2864
|
-
var _a, _b;
|
|
2865
2873
|
var coreConfig = details.cfg;
|
|
2866
2874
|
_canUseLocalStorage = utlCanUseLocalStorage();
|
|
2867
2875
|
var configMgr = coreConfig.throttleMgrCfg || {};
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2876
|
+
objForEachKey(configMgr, function (key, cfg) {
|
|
2877
|
+
_setCfgByKey(parseInt(key), cfg);
|
|
2878
|
+
});
|
|
2879
|
+
}));
|
|
2880
|
+
}
|
|
2881
|
+
function _getCfgByKey(msgID) {
|
|
2882
|
+
return _config[msgID] || _config[109 ];
|
|
2883
|
+
}
|
|
2884
|
+
function _setCfgByKey(msgID, config) {
|
|
2885
|
+
var _a, _b;
|
|
2886
|
+
try {
|
|
2887
|
+
var cfg = config || {};
|
|
2888
|
+
var curCfg = {};
|
|
2889
|
+
curCfg[_DYN_DISABLED ] = !!cfg[_DYN_DISABLED ];
|
|
2890
|
+
var configInterval = cfg[_DYN_INTERVAL ] || {};
|
|
2871
2891
|
_isSpecificDaysGiven = (configInterval === null || configInterval === void 0 ? void 0 : configInterval.daysOfMonth) && (configInterval === null || configInterval === void 0 ? void 0 : configInterval.daysOfMonth[_DYN_LENGTH ]) > 0;
|
|
2872
|
-
|
|
2892
|
+
curCfg[_DYN_INTERVAL ] = _getIntervalConfig(configInterval);
|
|
2873
2893
|
var limit = {
|
|
2874
|
-
samplingRate: ((_a =
|
|
2875
|
-
maxSendNumber: ((_b =
|
|
2894
|
+
samplingRate: ((_a = cfg.limit) === null || _a === void 0 ? void 0 : _a.samplingRate) || 100,
|
|
2895
|
+
maxSendNumber: ((_b = cfg.limit) === null || _b === void 0 ? void 0 : _b.maxSendNumber) || 1
|
|
2876
2896
|
};
|
|
2877
|
-
|
|
2878
|
-
|
|
2897
|
+
curCfg.limit = limit;
|
|
2898
|
+
_config[msgID] = curCfg;
|
|
2899
|
+
}
|
|
2900
|
+
catch (e) {
|
|
2901
|
+
}
|
|
2879
2902
|
}
|
|
2880
2903
|
function _getIntervalConfig(interval) {
|
|
2881
2904
|
interval = interval || {};
|
|
@@ -2896,7 +2919,7 @@ var ThrottleMgr = /** @class */ (function () {
|
|
|
2896
2919
|
return interval;
|
|
2897
2920
|
}
|
|
2898
2921
|
function _canThrottle(config, canUseLocalStorage, localStorageObj) {
|
|
2899
|
-
if (!config[_DYN_DISABLED ] && canUseLocalStorage && isNotNullOrUndefined(localStorageObj)) {
|
|
2922
|
+
if (config && !config[_DYN_DISABLED ] && canUseLocalStorage && isNotNullOrUndefined(localStorageObj)) {
|
|
2900
2923
|
var curDate = _getThrottleDate();
|
|
2901
2924
|
var date = localStorageObj[_DYN_DATE ];
|
|
2902
2925
|
var interval = config[_DYN_INTERVAL ];
|
|
@@ -2994,8 +3017,14 @@ var ThrottleMgr = /** @class */ (function () {
|
|
|
2994
3017
|
function _sendMessage(msgID, logger, message, severity) {
|
|
2995
3018
|
_throwInternal(logger, severity || 1 , msgID, message);
|
|
2996
3019
|
}
|
|
2997
|
-
function _canSampledIn() {
|
|
2998
|
-
|
|
3020
|
+
function _canSampledIn(msgID) {
|
|
3021
|
+
try {
|
|
3022
|
+
var cfg = _getCfgByKey(msgID);
|
|
3023
|
+
return randomValue(1000000) <= cfg.limit.samplingRate;
|
|
3024
|
+
}
|
|
3025
|
+
catch (e) {
|
|
3026
|
+
}
|
|
3027
|
+
return false;
|
|
2999
3028
|
}
|
|
3000
3029
|
function _getLocalStorageObjByKey(key) {
|
|
3001
3030
|
try {
|