@microsoft/applicationinsights-web 3.0.0-beta.2208-16 → 3.0.0-beta.2209-01

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.
Files changed (47) hide show
  1. package/browser/{ai.3.0.0-beta.2208-16.cjs.js → ai.3.0.0-beta.2209-01.cjs.js} +167 -111
  2. package/browser/{ai.3.0.0-beta.2208-16.cjs.js.map → ai.3.0.0-beta.2209-01.cjs.js.map} +1 -1
  3. package/browser/ai.3.0.0-beta.2209-01.cjs.min.js +6 -0
  4. package/browser/{ai.3.0.0-beta.2208-16.cjs.min.js.map → ai.3.0.0-beta.2209-01.cjs.min.js.map} +1 -1
  5. package/browser/{ai.3.0.0-beta.2208-16.gbl.js → ai.3.0.0-beta.2209-01.gbl.js} +167 -111
  6. package/browser/{ai.3.0.0-beta.2208-16.gbl.js.map → ai.3.0.0-beta.2209-01.gbl.js.map} +1 -1
  7. package/browser/ai.3.0.0-beta.2209-01.gbl.min.js +6 -0
  8. package/browser/{ai.3.0.0-beta.2208-16.gbl.min.js.map → ai.3.0.0-beta.2209-01.gbl.min.js.map} +1 -1
  9. package/browser/ai.3.0.0-beta.2209-01.integrity.json +66 -0
  10. package/browser/{ai.3.0.0-beta.2208-16.js → ai.3.0.0-beta.2209-01.js} +167 -111
  11. package/browser/{ai.3.0.0-beta.2208-16.js.map → ai.3.0.0-beta.2209-01.js.map} +1 -1
  12. package/browser/ai.3.0.0-beta.2209-01.min.js +6 -0
  13. package/browser/{ai.3.0.0-beta.2208-16.min.js.map → ai.3.0.0-beta.2209-01.min.js.map} +1 -1
  14. package/browser/ai.3.cjs.js +166 -110
  15. package/browser/ai.3.cjs.js.map +1 -1
  16. package/browser/ai.3.cjs.min.js +2 -2
  17. package/browser/ai.3.cjs.min.js.map +1 -1
  18. package/browser/ai.3.gbl.js +166 -110
  19. package/browser/ai.3.gbl.js.map +1 -1
  20. package/browser/ai.3.gbl.min.js +2 -2
  21. package/browser/ai.3.gbl.min.js.map +1 -1
  22. package/browser/ai.3.js +166 -110
  23. package/browser/ai.3.js.map +1 -1
  24. package/browser/ai.3.min.js +2 -2
  25. package/browser/ai.3.min.js.map +1 -1
  26. package/dist/applicationinsights-web.api.json +172 -28
  27. package/dist/applicationinsights-web.api.md +12 -6
  28. package/dist/applicationinsights-web.d.ts +96 -8
  29. package/dist/applicationinsights-web.js +166 -110
  30. package/dist/applicationinsights-web.js.map +1 -1
  31. package/dist/applicationinsights-web.min.js +2 -2
  32. package/dist/applicationinsights-web.min.js.map +1 -1
  33. package/dist/applicationinsights-web.rollup.d.ts +96 -8
  34. package/dist-esm/ApplicationInsightsContainer.js +1 -1
  35. package/dist-esm/Init.js +1 -1
  36. package/dist-esm/Initialization.js +14 -7
  37. package/dist-esm/Initialization.js.map +1 -1
  38. package/dist-esm/InternalConstants.js +1 -1
  39. package/dist-esm/__DynamicConstants.js +1 -1
  40. package/dist-esm/applicationinsights-web.js +1 -1
  41. package/package.json +7 -7
  42. package/src/Initialization.ts +17 -2
  43. package/types/Initialization.d.ts +10 -1
  44. package/browser/ai.3.0.0-beta.2208-16.cjs.min.js +0 -6
  45. package/browser/ai.3.0.0-beta.2208-16.gbl.min.js +0 -6
  46. package/browser/ai.3.0.0-beta.2208-16.integrity.json +0 -66
  47. package/browser/ai.3.0.0-beta.2208-16.min.js +0 -6
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - Web, 3.0.0-beta.2208-16
2
+ * Application Insights JavaScript SDK - Web, 3.0.0-beta.2209-01
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  this.Microsoft = this.Microsoft || {};
@@ -1634,7 +1634,7 @@ this.Microsoft = this.Microsoft || {};
1634
1634
  }
1635
1635
 
1636
1636
  var _objDefineProperty = ObjDefineProperty;
1637
- var version = "3.0.0-beta.2208-16";
1637
+ var version = "3.0.0-beta.2209-01";
1638
1638
  var instanceName = "." + newId(6);
1639
1639
  var _dataUid = 0;
1640
1640
  function _createAccessor(target, prop, value) {
@@ -5953,7 +5953,7 @@ this.Microsoft = this.Microsoft || {};
5953
5953
  }
5954
5954
  return value;
5955
5955
  }
5956
- function _getDefaultConfig(config) {
5956
+ function _getDefaultConfig$1(config) {
5957
5957
  if (!config) {
5958
5958
  config = {};
5959
5959
  }
@@ -6253,7 +6253,7 @@ this.Microsoft = this.Microsoft || {};
6253
6253
  function _populateDefaults(config) {
6254
6254
  var ctx = createProcessTelemetryContext(null, config, _self[_DYN_CORE$1 ]);
6255
6255
  var identifier = _self.identifier;
6256
- var defaults = _getDefaultConfig(config);
6256
+ var defaults = _getDefaultConfig$1(config);
6257
6257
  var extConfig = _self.config = ctx.getExtCfg(identifier);
6258
6258
  if (defaults !== undefined) {
6259
6259
  objForEachKey(defaults, function (field, value) {
@@ -6446,8 +6446,8 @@ this.Microsoft = this.Microsoft || {};
6446
6446
  });
6447
6447
  return _this;
6448
6448
  }
6449
- AnalyticsPlugin.Version = "3.0.0-beta.2208-16";
6450
- AnalyticsPlugin.getDefaultConfig = _getDefaultConfig;
6449
+ AnalyticsPlugin.Version = "3.0.0-beta.2209-01";
6450
+ AnalyticsPlugin.getDefaultConfig = _getDefaultConfig$1;
6451
6451
  return AnalyticsPlugin;
6452
6452
  }(BaseTelemetryPlugin));
6453
6453
 
@@ -6619,7 +6619,7 @@ this.Microsoft = this.Microsoft || {};
6619
6619
  }
6620
6620
  }
6621
6621
  var EnvelopeCreator = {
6622
- Version: "3.0.0-beta.2208-16"
6622
+ Version: "3.0.0-beta.2209-01"
6623
6623
  };
6624
6624
  function DependencyEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {
6625
6625
  EnvelopeCreatorInit(logger, telemetryItem);
@@ -7366,7 +7366,13 @@ this.Microsoft = this.Microsoft || {};
7366
7366
  _offlineListener = createOfflineListener(_evtNamespace);
7367
7367
  var defaultConfig = _getDefaultAppInsightsChannelConfig();
7368
7368
  objForEachKey(defaultConfig, function (field, value) {
7369
- _self[_DYN__SENDER_CONFIG ][field] = function () { return ctx.getConfig(identifier, field, value()); };
7369
+ _self[_DYN__SENDER_CONFIG ][field] = function () {
7370
+ var theValue = ctx.getConfig(identifier, field, value());
7371
+ if (!theValue && field === "endpointUrl") {
7372
+ theValue = value();
7373
+ }
7374
+ return theValue;
7375
+ };
7370
7376
  });
7371
7377
  _self._buffer = (_self[_DYN__SENDER_CONFIG ][_DYN_ENABLE_SESSION_STORA4 ]() && utlCanUseSessionStorage())
7372
7378
  ? new SessionStorageSendBuffer(diagLog, _self[_DYN__SENDER_CONFIG ]) : new ArraySendBuffer(diagLog, _self[_DYN__SENDER_CONFIG ]);
@@ -7964,17 +7970,17 @@ this.Microsoft = this.Microsoft || {};
7964
7970
  var _DYN_TRACE_ID = "traceID";
7965
7971
  var _DYN_SPAN_ID = "spanID";
7966
7972
  var _DYN_TRACE_FLAGS = "traceFlags";
7967
- var _DYN_CORE = "core";
7973
+ var _DYN_CONTEXT$1 = "context";
7968
7974
  var _DYN_TRACE_ID0 = "traceId";
7969
7975
  var _DYN_SPAN_ID1 = "spanId";
7970
- var _DYN_GET_DEFAULT_CONFIG = "getDefaultConfig";
7971
- var _DYN_TRACK_DEPENDENCY_DAT2 = "trackDependencyDataInternal";
7972
- var _DYN_INCLUDE_CORRELATION_3 = "includeCorrelationHeaders";
7976
+ var _DYN_CORE = "core";
7977
+ var _DYN_INCLUDE_CORRELATION_2 = "includeCorrelationHeaders";
7973
7978
  var _DYN_GET_ABSOLUTE_URL = "getAbsoluteUrl";
7974
7979
  var _DYN_HEADERS = "headers";
7975
7980
  var _DYN_REQUEST_HEADERS = "requestHeaders";
7976
7981
  var _DYN_APP_ID = "appId";
7977
7982
  var _DYN_SET_REQUEST_HEADER = "setRequestHeader";
7983
+ var _DYN_TRACK_DEPENDENCY_DAT3 = "trackDependencyDataInternal";
7978
7984
  var _DYN_DISTRIBUTED_TRACING_4 = "distributedTracingMode";
7979
7985
  var _DYN_START_TIME = "startTime";
7980
7986
  var _DYN_TO_LOWER_CASE = "toLowerCase";
@@ -8255,6 +8261,13 @@ this.Microsoft = this.Microsoft || {};
8255
8261
  var strDiagLog = "diagLog";
8256
8262
  var strAjaxData = "ajaxData";
8257
8263
  var strFetch = "fetch";
8264
+ var ERROR_HEADER = "Failed to monitor XMLHttpRequest";
8265
+ var ERROR_PREFIX = ", monitoring data for this ajax call ";
8266
+ var ERROR_POSTFIX = ERROR_PREFIX + "may be incorrect.";
8267
+ var ERROR_NOT_SENT = ERROR_PREFIX + "won't be sent.";
8268
+ var CORRELATION_HEADER_ERROR = "Failed to get Request-Context correlation header as it may be not included in the response or not accessible.";
8269
+ var CUSTOM_REQUEST_CONTEXT_ERROR = "Failed to add custom defined request context as configured call back may missing a null check.";
8270
+ var FAILED_TO_CALCULATE_DURATION_ERROR = "Failed to calculate the duration of the ";
8258
8271
  var _markCount = 0;
8259
8272
  function _supportsFetch() {
8260
8273
  var _global = getGlobal();
@@ -8298,9 +8311,7 @@ this.Microsoft = this.Microsoft || {};
8298
8311
  function _getFailedAjaxDiagnosticsMessage(xhr) {
8299
8312
  var result = "";
8300
8313
  try {
8301
- if (!isNullOrUndefined(xhr) &&
8302
- !isNullOrUndefined(xhr[strAjaxData]) &&
8303
- !isNullOrUndefined(xhr[strAjaxData][_DYN_REQUEST_URL ])) {
8314
+ if (xhr && xhr[strAjaxData] && xhr[strAjaxData][_DYN_REQUEST_URL ]) {
8304
8315
  result += "(url: '" + xhr[strAjaxData][_DYN_REQUEST_URL ] + "')";
8305
8316
  }
8306
8317
  }
@@ -8328,6 +8339,37 @@ this.Microsoft = this.Microsoft || {};
8328
8339
  }
8329
8340
  return -1;
8330
8341
  }
8342
+ function _addHandler(container, id, theFunc) {
8343
+ var theHandler = {
8344
+ id: id,
8345
+ fn: theFunc
8346
+ };
8347
+ container.push(theHandler);
8348
+ return {
8349
+ remove: function () {
8350
+ arrForEach(container, function (initializer, idx) {
8351
+ if (initializer.id === theHandler.id) {
8352
+ container.splice(idx, 1);
8353
+ return -1;
8354
+ }
8355
+ });
8356
+ }
8357
+ };
8358
+ }
8359
+ function _processDependencyContainer(core, container, details, message) {
8360
+ var result = true;
8361
+ arrForEach(container, function (theFunc, idx) {
8362
+ try {
8363
+ if (theFunc.fn.call(null, details) === false) {
8364
+ result = false;
8365
+ }
8366
+ }
8367
+ catch (e) {
8368
+ _throwInternal(core && core.logger, 1 , 64 , "Dependency " + message + " [#" + idx + "] failed: " + getExceptionName(e), { exception: dumpObj(e) }, true);
8369
+ }
8370
+ });
8371
+ return result;
8372
+ }
8331
8373
  function _processDependencyListeners(listeners, core, ajaxData, xhr, input, init) {
8332
8374
  var _a;
8333
8375
  var initializersCount = listeners[_DYN_LENGTH$1 ];
@@ -8340,30 +8382,62 @@ this.Microsoft = this.Microsoft || {};
8340
8382
  _a.traceId = ajaxData[_DYN_TRACE_ID ],
8341
8383
  _a.spanId = ajaxData[_DYN_SPAN_ID ],
8342
8384
  _a.traceFlags = ajaxData[_DYN_TRACE_FLAGS ],
8385
+ _a.context = ajaxData[_DYN_CONTEXT$1 ] || {},
8343
8386
  _a);
8344
- for (var i = 0; i < initializersCount; ++i) {
8345
- var dependencyListener = listeners[i];
8346
- if (dependencyListener && dependencyListener.fn) {
8347
- try {
8348
- dependencyListener.fn.call(null, details);
8349
- }
8350
- catch (e) {
8351
- var core_1 = details[_DYN_CORE ];
8352
- _throwInternal(core_1 && core_1.logger, 1 , 64 , "Dependency listener [#" + i + "] failed: " + getExceptionName(e), { exception: dumpObj(e) }, true);
8353
- }
8354
- }
8355
- }
8387
+ _processDependencyContainer(core, listeners, details, "listener");
8356
8388
  ajaxData[_DYN_TRACE_ID ] = details[_DYN_TRACE_ID0 ];
8357
8389
  ajaxData[_DYN_SPAN_ID ] = details[_DYN_SPAN_ID1 ];
8358
8390
  ajaxData[_DYN_TRACE_FLAGS ] = details[_DYN_TRACE_FLAGS ];
8391
+ ajaxData[_DYN_CONTEXT$1 ] = details[_DYN_CONTEXT$1 ];
8359
8392
  }
8360
8393
  }
8394
+ var BLOB_CORE = "*.blob.core.";
8361
8395
  var DfltAjaxCorrelationHeaderExDomains = objDeepFreeze([
8362
- "*.blob.core.windows.net",
8363
- "*.blob.core.chinacloudapi.cn",
8364
- "*.blob.core.cloudapi.de",
8365
- "*.blob.core.usgovcloudapi.net"
8396
+ BLOB_CORE + "windows.net",
8397
+ BLOB_CORE + "chinacloudapi.cn",
8398
+ BLOB_CORE + "cloudapi.de",
8399
+ BLOB_CORE + "usgovcloudapi.net"
8366
8400
  ]);
8401
+ var _internalExcludeEndpoints = [
8402
+ /https:\/\/[^\/]*(\.pipe\.aria|aria\.pipe|events\.data|collector\.azure)\.[^\/]+\/(OneCollector\/1|Collector\/3)\.0/i
8403
+ ];
8404
+ function _getDefaultConfig() {
8405
+ var _a;
8406
+ var config = (_a = {},
8407
+ _a[_DYN_MAX_AJAX_CALLS_PER_V8 ] = 500,
8408
+ _a[_DYN_DISABLE_AJAX_TRACKIN11 ] = false,
8409
+ _a[_DYN_DISABLE_FETCH_TRACKI12 ] = false,
8410
+ _a[_DYN_EXCLUDE_REQUEST_FROM10 ] = undefined,
8411
+ _a.disableCorrelationHeaders = false,
8412
+ _a.distributedTracingMode = 1 ,
8413
+ _a.correlationHeaderExcludedDomains = DfltAjaxCorrelationHeaderExDomains,
8414
+ _a.correlationHeaderDomains = undefined,
8415
+ _a.correlationHeaderExcludePatterns = undefined,
8416
+ _a[_DYN_APP_ID ] = undefined,
8417
+ _a.enableCorsCorrelation = false,
8418
+ _a[_DYN_ENABLE_REQUEST_HEADE5 ] = false,
8419
+ _a[_DYN_ENABLE_RESPONSE_HEAD9 ] = false,
8420
+ _a[_DYN_ENABLE_AJAX_ERROR_ST6 ] = false,
8421
+ _a[_DYN_ENABLE_AJAX_PERF_TRA7 ] = false,
8422
+ _a.maxAjaxPerfLookupAttempts = 3,
8423
+ _a[_DYN_AJAX_PERF_LOOKUP_DEL16 ] = 25,
8424
+ _a.ignoreHeaders = [
8425
+ "Authorization",
8426
+ "X-API-Key",
8427
+ "WWW-Authenticate"
8428
+ ],
8429
+ _a[_DYN_ADD_REQUEST_CONTEXT ] = undefined,
8430
+ _a.addIntEndpoints = true,
8431
+ _a);
8432
+ return config;
8433
+ }
8434
+ function _getEmptyConfig() {
8435
+ var emptyConfig = _getDefaultConfig();
8436
+ objForEachKey(emptyConfig, function (value) {
8437
+ emptyConfig[value] = undefined;
8438
+ });
8439
+ return emptyConfig;
8440
+ }
8367
8441
  var AjaxMonitor = /** @class */ (function (_super) {
8368
8442
  __extendsFn(AjaxMonitor, _super);
8369
8443
  function AjaxMonitor() {
@@ -8390,8 +8464,9 @@ this.Microsoft = this.Microsoft || {};
8390
8464
  var _excludeRequestFromAutoTrackingPatterns;
8391
8465
  var _addRequestContext;
8392
8466
  var _evtNamespace;
8393
- var _dependencyListenerId;
8467
+ var _dependencyHandlerId;
8394
8468
  var _dependencyListeners;
8469
+ var _dependencyInitializers;
8395
8470
  dynamicProto(AjaxMonitor, _this, function (_self, _base) {
8396
8471
  var _addHook = _base._addHook;
8397
8472
  _initDefaults();
@@ -8409,9 +8484,9 @@ this.Microsoft = this.Microsoft || {};
8409
8484
  _initDefaults();
8410
8485
  };
8411
8486
  _self.trackDependencyData = function (dependency, properties) {
8412
- _self[_DYN_TRACK_DEPENDENCY_DAT2 ](dependency, properties);
8487
+ _reportDependencyInternal(_dependencyInitializers, _self[_DYN_CORE ], null, dependency, properties);
8413
8488
  };
8414
- _self[_DYN_INCLUDE_CORRELATION_3 ] = function (ajaxData, input, init, xhr) {
8489
+ _self[_DYN_INCLUDE_CORRELATION_2 ] = function (ajaxData, input, init, xhr) {
8415
8490
  var currentWindowHost = _self["_currentWindowHost"] || _currentWindowHost;
8416
8491
  _processDependencyListeners(_dependencyListeners, _self[_DYN_CORE ], ajaxData, xhr, input, init);
8417
8492
  if (input) {
@@ -8481,7 +8556,7 @@ this.Microsoft = this.Microsoft || {};
8481
8556
  }
8482
8557
  return undefined;
8483
8558
  };
8484
- _self[_DYN_TRACK_DEPENDENCY_DAT2 ] = function (dependency, properties, systemProperties) {
8559
+ _self[_DYN_TRACK_DEPENDENCY_DAT3 ] = function (dependency, properties, systemProperties) {
8485
8560
  if (_maxAjaxCallsPerView === -1 || _trackAjaxAttempts < _maxAjaxCallsPerView) {
8486
8561
  if ((_config[_DYN_DISTRIBUTED_TRACING_4 ] === 2
8487
8562
  || _config[_DYN_DISTRIBUTED_TRACING_4 ] === 1 )
@@ -8500,22 +8575,10 @@ this.Microsoft = this.Microsoft || {};
8500
8575
  ++_trackAjaxAttempts;
8501
8576
  };
8502
8577
  _self.addDependencyListener = function (dependencyListener) {
8503
- var theInitializer = {
8504
- id: _dependencyListenerId++,
8505
- fn: dependencyListener
8506
- };
8507
- _dependencyListeners.push(theInitializer);
8508
- var handler = {
8509
- remove: function () {
8510
- arrForEach(_dependencyListeners, function (initializer, idx) {
8511
- if (initializer.id === theInitializer.id) {
8512
- _dependencyListeners.splice(idx, 1);
8513
- return -1;
8514
- }
8515
- });
8516
- }
8517
- };
8518
- return handler;
8578
+ return _addHandler(_dependencyListeners, _dependencyHandlerId++, dependencyListener);
8579
+ };
8580
+ _self.addDependencyInitializer = function (dependencyInitializer) {
8581
+ return _addHandler(_dependencyInitializers, _dependencyHandlerId++, dependencyInitializer);
8519
8582
  };
8520
8583
  function _initDefaults() {
8521
8584
  var location = getLocation();
@@ -8539,13 +8602,14 @@ this.Microsoft = this.Microsoft || {};
8539
8602
  _excludeRequestFromAutoTrackingPatterns = null;
8540
8603
  _addRequestContext = null;
8541
8604
  _evtNamespace = null;
8542
- _dependencyListenerId = 0;
8605
+ _dependencyHandlerId = 0;
8543
8606
  _dependencyListeners = [];
8607
+ _dependencyInitializers = [];
8544
8608
  }
8545
8609
  function _populateDefaults(config) {
8546
8610
  var ctx = createProcessTelemetryContext(null, config, _self[_DYN_CORE ]);
8547
- _config = AjaxMonitor.getEmptyConfig();
8548
- var defaultConfig = AjaxMonitor[_DYN_GET_DEFAULT_CONFIG ]();
8611
+ _config = _getEmptyConfig();
8612
+ var defaultConfig = _getDefaultConfig();
8549
8613
  objForEachKey(defaultConfig, function (field, value) {
8550
8614
  _config[field] = ctx.getConfig(AjaxMonitor.identifier, field, value);
8551
8615
  });
@@ -8555,7 +8619,7 @@ this.Microsoft = this.Microsoft || {};
8555
8619
  _enableAjaxPerfTracking = _config[_DYN_ENABLE_AJAX_PERF_TRA7 ];
8556
8620
  _maxAjaxCallsPerView = _config[_DYN_MAX_AJAX_CALLS_PER_V8 ];
8557
8621
  _enableResponseHeaderTracking = _config[_DYN_ENABLE_RESPONSE_HEAD9 ];
8558
- _excludeRequestFromAutoTrackingPatterns = _config[_DYN_EXCLUDE_REQUEST_FROM10 ];
8622
+ _excludeRequestFromAutoTrackingPatterns = [].concat(_config[_DYN_EXCLUDE_REQUEST_FROM10 ] || [], _config.addIntEndpoints !== false ? _internalExcludeEndpoints : []);
8559
8623
  _addRequestContext = _config[_DYN_ADD_REQUEST_CONTEXT ];
8560
8624
  _isUsingAIHeaders = distributedTracingMode === 0 || distributedTracingMode === 1 ;
8561
8625
  _isUsingW3CHeaders = distributedTracingMode === 1 || distributedTracingMode === 2 ;
@@ -8574,7 +8638,7 @@ this.Microsoft = this.Microsoft || {};
8574
8638
  function _populateContext() {
8575
8639
  var propExt = _self[_DYN_CORE ].getPlugin(PropertiesPluginIdentifier);
8576
8640
  if (propExt) {
8577
- _context = propExt.plugin.context;
8641
+ _context = propExt.plugin[_DYN_CONTEXT$1 ];
8578
8642
  }
8579
8643
  }
8580
8644
  function _canIncludeHeaders(header) {
@@ -8606,7 +8670,7 @@ this.Microsoft = this.Microsoft || {};
8606
8670
  !(isPolyfill && _xhrInitialized)) {
8607
8671
  var ctx = callDetails.ctx();
8608
8672
  fetchData = _createFetchRecord(input, init);
8609
- var newInit = _self[_DYN_INCLUDE_CORRELATION_3 ](fetchData, input, init);
8673
+ var newInit = _self[_DYN_INCLUDE_CORRELATION_2 ](fetchData, input, init);
8610
8674
  if (newInit !== init) {
8611
8675
  callDetails.set(1, newInit);
8612
8676
  }
@@ -8646,7 +8710,7 @@ this.Microsoft = this.Microsoft || {};
8646
8710
  }
8647
8711
  }
8648
8712
  },
8649
- hkErr: _createErrorCallbackFunc(_self, 15 , "Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.")
8713
+ hkErr: _createErrorCallbackFunc(_self, 15 , "Failed to monitor Window.fetch" + ERROR_POSTFIX)
8650
8714
  }));
8651
8715
  _fetchInitialized = true;
8652
8716
  }
@@ -8681,7 +8745,7 @@ this.Microsoft = this.Microsoft || {};
8681
8745
  }
8682
8746
  }
8683
8747
  },
8684
- hkErr: _createErrorCallbackFunc(_self, 15 , "Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.")
8748
+ hkErr: _createErrorCallbackFunc(_self, 15 , ERROR_HEADER + ".open" + ERROR_POSTFIX)
8685
8749
  });
8686
8750
  _hookProto(XMLHttpRequest, "send", {
8687
8751
  ns: _evtNamespace,
@@ -8692,12 +8756,12 @@ this.Microsoft = this.Microsoft || {};
8692
8756
  if (_isMonitoredXhrInstance(xhr) && !ajaxData.xhrMonitoringState[_DYN_SEND_DONE ]) {
8693
8757
  _createMarkId("xhr", ajaxData);
8694
8758
  ajaxData[_DYN_REQUEST_SENT_TIME ] = dateTimeUtilsNow();
8695
- _self[_DYN_INCLUDE_CORRELATION_3 ](ajaxData, undefined, undefined, xhr);
8759
+ _self[_DYN_INCLUDE_CORRELATION_2 ](ajaxData, undefined, undefined, xhr);
8696
8760
  ajaxData.xhrMonitoringState[_DYN_SEND_DONE ] = true;
8697
8761
  }
8698
8762
  }
8699
8763
  },
8700
- hkErr: _createErrorCallbackFunc(_self, 17 , "Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.")
8764
+ hkErr: _createErrorCallbackFunc(_self, 17 , ERROR_HEADER + ERROR_POSTFIX)
8701
8765
  });
8702
8766
  _hookProto(XMLHttpRequest, "abort", {
8703
8767
  ns: _evtNamespace,
@@ -8711,7 +8775,7 @@ this.Microsoft = this.Microsoft || {};
8711
8775
  }
8712
8776
  }
8713
8777
  },
8714
- hkErr: _createErrorCallbackFunc(_self, 13 , "Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.")
8778
+ hkErr: _createErrorCallbackFunc(_self, 13 , ERROR_HEADER + ".abort" + ERROR_POSTFIX)
8715
8779
  });
8716
8780
  _hookProto(XMLHttpRequest, "setRequestHeader", {
8717
8781
  ns: _evtNamespace,
@@ -8723,7 +8787,7 @@ this.Microsoft = this.Microsoft || {};
8723
8787
  }
8724
8788
  }
8725
8789
  },
8726
- hkErr: _createErrorCallbackFunc(_self, 71 , "Failed to monitor XMLHttpRequest.setRequestHeader, monitoring data for this ajax call may be incorrect.")
8790
+ hkErr: _createErrorCallbackFunc(_self, 71 , ERROR_HEADER + ".setRequestHeader" + ERROR_POSTFIX)
8727
8791
  });
8728
8792
  _xhrInitialized = true;
8729
8793
  }
@@ -8818,7 +8882,7 @@ this.Microsoft = this.Microsoft || {};
8818
8882
  catch (e) {
8819
8883
  var exceptionText = dumpObj(e);
8820
8884
  if (!exceptionText || _indexOf(exceptionText[_DYN_TO_LOWER_CASE ](), "c00c023f") === -1) {
8821
- _throwInternalCritical(_self, 16 , "Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.", (_a = {},
8885
+ _throwInternalCritical(_self, 16 , ERROR_HEADER + " 'readystatechange' event handler" + ERROR_POSTFIX, (_a = {},
8822
8886
  _a[_DYN_AJAX_DIAGNOSTICS_MES17 ] = _getFailedAjaxDiagnosticsMessage(xhr),
8823
8887
  _a.exception = exceptionText,
8824
8888
  _a));
@@ -8847,7 +8911,7 @@ this.Microsoft = this.Microsoft || {};
8847
8911
  if (e) {
8848
8912
  errorProps["exception"] = dumpObj(e);
8849
8913
  }
8850
- _throwInternalWarning(_self, 14 , "Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.", errorProps);
8914
+ _throwInternalWarning(_self, 14 , FAILED_TO_CALCULATE_DURATION_ERROR + "ajax call" + ERROR_NOT_SENT, errorProps);
8851
8915
  }
8852
8916
  _findPerfResourceEntry("xmlhttprequest", ajaxData, function () {
8853
8917
  try {
@@ -8887,13 +8951,14 @@ this.Microsoft = this.Microsoft || {};
8887
8951
  }
8888
8952
  }
8889
8953
  catch (e) {
8890
- _throwInternalWarning(_self, 104 , "Failed to add custom defined request context as configured call back may missing a null check.");
8954
+ _throwInternalWarning(_self, 104 , CUSTOM_REQUEST_CONTEXT_ERROR);
8891
8955
  }
8892
8956
  if (dependency) {
8893
8957
  if (properties !== undefined) {
8894
8958
  dependency[STR_PROPERTIES ] = __assignFn(__assignFn({}, dependency.properties), properties);
8895
8959
  }
8896
- _self[_DYN_TRACK_DEPENDENCY_DAT2 ](dependency, null, ajaxData[_DYN_GET_PART_APROPS ]());
8960
+ var sysProperties = ajaxData[_DYN_GET_PART_APROPS ]();
8961
+ _reportDependencyInternal(_dependencyInitializers, _self[_DYN_CORE ], ajaxData, dependency, null, sysProperties);
8897
8962
  }
8898
8963
  else {
8899
8964
  _reportXhrError(null, {
@@ -8926,7 +8991,7 @@ this.Microsoft = this.Microsoft || {};
8926
8991
  }
8927
8992
  }
8928
8993
  catch (e) {
8929
- _throwInternalWarning(_self, 18 , "Failed to get Request-Context correlation header as it may be not included in the response or not accessible.", (_a = {},
8994
+ _throwInternalWarning(_self, 18 , CORRELATION_HEADER_ERROR, (_a = {},
8930
8995
  _a[_DYN_AJAX_DIAGNOSTICS_MES17 ] = _getFailedAjaxDiagnosticsMessage(xhr),
8931
8996
  _a.exception = dumpObj(e),
8932
8997
  _a));
@@ -9060,7 +9125,7 @@ this.Microsoft = this.Microsoft || {};
9060
9125
  if (e) {
9061
9126
  errorProps["exception"] = dumpObj(e);
9062
9127
  }
9063
- _throwInternalWarning(_self, msgId, "Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.", errorProps);
9128
+ _throwInternalWarning(_self, msgId, FAILED_TO_CALCULATE_DURATION_ERROR + "fetch call" + ERROR_NOT_SENT, errorProps);
9064
9129
  }
9065
9130
  ajaxData[_DYN_RESPONSE_FINISHED_TI14 ] = dateTimeUtilsNow();
9066
9131
  ajaxData[_DYN_STATUS ] = status;
@@ -9073,13 +9138,14 @@ this.Microsoft = this.Microsoft || {};
9073
9138
  }
9074
9139
  }
9075
9140
  catch (e) {
9076
- _throwInternalWarning(_self, 104 , "Failed to add custom defined request context as configured call back may missing a null check.");
9141
+ _throwInternalWarning(_self, 104 , CUSTOM_REQUEST_CONTEXT_ERROR);
9077
9142
  }
9078
9143
  if (dependency) {
9079
9144
  if (properties !== undefined) {
9080
9145
  dependency[STR_PROPERTIES ] = __assignFn(__assignFn({}, dependency.properties), properties);
9081
9146
  }
9082
- _self[_DYN_TRACK_DEPENDENCY_DAT2 ](dependency, null, ajaxData[_DYN_GET_PART_APROPS ]());
9147
+ var sysProperties = ajaxData[_DYN_GET_PART_APROPS ]();
9148
+ _reportDependencyInternal(_dependencyInitializers, _self[_DYN_CORE ], ajaxData, dependency, null, sysProperties);
9083
9149
  }
9084
9150
  else {
9085
9151
  _reportFetchError(14 , null, {
@@ -9098,56 +9164,43 @@ this.Microsoft = this.Microsoft || {};
9098
9164
  return correlationIdGetCorrelationContext(responseHeader);
9099
9165
  }
9100
9166
  catch (e) {
9101
- _throwInternalWarning(_self, 18 , "Failed to get Request-Context correlation header as it may be not included in the response or not accessible.", {
9167
+ _throwInternalWarning(_self, 18 , CORRELATION_HEADER_ERROR, {
9102
9168
  fetchDiagnosticsMessage: _getFailedFetchDiagnosticsMessage(response),
9103
9169
  exception: dumpObj(e)
9104
9170
  });
9105
9171
  }
9106
9172
  }
9107
9173
  }
9174
+ function _reportDependencyInternal(initializers, core, ajaxData, dependency, properties, systemProperties) {
9175
+ var _a;
9176
+ var result = true;
9177
+ var initializersCount = initializers[_DYN_LENGTH$1 ];
9178
+ if (initializersCount > 0) {
9179
+ var details = (_a = {
9180
+ item: dependency
9181
+ },
9182
+ _a[STR_PROPERTIES ] = properties,
9183
+ _a.sysProperties = systemProperties,
9184
+ _a.context = ajaxData ? ajaxData[_DYN_CONTEXT$1 ] : null,
9185
+ _a);
9186
+ result = _processDependencyContainer(core, initializers, details, "initializer");
9187
+ }
9188
+ if (result) {
9189
+ _self[_DYN_TRACK_DEPENDENCY_DAT3 ](dependency, properties, systemProperties);
9190
+ }
9191
+ }
9108
9192
  });
9109
9193
  return _this;
9110
9194
  }
9111
- AjaxMonitor.getDefaultConfig = function () {
9112
- var _a;
9113
- var config = (_a = {},
9114
- _a[_DYN_MAX_AJAX_CALLS_PER_V8 ] = 500,
9115
- _a[_DYN_DISABLE_AJAX_TRACKIN11 ] = false,
9116
- _a[_DYN_DISABLE_FETCH_TRACKI12 ] = false,
9117
- _a[_DYN_EXCLUDE_REQUEST_FROM10 ] = undefined,
9118
- _a.disableCorrelationHeaders = false,
9119
- _a.distributedTracingMode = 1 ,
9120
- _a.correlationHeaderExcludedDomains = DfltAjaxCorrelationHeaderExDomains,
9121
- _a.correlationHeaderDomains = undefined,
9122
- _a.correlationHeaderExcludePatterns = undefined,
9123
- _a[_DYN_APP_ID ] = undefined,
9124
- _a.enableCorsCorrelation = false,
9125
- _a[_DYN_ENABLE_REQUEST_HEADE5 ] = false,
9126
- _a[_DYN_ENABLE_RESPONSE_HEAD9 ] = false,
9127
- _a[_DYN_ENABLE_AJAX_ERROR_ST6 ] = false,
9128
- _a[_DYN_ENABLE_AJAX_PERF_TRA7 ] = false,
9129
- _a.maxAjaxPerfLookupAttempts = 3,
9130
- _a[_DYN_AJAX_PERF_LOOKUP_DEL16 ] = 25,
9131
- _a.ignoreHeaders = [
9132
- "Authorization",
9133
- "X-API-Key",
9134
- "WWW-Authenticate"
9135
- ],
9136
- _a[_DYN_ADD_REQUEST_CONTEXT ] = undefined,
9137
- _a);
9138
- return config;
9139
- };
9140
- AjaxMonitor.getEmptyConfig = function () {
9141
- var emptyConfig = this[_DYN_GET_DEFAULT_CONFIG ]();
9142
- objForEachKey(emptyConfig, function (value) {
9143
- emptyConfig[value] = undefined;
9144
- });
9145
- return emptyConfig;
9146
- };
9147
9195
  AjaxMonitor.prototype.processTelemetry = function (item, itemCtx) {
9148
9196
  this.processNext(item, itemCtx);
9149
9197
  };
9198
+ AjaxMonitor.prototype.addDependencyInitializer = function (dependencyInitializer) {
9199
+ return null;
9200
+ };
9150
9201
  AjaxMonitor.identifier = "AjaxDependencyPlugin";
9202
+ AjaxMonitor.getDefaultConfig = _getDefaultConfig;
9203
+ AjaxMonitor.getEmptyConfig = _getEmptyConfig;
9151
9204
  return AjaxMonitor;
9152
9205
  }(BaseTelemetryPlugin));
9153
9206
 
@@ -9941,7 +9994,8 @@ this.Microsoft = this.Microsoft || {};
9941
9994
  ]);
9942
9995
  proxyFunctions(_self, _getCurrentDependencies, [
9943
9996
  STR_TRACK_DEPENDENCY_DATA,
9944
- "addDependencyListener"
9997
+ "addDependencyListener",
9998
+ "addDependencyInitializer"
9945
9999
  ]);
9946
10000
  proxyFunctions(_self, _core, [
9947
10001
  STR_ADD_TELEMETRY_INITIALIZER,
@@ -9977,7 +10031,9 @@ this.Microsoft = this.Microsoft || {};
9977
10031
  }
9978
10032
  });
9979
10033
  }
9980
- Initialization.__ieDyn=1;
10034
+ Initialization.prototype.addDependencyInitializer = function (dependencyInitializer) {
10035
+ return null;
10036
+ };
9981
10037
  return Initialization;
9982
10038
  }());
9983
10039
  (function () {