@microsoft/applicationinsights-dependencies-js 3.0.0-beta.2208-04 → 3.0.0-beta.2208-14
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/applicationinsights-dependencies-js.integrity.json +9 -9
- package/browser/applicationinsights-dependencies-js.js +216 -75
- package/browser/applicationinsights-dependencies-js.js.map +1 -1
- package/browser/applicationinsights-dependencies-js.min.js +2 -2
- package/browser/applicationinsights-dependencies-js.min.js.map +1 -1
- package/dist/applicationinsights-dependencies-js.api.json +87 -10
- package/dist/applicationinsights-dependencies-js.api.md +10 -6
- package/dist/applicationinsights-dependencies-js.d.ts +27 -4
- package/dist/applicationinsights-dependencies-js.js +216 -75
- package/dist/applicationinsights-dependencies-js.js.map +1 -1
- package/dist/applicationinsights-dependencies-js.min.js +2 -2
- package/dist/applicationinsights-dependencies-js.min.js.map +1 -1
- package/dist/applicationinsights-dependencies-js.rollup.d.ts +27 -4
- package/dist-esm/DependencyListener.js +1 -1
- package/dist-esm/InternalConstants.js +1 -1
- package/dist-esm/__DynamicConstants.js +27 -20
- package/dist-esm/__DynamicConstants.js.map +1 -1
- package/dist-esm/ajax.js +53 -52
- package/dist-esm/ajax.js.map +1 -1
- package/dist-esm/ajaxRecord.js +38 -9
- package/dist-esm/ajaxRecord.js.map +1 -1
- package/dist-esm/ajaxUtils.js +1 -1
- package/dist-esm/applicationinsights-dependencies-js.js +1 -1
- package/package.json +3 -3
- package/src/__DynamicConstants.ts +26 -19
- package/src/ajax.ts +6 -7
- package/src/ajaxRecord.ts +62 -5
- package/types/__DynamicConstants.d.ts +24 -17
- package/types/ajax.d.ts +2 -2
- package/types/ajaxRecord.d.ts +24 -2
- package/types/tsdoc-metadata.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Microsoft Application Insights XHR dependencies plugin, 3.0.0-beta.2208-
|
|
2
|
+
* Microsoft Application Insights XHR dependencies plugin, 3.0.0-beta.2208-14
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* Microsoft Application Insights Team
|
|
@@ -20,6 +20,7 @@ import { IConfiguration } from '@microsoft/applicationinsights-core-js';
|
|
|
20
20
|
import { ICorrelationConfig } from '@microsoft/applicationinsights-common';
|
|
21
21
|
import { IDependencyTelemetry } from '@microsoft/applicationinsights-common';
|
|
22
22
|
import { IDiagnosticLogger } from '@microsoft/applicationinsights-core-js';
|
|
23
|
+
import { IDistributedTraceContext } from '@microsoft/applicationinsights-core-js';
|
|
23
24
|
import { IPlugin } from '@microsoft/applicationinsights-core-js';
|
|
24
25
|
import { IProcessTelemetryContext } from '@microsoft/applicationinsights-core-js';
|
|
25
26
|
import { ITelemetryItem } from '@microsoft/applicationinsights-core-js';
|
|
@@ -87,13 +88,29 @@ export declare class ajaxRecord {
|
|
|
87
88
|
endTime: number;
|
|
88
89
|
xhrMonitoringState: XHRMonitoringState;
|
|
89
90
|
clientFailure: number;
|
|
91
|
+
/**
|
|
92
|
+
* The traceId to use for the dependency call
|
|
93
|
+
*/
|
|
90
94
|
traceID: string;
|
|
95
|
+
/**
|
|
96
|
+
* The spanId to use for the dependency call
|
|
97
|
+
*/
|
|
91
98
|
spanID: string;
|
|
99
|
+
/**
|
|
100
|
+
* The traceFlags to use for the dependency call
|
|
101
|
+
*/
|
|
92
102
|
traceFlags?: number;
|
|
93
|
-
|
|
103
|
+
/**
|
|
104
|
+
* The trace context to use for reporting the remote dependency call
|
|
105
|
+
*/
|
|
106
|
+
eventTraceCtx: ITraceCtx;
|
|
107
|
+
constructor(traceId: string, spanId: string, logger: IDiagnosticLogger, traceCtx?: IDistributedTraceContext);
|
|
94
108
|
getAbsoluteUrl(): string;
|
|
95
109
|
getPathName(): string;
|
|
96
110
|
CreateTrackItem(ajaxType: string, enableRequestHeaderTracking: boolean, getResponse: () => IAjaxRecordResponse): IDependencyTelemetry;
|
|
111
|
+
getPartAProps(): {
|
|
112
|
+
[key: string]: any;
|
|
113
|
+
};
|
|
97
114
|
}
|
|
98
115
|
|
|
99
116
|
declare type DependencyListenerFunction = (dependencyDetails: IDependencyListenerDetails) => void;
|
|
@@ -102,7 +119,7 @@ export declare const DfltAjaxCorrelationHeaderExDomains: string[];
|
|
|
102
119
|
|
|
103
120
|
declare const _DYN_HEADER_MAP = "headerMap";
|
|
104
121
|
|
|
105
|
-
declare const
|
|
122
|
+
declare const _DYN_INCLUDE_CORRELATION_3 = "includeCorrelationHeaders";
|
|
106
123
|
|
|
107
124
|
declare interface IAjaxRecordResponse {
|
|
108
125
|
statusText: string;
|
|
@@ -175,7 +192,13 @@ declare interface IDependencyListenerHandler {
|
|
|
175
192
|
}
|
|
176
193
|
|
|
177
194
|
export declare interface IInstrumentationRequirements extends IDependenciesPlugin {
|
|
178
|
-
[
|
|
195
|
+
[_DYN_INCLUDE_CORRELATION_3]: (ajaxData: ajaxRecord, input?: Request | string, init?: RequestInit, xhr?: XMLHttpRequestInstrumented) => any;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
declare interface ITraceCtx {
|
|
199
|
+
traceId: string;
|
|
200
|
+
spanId: string;
|
|
201
|
+
traceFlags: number;
|
|
179
202
|
}
|
|
180
203
|
|
|
181
204
|
declare class XHRMonitoringState {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - Dependencies Plugin, 3.0.0-beta.2208-
|
|
2
|
+
* Application Insights JavaScript SDK - Dependencies Plugin, 3.0.0-beta.2208-14
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -14,30 +14,33 @@
|
|
|
14
14
|
export var _DYN_REQUEST_URL = "requestUrl"; // Count: 12
|
|
15
15
|
export var _DYN_INST = "inst"; // Count: 5
|
|
16
16
|
export var _DYN_LENGTH = "length"; // Count: 9
|
|
17
|
-
export var _DYN_TRACE_ID = "traceID"; // Count:
|
|
17
|
+
export var _DYN_TRACE_ID = "traceID"; // Count: 9
|
|
18
18
|
export var _DYN_SPAN_ID = "spanID"; // Count: 8
|
|
19
|
-
export var _DYN_TRACE_FLAGS = "traceFlags"; // Count:
|
|
19
|
+
export var _DYN_TRACE_FLAGS = "traceFlags"; // Count: 13
|
|
20
20
|
export var _DYN_CORE = "core"; // Count: 6
|
|
21
|
+
export var _DYN_TRACE_ID0 = "traceId"; // Count: 5
|
|
22
|
+
export var _DYN_SPAN_ID1 = "spanId"; // Count: 5
|
|
21
23
|
export var _DYN_GET_DEFAULT_CONFIG = "getDefaultConfig"; // Count: 2
|
|
22
|
-
export var
|
|
23
|
-
export var
|
|
24
|
+
export var _DYN_TRACK_DEPENDENCY_DAT2 = "trackDependencyDataInternal"; // Count: 4
|
|
25
|
+
export var _DYN_INCLUDE_CORRELATION_3 = "includeCorrelationHeaders"; // Count: 4
|
|
26
|
+
export var _DYN_CAN_INCLUDE_CORRELAT4 = "canIncludeCorrelationHeader"; // Count: 2
|
|
24
27
|
export var _DYN_GET_ABSOLUTE_URL = "getAbsoluteUrl"; // Count: 3
|
|
25
28
|
export var _DYN_HEADERS = "headers"; // Count: 6
|
|
26
29
|
export var _DYN_REQUEST_HEADERS = "requestHeaders"; // Count: 13
|
|
27
30
|
export var _DYN_APP_ID = "appId"; // Count: 5
|
|
28
31
|
export var _DYN_SET_REQUEST_HEADER = "setRequestHeader"; // Count: 3
|
|
29
|
-
export var
|
|
32
|
+
export var _DYN_DISTRIBUTED_TRACING_5 = "distributedTracingMode"; // Count: 3
|
|
30
33
|
export var _DYN_START_TIME = "startTime"; // Count: 6
|
|
31
34
|
export var _DYN_TO_LOWER_CASE = "toLowerCase"; // Count: 6
|
|
32
|
-
export var
|
|
33
|
-
export var
|
|
34
|
-
export var
|
|
35
|
-
export var
|
|
36
|
-
export var
|
|
37
|
-
export var
|
|
35
|
+
export var _DYN_ENABLE_REQUEST_HEADE6 = "enableRequestHeaderTracking"; // Count: 2
|
|
36
|
+
export var _DYN_ENABLE_AJAX_ERROR_ST7 = "enableAjaxErrorStatusText"; // Count: 2
|
|
37
|
+
export var _DYN_ENABLE_AJAX_PERF_TRA8 = "enableAjaxPerfTracking"; // Count: 2
|
|
38
|
+
export var _DYN_MAX_AJAX_CALLS_PER_V9 = "maxAjaxCallsPerView"; // Count: 2
|
|
39
|
+
export var _DYN_ENABLE_RESPONSE_HEAD10 = "enableResponseHeaderTracking"; // Count: 2
|
|
40
|
+
export var _DYN_EXCLUDE_REQUEST_FROM11 = "excludeRequestFromAutoTrackingPatterns"; // Count: 2
|
|
38
41
|
export var _DYN_ADD_REQUEST_CONTEXT = "addRequestContext"; // Count: 2
|
|
39
|
-
export var
|
|
40
|
-
export var
|
|
42
|
+
export var _DYN_DISABLE_AJAX_TRACKIN12 = "disableAjaxTracking"; // Count: 2
|
|
43
|
+
export var _DYN_DISABLE_FETCH_TRACKI13 = "disableFetchTracking"; // Count: 2
|
|
41
44
|
export var _DYN_STATUS = "status"; // Count: 10
|
|
42
45
|
export var _DYN_STATUS_TEXT = "statusText"; // Count: 8
|
|
43
46
|
export var _DYN_HEADER_MAP = "headerMap"; // Count: 8
|
|
@@ -45,20 +48,24 @@ export var _DYN_OPEN_DONE = "openDone"; // Count: 3
|
|
|
45
48
|
export var _DYN_SEND_DONE = "sendDone"; // Count: 3
|
|
46
49
|
export var _DYN_REQUEST_SENT_TIME = "requestSentTime"; // Count: 9
|
|
47
50
|
export var _DYN_ABORT_DONE = "abortDone"; // Count: 3
|
|
51
|
+
export var _DYN_GET_TRACE_ID = "getTraceId"; // Count: 3
|
|
52
|
+
export var _DYN_GET_TRACE_FLAGS = "getTraceFlags"; // Count: 3
|
|
48
53
|
export var _DYN_METHOD = "method"; // Count: 10
|
|
49
54
|
export var _DYN_ERROR_STATUS_TEXT = "errorStatusText"; // Count: 3
|
|
50
|
-
export var
|
|
55
|
+
export var _DYN_STATE_CHANGE_ATTACHE14 = "stateChangeAttached"; // Count: 2
|
|
51
56
|
export var _DYN_RESPONSE_TEXT = "responseText"; // Count: 5
|
|
52
|
-
export var
|
|
57
|
+
export var _DYN_RESPONSE_FINISHED_TI15 = "responseFinishedTime"; // Count: 7
|
|
53
58
|
export var _DYN__CREATE_TRACK_ITEM = "CreateTrackItem"; // Count: 3
|
|
54
59
|
export var _DYN_RESPONSE = "response"; // Count: 4
|
|
55
|
-
export var
|
|
56
|
-
export var
|
|
60
|
+
export var _DYN_GET_ALL_RESPONSE_HEA16 = "getAllResponseHeaders"; // Count: 2
|
|
61
|
+
export var _DYN_GET_PART_APROPS = "getPartAProps"; // Count: 3
|
|
62
|
+
export var _DYN_GET_CORRELATION_CONT17 = "getCorrelationContext"; // Count: 2
|
|
57
63
|
export var _DYN_PERF_MARK = "perfMark"; // Count: 4
|
|
58
|
-
export var
|
|
64
|
+
export var _DYN_AJAX_PERF_LOOKUP_DEL18 = "ajaxPerfLookupDelay"; // Count: 2
|
|
59
65
|
export var _DYN_NAME = "name"; // Count: 6
|
|
60
66
|
export var _DYN_PERF_TIMING = "perfTiming"; // Count: 3
|
|
61
|
-
export var
|
|
67
|
+
export var _DYN_AJAX_DIAGNOSTICS_MES19 = "ajaxDiagnosticsMessage"; // Count: 3
|
|
62
68
|
export var _DYN_CORRELATION_CONTEXT = "correlationContext"; // Count: 3
|
|
63
69
|
export var _DYN_AJAX_TOTAL_DURATION = "ajaxTotalDuration"; // Count: 3
|
|
70
|
+
export var _DYN_EVENT_TRACE_CTX = "eventTraceCtx"; // Count: 3
|
|
64
71
|
//# sourceMappingURL=__DynamicConstants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"__DynamicConstants.js.map","sources":["__DynamicConstants.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// @skip-file-minify\r\n// ##############################################################\r\n// AUTO GENERATED FILE: This file is Auto Generated during build.\r\n// ##############################################################\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n// Note: DON'T Export these const from the package as we are still targeting ES3 this will export a mutable variables that someone could change!!!\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\nexport var _DYN_REQUEST_URL = \"requestUrl\"; // Count: 12\r\nexport var _DYN_INST = \"inst\"; // Count: 5\r\nexport var _DYN_LENGTH = \"length\"; // Count: 9\r\nexport var _DYN_TRACE_ID = \"traceID\"; // Count:
|
|
1
|
+
{"version":3,"file":"__DynamicConstants.js.map","sources":["__DynamicConstants.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// @skip-file-minify\r\n// ##############################################################\r\n// AUTO GENERATED FILE: This file is Auto Generated during build.\r\n// ##############################################################\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n// Note: DON'T Export these const from the package as we are still targeting ES3 this will export a mutable variables that someone could change!!!\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\nexport var _DYN_REQUEST_URL = \"requestUrl\"; // Count: 12\r\nexport var _DYN_INST = \"inst\"; // Count: 5\r\nexport var _DYN_LENGTH = \"length\"; // Count: 9\r\nexport var _DYN_TRACE_ID = \"traceID\"; // Count: 9\r\nexport var _DYN_SPAN_ID = \"spanID\"; // Count: 8\r\nexport var _DYN_TRACE_FLAGS = \"traceFlags\"; // Count: 13\r\nexport var _DYN_CORE = \"core\"; // Count: 6\r\nexport var _DYN_TRACE_ID0 = \"traceId\"; // Count: 5\r\nexport var _DYN_SPAN_ID1 = \"spanId\"; // Count: 5\r\nexport var _DYN_GET_DEFAULT_CONFIG = \"getDefaultConfig\"; // Count: 2\r\nexport var _DYN_TRACK_DEPENDENCY_DAT2 = \"trackDependencyDataInternal\"; // Count: 4\r\nexport var _DYN_INCLUDE_CORRELATION_3 = \"includeCorrelationHeaders\"; // Count: 4\r\nexport var _DYN_CAN_INCLUDE_CORRELAT4 = \"canIncludeCorrelationHeader\"; // Count: 2\r\nexport var _DYN_GET_ABSOLUTE_URL = \"getAbsoluteUrl\"; // Count: 3\r\nexport var _DYN_HEADERS = \"headers\"; // Count: 6\r\nexport var _DYN_REQUEST_HEADERS = \"requestHeaders\"; // Count: 13\r\nexport var _DYN_APP_ID = \"appId\"; // Count: 5\r\nexport var _DYN_SET_REQUEST_HEADER = \"setRequestHeader\"; // Count: 3\r\nexport var _DYN_DISTRIBUTED_TRACING_5 = \"distributedTracingMode\"; // Count: 3\r\nexport var _DYN_START_TIME = \"startTime\"; // Count: 6\r\nexport var _DYN_TO_LOWER_CASE = \"toLowerCase\"; // Count: 6\r\nexport var _DYN_ENABLE_REQUEST_HEADE6 = \"enableRequestHeaderTracking\"; // Count: 2\r\nexport var _DYN_ENABLE_AJAX_ERROR_ST7 = \"enableAjaxErrorStatusText\"; // Count: 2\r\nexport var _DYN_ENABLE_AJAX_PERF_TRA8 = \"enableAjaxPerfTracking\"; // Count: 2\r\nexport var _DYN_MAX_AJAX_CALLS_PER_V9 = \"maxAjaxCallsPerView\"; // Count: 2\r\nexport var _DYN_ENABLE_RESPONSE_HEAD10 = \"enableResponseHeaderTracking\"; // Count: 2\r\nexport var _DYN_EXCLUDE_REQUEST_FROM11 = \"excludeRequestFromAutoTrackingPatterns\"; // Count: 2\r\nexport var _DYN_ADD_REQUEST_CONTEXT = \"addRequestContext\"; // Count: 2\r\nexport var _DYN_DISABLE_AJAX_TRACKIN12 = \"disableAjaxTracking\"; // Count: 2\r\nexport var _DYN_DISABLE_FETCH_TRACKI13 = \"disableFetchTracking\"; // Count: 2\r\nexport var _DYN_STATUS = \"status\"; // Count: 10\r\nexport var _DYN_STATUS_TEXT = \"statusText\"; // Count: 8\r\nexport var _DYN_HEADER_MAP = \"headerMap\"; // Count: 8\r\nexport var _DYN_OPEN_DONE = \"openDone\"; // Count: 3\r\nexport var _DYN_SEND_DONE = \"sendDone\"; // Count: 3\r\nexport var _DYN_REQUEST_SENT_TIME = \"requestSentTime\"; // Count: 9\r\nexport var _DYN_ABORT_DONE = \"abortDone\"; // Count: 3\r\nexport var _DYN_GET_TRACE_ID = \"getTraceId\"; // Count: 3\r\nexport var _DYN_GET_TRACE_FLAGS = \"getTraceFlags\"; // Count: 3\r\nexport var _DYN_METHOD = \"method\"; // Count: 10\r\nexport var _DYN_ERROR_STATUS_TEXT = \"errorStatusText\"; // Count: 3\r\nexport var _DYN_STATE_CHANGE_ATTACHE14 = \"stateChangeAttached\"; // Count: 2\r\nexport var _DYN_RESPONSE_TEXT = \"responseText\"; // Count: 5\r\nexport var _DYN_RESPONSE_FINISHED_TI15 = \"responseFinishedTime\"; // Count: 7\r\nexport var _DYN__CREATE_TRACK_ITEM = \"CreateTrackItem\"; // Count: 3\r\nexport var _DYN_RESPONSE = \"response\"; // Count: 4\r\nexport var _DYN_GET_ALL_RESPONSE_HEA16 = \"getAllResponseHeaders\"; // Count: 2\r\nexport var _DYN_GET_PART_APROPS = \"getPartAProps\"; // Count: 3\r\nexport var _DYN_GET_CORRELATION_CONT17 = \"getCorrelationContext\"; // Count: 2\r\nexport var _DYN_PERF_MARK = \"perfMark\"; // Count: 4\r\nexport var _DYN_AJAX_PERF_LOOKUP_DEL18 = \"ajaxPerfLookupDelay\"; // Count: 2\r\nexport var _DYN_NAME = \"name\"; // Count: 6\r\nexport var _DYN_PERF_TIMING = \"perfTiming\"; // Count: 3\r\nexport var _DYN_AJAX_DIAGNOSTICS_MES19 = \"ajaxDiagnosticsMessage\"; // Count: 3\r\nexport var _DYN_CORRELATION_CONTEXT = \"correlationContext\"; // Count: 3\r\nexport var _DYN_AJAX_TOTAL_DURATION = \"ajaxTotalDuration\"; // Count: 3\r\nexport var _DYN_EVENT_TRACE_CTX = \"eventTraceCtx\"; // Count: 3\r\n//# sourceMappingURL=__DynamicConstants.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
package/dist-esm/ajax.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - Dependencies Plugin, 3.0.0-beta.2208-
|
|
2
|
+
* Application Insights JavaScript SDK - Dependencies Plugin, 3.0.0-beta.2208-14
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -9,13 +9,12 @@ import dynamicProto from "@microsoft/dynamicproto-js";
|
|
|
9
9
|
import { CorrelationIdHelper, DisabledPropertyName, PropertiesPluginIdentifier, RemoteDependencyData, RequestHeaders, createDistributedTraceContextFromTrace, createTelemetryItem, createTraceParent, dateTimeUtilsNow, formatTraceParent, isInternalApplicationInsightsEndpoint } from "@microsoft/applicationinsights-common";
|
|
10
10
|
import { BaseTelemetryPlugin, InstrumentFunc, InstrumentProto, _throwInternal, arrForEach, createProcessTelemetryContext, createUniqueNamespace, deepFreeze, dumpObj, eventOn, generateW3CId, getExceptionName, getGlobal, getIEVersion, getLocation, getPerformance, isFunction, isNullOrUndefined, isString, isXhrSupported, mergeEvtNamespace, objForEachKey, strPrototype, strTrim } from "@microsoft/applicationinsights-core-js";
|
|
11
11
|
import { STR_PROPERTIES } from "./InternalConstants";
|
|
12
|
-
import { _DYN_ABORT_DONE, _DYN_ADD_REQUEST_CONTEXT,
|
|
12
|
+
import { _DYN_ABORT_DONE, _DYN_ADD_REQUEST_CONTEXT, _DYN_AJAX_DIAGNOSTICS_MES19, _DYN_AJAX_PERF_LOOKUP_DEL18, _DYN_APP_ID, _DYN_CAN_INCLUDE_CORRELAT4, _DYN_CORE, _DYN_CORRELATION_CONTEXT, _DYN_DISABLE_AJAX_TRACKIN12, _DYN_DISABLE_FETCH_TRACKI13, _DYN_DISTRIBUTED_TRACING_5, _DYN_ENABLE_AJAX_ERROR_ST7, _DYN_ENABLE_AJAX_PERF_TRA8, _DYN_ENABLE_REQUEST_HEADE6, _DYN_ENABLE_RESPONSE_HEAD10, _DYN_ERROR_STATUS_TEXT, _DYN_EXCLUDE_REQUEST_FROM11, _DYN_GET_ABSOLUTE_URL, _DYN_GET_ALL_RESPONSE_HEA16, _DYN_GET_CORRELATION_CONT17, _DYN_GET_DEFAULT_CONFIG, _DYN_GET_PART_APROPS, _DYN_GET_TRACE_FLAGS, _DYN_GET_TRACE_ID, _DYN_HEADERS, _DYN_HEADER_MAP, _DYN_INCLUDE_CORRELATION_3, _DYN_INST, _DYN_LENGTH, _DYN_MAX_AJAX_CALLS_PER_V9, _DYN_METHOD, _DYN_NAME, _DYN_OPEN_DONE, _DYN_PERF_MARK, _DYN_PERF_TIMING, _DYN_REQUEST_HEADERS, _DYN_REQUEST_SENT_TIME, _DYN_REQUEST_URL, _DYN_RESPONSE, _DYN_RESPONSE_FINISHED_TI15, _DYN_RESPONSE_TEXT, _DYN_SEND_DONE, _DYN_SET_REQUEST_HEADER, _DYN_SPAN_ID, _DYN_SPAN_ID1, _DYN_START_TIME, _DYN_STATE_CHANGE_ATTACHE14, _DYN_STATUS, _DYN_STATUS_TEXT, _DYN_TO_LOWER_CASE, _DYN_TRACE_FLAGS, _DYN_TRACE_ID, _DYN_TRACE_ID0, _DYN_TRACK_DEPENDENCY_DAT2, _DYN__CREATE_TRACK_ITEM } from "./__DynamicConstants";
|
|
13
13
|
import { ajaxRecord } from "./ajaxRecord";
|
|
14
14
|
var AJAX_MONITOR_PREFIX = "ai.ajxmn.";
|
|
15
15
|
var strDiagLog = "diagLog";
|
|
16
16
|
var strAjaxData = "ajaxData";
|
|
17
17
|
var strFetch = "fetch";
|
|
18
|
-
var strTrackDependencyDataInternal = "trackDependencyDataInternal"; // Using string to help with minification
|
|
19
18
|
// Using a global value so that to handle same iKey with multiple app insights instances (mostly for testing)
|
|
20
19
|
var _markCount = 0;
|
|
21
20
|
/** @Ignore */
|
|
@@ -130,8 +129,8 @@ function _processDependencyListeners(listeners, core, ajaxData, xhr, input, init
|
|
|
130
129
|
}
|
|
131
130
|
}
|
|
132
131
|
}
|
|
133
|
-
ajaxData[_DYN_TRACE_ID /* @min:%2etraceID */] = details
|
|
134
|
-
ajaxData[_DYN_SPAN_ID /* @min:%2espanID */] = details
|
|
132
|
+
ajaxData[_DYN_TRACE_ID /* @min:%2etraceID */] = details[_DYN_TRACE_ID0 /* @min:%2etraceId */];
|
|
133
|
+
ajaxData[_DYN_SPAN_ID /* @min:%2espanID */] = details[_DYN_SPAN_ID1 /* @min:%2espanId */];
|
|
135
134
|
ajaxData[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */] = details[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */];
|
|
136
135
|
}
|
|
137
136
|
}
|
|
@@ -186,14 +185,14 @@ var AjaxMonitor = /** @class */ (function (_super) {
|
|
|
186
185
|
_initDefaults();
|
|
187
186
|
};
|
|
188
187
|
_self.trackDependencyData = function (dependency, properties) {
|
|
189
|
-
_self[
|
|
188
|
+
_self[_DYN_TRACK_DEPENDENCY_DAT2 /* @min:%2etrackDependencyDataInternal */](dependency, properties);
|
|
190
189
|
};
|
|
191
|
-
_self[
|
|
190
|
+
_self[_DYN_INCLUDE_CORRELATION_3 /* @min:%2eincludeCorrelationHeaders */] = function (ajaxData, input, init, xhr) {
|
|
192
191
|
// Test Hook to allow the overriding of the location host
|
|
193
192
|
var currentWindowHost = _self["_currentWindowHost"] || _currentWindowHost;
|
|
194
193
|
_processDependencyListeners(_dependencyListeners, _self[_DYN_CORE /* @min:%2ecore */], ajaxData, xhr, input, init);
|
|
195
194
|
if (input) { // Fetch
|
|
196
|
-
if (CorrelationIdHelper[
|
|
195
|
+
if (CorrelationIdHelper[_DYN_CAN_INCLUDE_CORRELAT4 /* @min:%2ecanIncludeCorrelationHeader */](_config, ajaxData[_DYN_GET_ABSOLUTE_URL /* @min:%2egetAbsoluteUrl */](), currentWindowHost)) {
|
|
197
196
|
if (!init) {
|
|
198
197
|
init = {};
|
|
199
198
|
}
|
|
@@ -231,7 +230,7 @@ var AjaxMonitor = /** @class */ (function (_super) {
|
|
|
231
230
|
return init;
|
|
232
231
|
}
|
|
233
232
|
else if (xhr) { // XHR
|
|
234
|
-
if (CorrelationIdHelper[
|
|
233
|
+
if (CorrelationIdHelper[_DYN_CAN_INCLUDE_CORRELAT4 /* @min:%2ecanIncludeCorrelationHeader */](_config, ajaxData[_DYN_GET_ABSOLUTE_URL /* @min:%2egetAbsoluteUrl */](), currentWindowHost)) {
|
|
235
234
|
if (_isUsingAIHeaders) {
|
|
236
235
|
var id = "|" + ajaxData[_DYN_TRACE_ID /* @min:%2etraceID */] + "." + ajaxData[_DYN_SPAN_ID /* @min:%2espanID */];
|
|
237
236
|
xhr[_DYN_SET_REQUEST_HEADER /* @min:%2esetRequestHeader */](RequestHeaders[3 /* eRequestHeaders.requestIdHeader */], id);
|
|
@@ -262,13 +261,13 @@ var AjaxMonitor = /** @class */ (function (_super) {
|
|
|
262
261
|
}
|
|
263
262
|
return undefined;
|
|
264
263
|
};
|
|
265
|
-
_self[
|
|
264
|
+
_self[_DYN_TRACK_DEPENDENCY_DAT2 /* @min:%2etrackDependencyDataInternal */] = function (dependency, properties, systemProperties) {
|
|
266
265
|
if (_maxAjaxCallsPerView === -1 || _trackAjaxAttempts < _maxAjaxCallsPerView) {
|
|
267
266
|
// Hack since expected format in w3c mode is |abc.def.
|
|
268
267
|
// Non-w3c format is |abc.def
|
|
269
268
|
// @todo Remove if better solution is available, e.g. handle in portal
|
|
270
|
-
if ((_config[
|
|
271
|
-
|| _config[
|
|
269
|
+
if ((_config[_DYN_DISTRIBUTED_TRACING_5 /* @min:%2edistributedTracingMode */] === 2 /* eDistributedTracingModes.W3C */
|
|
270
|
+
|| _config[_DYN_DISTRIBUTED_TRACING_5 /* @min:%2edistributedTracingMode */] === 1 /* eDistributedTracingModes.AI_AND_W3C */)
|
|
272
271
|
&& typeof dependency.id === "string" && dependency.id[dependency.id[_DYN_LENGTH /* @min:%2elength */] - 1] !== ".") {
|
|
273
272
|
dependency.id += ".";
|
|
274
273
|
}
|
|
@@ -334,13 +333,13 @@ var AjaxMonitor = /** @class */ (function (_super) {
|
|
|
334
333
|
objForEachKey(defaultConfig, function (field, value) {
|
|
335
334
|
_config[field] = ctx.getConfig(AjaxMonitor.identifier, field, value);
|
|
336
335
|
});
|
|
337
|
-
var distributedTracingMode = _config[
|
|
338
|
-
_enableRequestHeaderTracking = _config[
|
|
339
|
-
_enableAjaxErrorStatusText = _config[
|
|
340
|
-
_enableAjaxPerfTracking = _config[
|
|
341
|
-
_maxAjaxCallsPerView = _config[
|
|
342
|
-
_enableResponseHeaderTracking = _config[
|
|
343
|
-
_excludeRequestFromAutoTrackingPatterns = _config[
|
|
336
|
+
var distributedTracingMode = _config[_DYN_DISTRIBUTED_TRACING_5 /* @min:%2edistributedTracingMode */];
|
|
337
|
+
_enableRequestHeaderTracking = _config[_DYN_ENABLE_REQUEST_HEADE6 /* @min:%2eenableRequestHeaderTracking */];
|
|
338
|
+
_enableAjaxErrorStatusText = _config[_DYN_ENABLE_AJAX_ERROR_ST7 /* @min:%2eenableAjaxErrorStatusText */];
|
|
339
|
+
_enableAjaxPerfTracking = _config[_DYN_ENABLE_AJAX_PERF_TRA8 /* @min:%2eenableAjaxPerfTracking */];
|
|
340
|
+
_maxAjaxCallsPerView = _config[_DYN_MAX_AJAX_CALLS_PER_V9 /* @min:%2emaxAjaxCallsPerView */];
|
|
341
|
+
_enableResponseHeaderTracking = _config[_DYN_ENABLE_RESPONSE_HEAD10 /* @min:%2eenableResponseHeaderTracking */];
|
|
342
|
+
_excludeRequestFromAutoTrackingPatterns = _config[_DYN_EXCLUDE_REQUEST_FROM11 /* @min:%2eexcludeRequestFromAutoTrackingPatterns */];
|
|
344
343
|
_addRequestContext = _config[_DYN_ADD_REQUEST_CONTEXT /* @min:%2eaddRequestContext */];
|
|
345
344
|
_isUsingAIHeaders = distributedTracingMode === 0 /* eDistributedTracingModes.AI */ || distributedTracingMode === 1 /* eDistributedTracingModes.AI_AND_W3C */;
|
|
346
345
|
_isUsingW3CHeaders = distributedTracingMode === 1 /* eDistributedTracingModes.AI_AND_W3C */ || distributedTracingMode === 2 /* eDistributedTracingModes.W3C */;
|
|
@@ -353,8 +352,8 @@ var AjaxMonitor = /** @class */ (function (_super) {
|
|
|
353
352
|
_markPrefix = AJAX_MONITOR_PREFIX + iKey + ".";
|
|
354
353
|
}
|
|
355
354
|
}
|
|
356
|
-
_disableAjaxTracking = !!_config[
|
|
357
|
-
_disableFetchTracking = !!_config[
|
|
355
|
+
_disableAjaxTracking = !!_config[_DYN_DISABLE_AJAX_TRACKIN12 /* @min:%2edisableAjaxTracking */];
|
|
356
|
+
_disableFetchTracking = !!_config[_DYN_DISABLE_FETCH_TRACKI13 /* @min:%2edisableFetchTracking */];
|
|
358
357
|
}
|
|
359
358
|
function _populateContext() {
|
|
360
359
|
var propExt = _self[_DYN_CORE /* @min:%2ecore */].getPlugin(PropertiesPluginIdentifier);
|
|
@@ -395,7 +394,7 @@ var AjaxMonitor = /** @class */ (function (_super) {
|
|
|
395
394
|
!(isPolyfill && _xhrInitialized)) {
|
|
396
395
|
var ctx = callDetails.ctx();
|
|
397
396
|
fetchData = _createFetchRecord(input, init);
|
|
398
|
-
var newInit = _self[
|
|
397
|
+
var newInit = _self[_DYN_INCLUDE_CORRELATION_3 /* @min:%2eincludeCorrelationHeaders */](fetchData, input, init);
|
|
399
398
|
if (newInit !== init) {
|
|
400
399
|
callDetails.set(1, newInit);
|
|
401
400
|
}
|
|
@@ -495,7 +494,7 @@ var AjaxMonitor = /** @class */ (function (_super) {
|
|
|
495
494
|
if (_isMonitoredXhrInstance(xhr) && !ajaxData.xhrMonitoringState[_DYN_SEND_DONE /* @min:%2esendDone */]) {
|
|
496
495
|
_createMarkId("xhr", ajaxData);
|
|
497
496
|
ajaxData[_DYN_REQUEST_SENT_TIME /* @min:%2erequestSentTime */] = dateTimeUtilsNow();
|
|
498
|
-
_self[
|
|
497
|
+
_self[_DYN_INCLUDE_CORRELATION_3 /* @min:%2eincludeCorrelationHeaders */](ajaxData, undefined, undefined, xhr);
|
|
499
498
|
ajaxData.xhrMonitoringState[_DYN_SEND_DONE /* @min:%2esendDone */] = true;
|
|
500
499
|
}
|
|
501
500
|
}
|
|
@@ -613,11 +612,12 @@ var AjaxMonitor = /** @class */ (function (_super) {
|
|
|
613
612
|
return distributedTraceCtx;
|
|
614
613
|
}
|
|
615
614
|
function _openHandler(xhr, method, url, async) {
|
|
615
|
+
var _a;
|
|
616
616
|
var distributedTraceCtx = _getDistributedTraceCtx();
|
|
617
|
-
var traceID = (distributedTraceCtx && distributedTraceCtx
|
|
617
|
+
var traceID = (distributedTraceCtx && distributedTraceCtx[_DYN_GET_TRACE_ID /* @min:%2egetTraceId */]()) || generateW3CId();
|
|
618
618
|
var spanID = generateW3CId().substr(0, 16);
|
|
619
|
-
var ajaxData = new ajaxRecord(traceID, spanID, _self[strDiagLog]());
|
|
620
|
-
ajaxData[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */] = distributedTraceCtx && distributedTraceCtx
|
|
619
|
+
var ajaxData = new ajaxRecord(traceID, spanID, _self[strDiagLog](), (_a = _self.core) === null || _a === void 0 ? void 0 : _a.getTraceCtx());
|
|
620
|
+
ajaxData[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */] = distributedTraceCtx && distributedTraceCtx[_DYN_GET_TRACE_FLAGS /* @min:%2egetTraceFlags */]();
|
|
621
621
|
ajaxData[_DYN_METHOD /* @min:%2emethod */] = method;
|
|
622
622
|
ajaxData[_DYN_REQUEST_URL /* @min:%2erequestUrl */] = url;
|
|
623
623
|
ajaxData.xhrMonitoringState[_DYN_OPEN_DONE /* @min:%2eopenDone */] = true;
|
|
@@ -627,7 +627,7 @@ var AjaxMonitor = /** @class */ (function (_super) {
|
|
|
627
627
|
xhr[strAjaxData] = ajaxData;
|
|
628
628
|
}
|
|
629
629
|
function _attachToOnReadyStateChange(xhr) {
|
|
630
|
-
xhr[strAjaxData].xhrMonitoringState[
|
|
630
|
+
xhr[strAjaxData].xhrMonitoringState[_DYN_STATE_CHANGE_ATTACHE14 /* @min:%2estateChangeAttached */] = eventOn(xhr, "readystatechange", function () {
|
|
631
631
|
var _a;
|
|
632
632
|
try {
|
|
633
633
|
if (xhr && xhr.readyState === 4 && _isMonitoredXhrInstance(xhr)) {
|
|
@@ -639,7 +639,7 @@ var AjaxMonitor = /** @class */ (function (_super) {
|
|
|
639
639
|
// ignore messages with c00c023f, as this a known IE9 XHR abort issue
|
|
640
640
|
if (!exceptionText || _indexOf(exceptionText[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */](), "c00c023f") === -1) {
|
|
641
641
|
_throwInternalCritical(_self, 16 /* _eInternalMessageId.FailedMonitorAjaxRSC */, "Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.", (_a = {},
|
|
642
|
-
_a[
|
|
642
|
+
_a[_DYN_AJAX_DIAGNOSTICS_MES19 /* @min:ajaxDiagnosticsMessage */] = _getFailedAjaxDiagnosticsMessage(xhr),
|
|
643
643
|
_a.exception = exceptionText,
|
|
644
644
|
_a));
|
|
645
645
|
}
|
|
@@ -661,7 +661,7 @@ var AjaxMonitor = /** @class */ (function (_super) {
|
|
|
661
661
|
}
|
|
662
662
|
function _onAjaxComplete(xhr) {
|
|
663
663
|
var ajaxData = xhr[strAjaxData];
|
|
664
|
-
ajaxData[
|
|
664
|
+
ajaxData[_DYN_RESPONSE_FINISHED_TI15 /* @min:%2eresponseFinishedTime */] = dateTimeUtilsNow();
|
|
665
665
|
ajaxData[_DYN_STATUS /* @min:%2estatus */] = xhr[_DYN_STATUS /* @min:%2estatus */];
|
|
666
666
|
function _reportXhrError(e, failedProps) {
|
|
667
667
|
var errorProps = failedProps || {};
|
|
@@ -685,7 +685,7 @@ var AjaxMonitor = /** @class */ (function (_super) {
|
|
|
685
685
|
_a.response = xhr[_DYN_RESPONSE /* @min:%2eresponse */],
|
|
686
686
|
_a);
|
|
687
687
|
if (_enableResponseHeaderTracking) {
|
|
688
|
-
var headers = xhr[
|
|
688
|
+
var headers = xhr[_DYN_GET_ALL_RESPONSE_HEA16 /* @min:%2egetAllResponseHeaders */]();
|
|
689
689
|
if (headers) {
|
|
690
690
|
// xhr.getAllResponseHeaders() method returns all the response headers, separated by CRLF, as a string or null
|
|
691
691
|
// the regex converts the header string into an array of individual headers
|
|
@@ -717,12 +717,12 @@ var AjaxMonitor = /** @class */ (function (_super) {
|
|
|
717
717
|
if (properties !== undefined) {
|
|
718
718
|
dependency[STR_PROPERTIES /* @min:%2eproperties */] = __assign(__assign({}, dependency.properties), properties);
|
|
719
719
|
}
|
|
720
|
-
_self[
|
|
720
|
+
_self[_DYN_TRACK_DEPENDENCY_DAT2 /* @min:%2etrackDependencyDataInternal */](dependency, null, ajaxData[_DYN_GET_PART_APROPS /* @min:%2egetPartAProps */]());
|
|
721
721
|
}
|
|
722
722
|
else {
|
|
723
723
|
_reportXhrError(null, {
|
|
724
724
|
requestSentTime: ajaxData[_DYN_REQUEST_SENT_TIME /* @min:%2erequestSentTime */],
|
|
725
|
-
responseFinishedTime: ajaxData[
|
|
725
|
+
responseFinishedTime: ajaxData[_DYN_RESPONSE_FINISHED_TI15 /* @min:%2eresponseFinishedTime */]
|
|
726
726
|
});
|
|
727
727
|
}
|
|
728
728
|
}
|
|
@@ -742,18 +742,18 @@ var AjaxMonitor = /** @class */ (function (_super) {
|
|
|
742
742
|
function _getAjaxCorrelationContext(xhr) {
|
|
743
743
|
var _a;
|
|
744
744
|
try {
|
|
745
|
-
var responseHeadersString = xhr[
|
|
745
|
+
var responseHeadersString = xhr[_DYN_GET_ALL_RESPONSE_HEA16 /* @min:%2egetAllResponseHeaders */]();
|
|
746
746
|
if (responseHeadersString !== null) {
|
|
747
747
|
var index = _indexOf(responseHeadersString[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */](), RequestHeaders[8 /* eRequestHeaders.requestContextHeaderLowerCase */]);
|
|
748
748
|
if (index !== -1) {
|
|
749
749
|
var responseHeader = xhr.getResponseHeader(RequestHeaders[0 /* eRequestHeaders.requestContextHeader */]);
|
|
750
|
-
return CorrelationIdHelper[
|
|
750
|
+
return CorrelationIdHelper[_DYN_GET_CORRELATION_CONT17 /* @min:%2egetCorrelationContext */](responseHeader);
|
|
751
751
|
}
|
|
752
752
|
}
|
|
753
753
|
}
|
|
754
754
|
catch (e) {
|
|
755
755
|
_throwInternalWarning(_self, 18 /* _eInternalMessageId.FailedMonitorAjaxGetCorrelationHeader */, "Failed to get Request-Context correlation header as it may be not included in the response or not accessible.", (_a = {},
|
|
756
|
-
_a[
|
|
756
|
+
_a[_DYN_AJAX_DIAGNOSTICS_MES19 /* @min:ajaxDiagnosticsMessage */] = _getFailedAjaxDiagnosticsMessage(xhr),
|
|
757
757
|
_a.exception = dumpObj(e),
|
|
758
758
|
_a));
|
|
759
759
|
}
|
|
@@ -776,7 +776,7 @@ var AjaxMonitor = /** @class */ (function (_super) {
|
|
|
776
776
|
var perfMark = ajaxData[_DYN_PERF_MARK /* @min:%2eperfMark */];
|
|
777
777
|
var performance = getPerformance();
|
|
778
778
|
var maxAttempts = _config.maxAjaxPerfLookupAttempts;
|
|
779
|
-
var retryDelay = _config[
|
|
779
|
+
var retryDelay = _config[_DYN_AJAX_PERF_LOOKUP_DEL18 /* @min:%2eajaxPerfLookupDelay */];
|
|
780
780
|
var requestUrl = ajaxData[_DYN_REQUEST_URL /* @min:%2erequestUrl */];
|
|
781
781
|
var attempt = 0;
|
|
782
782
|
(function locateResourceTiming() {
|
|
@@ -831,11 +831,12 @@ var AjaxMonitor = /** @class */ (function (_super) {
|
|
|
831
831
|
})();
|
|
832
832
|
}
|
|
833
833
|
function _createFetchRecord(input, init) {
|
|
834
|
+
var _a;
|
|
834
835
|
var distributedTraceCtx = _getDistributedTraceCtx();
|
|
835
|
-
var traceID = (distributedTraceCtx && distributedTraceCtx
|
|
836
|
+
var traceID = (distributedTraceCtx && distributedTraceCtx[_DYN_GET_TRACE_ID /* @min:%2egetTraceId */]()) || generateW3CId();
|
|
836
837
|
var spanID = generateW3CId().substr(0, 16);
|
|
837
|
-
var ajaxData = new ajaxRecord(traceID, spanID, _self[strDiagLog]());
|
|
838
|
-
ajaxData[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */] = distributedTraceCtx && distributedTraceCtx
|
|
838
|
+
var ajaxData = new ajaxRecord(traceID, spanID, _self[strDiagLog](), (_a = _self.core) === null || _a === void 0 ? void 0 : _a.getTraceCtx());
|
|
839
|
+
ajaxData[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */] = distributedTraceCtx && distributedTraceCtx[_DYN_GET_TRACE_FLAGS /* @min:%2egetTraceFlags */]();
|
|
839
840
|
ajaxData[_DYN_REQUEST_SENT_TIME /* @min:%2erequestSentTime */] = dateTimeUtilsNow();
|
|
840
841
|
ajaxData[_DYN_ERROR_STATUS_TEXT /* @min:%2eerrorStatusText */] = _enableAjaxErrorStatusText;
|
|
841
842
|
if (input instanceof Request) {
|
|
@@ -894,7 +895,7 @@ var AjaxMonitor = /** @class */ (function (_super) {
|
|
|
894
895
|
}
|
|
895
896
|
_throwInternalWarning(_self, msgId, "Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.", errorProps);
|
|
896
897
|
}
|
|
897
|
-
ajaxData[
|
|
898
|
+
ajaxData[_DYN_RESPONSE_FINISHED_TI15 /* @min:%2eresponseFinishedTime */] = dateTimeUtilsNow();
|
|
898
899
|
ajaxData[_DYN_STATUS /* @min:%2estatus */] = status;
|
|
899
900
|
_findPerfResourceEntry("fetch", ajaxData, function () {
|
|
900
901
|
var dependency = ajaxData[_DYN__CREATE_TRACK_ITEM /* @min:%2eCreateTrackItem */]("Fetch", _enableRequestHeaderTracking, getResponse);
|
|
@@ -911,12 +912,12 @@ var AjaxMonitor = /** @class */ (function (_super) {
|
|
|
911
912
|
if (properties !== undefined) {
|
|
912
913
|
dependency[STR_PROPERTIES /* @min:%2eproperties */] = __assign(__assign({}, dependency.properties), properties);
|
|
913
914
|
}
|
|
914
|
-
_self[
|
|
915
|
+
_self[_DYN_TRACK_DEPENDENCY_DAT2 /* @min:%2etrackDependencyDataInternal */](dependency, null, ajaxData[_DYN_GET_PART_APROPS /* @min:%2egetPartAProps */]());
|
|
915
916
|
}
|
|
916
917
|
else {
|
|
917
918
|
_reportFetchError(14 /* _eInternalMessageId.FailedMonitorAjaxDur */, null, {
|
|
918
919
|
requestSentTime: ajaxData[_DYN_REQUEST_SENT_TIME /* @min:%2erequestSentTime */],
|
|
919
|
-
responseFinishedTime: ajaxData[
|
|
920
|
+
responseFinishedTime: ajaxData[_DYN_RESPONSE_FINISHED_TI15 /* @min:%2eresponseFinishedTime */]
|
|
920
921
|
});
|
|
921
922
|
}
|
|
922
923
|
}, function (e) {
|
|
@@ -927,7 +928,7 @@ var AjaxMonitor = /** @class */ (function (_super) {
|
|
|
927
928
|
if (response && response[_DYN_HEADERS /* @min:%2eheaders */]) {
|
|
928
929
|
try {
|
|
929
930
|
var responseHeader = response[_DYN_HEADERS /* @min:%2eheaders */].get(RequestHeaders[0 /* eRequestHeaders.requestContextHeader */]);
|
|
930
|
-
return CorrelationIdHelper[
|
|
931
|
+
return CorrelationIdHelper[_DYN_GET_CORRELATION_CONT17 /* @min:%2egetCorrelationContext */](responseHeader);
|
|
931
932
|
}
|
|
932
933
|
catch (e) {
|
|
933
934
|
_throwInternalWarning(_self, 18 /* _eInternalMessageId.FailedMonitorAjaxGetCorrelationHeader */, "Failed to get Request-Context correlation header as it may be not included in the response or not accessible.", {
|
|
@@ -943,10 +944,10 @@ var AjaxMonitor = /** @class */ (function (_super) {
|
|
|
943
944
|
AjaxMonitor.getDefaultConfig = function () {
|
|
944
945
|
var _a;
|
|
945
946
|
var config = (_a = {},
|
|
946
|
-
_a[
|
|
947
|
-
_a[
|
|
948
|
-
_a[
|
|
949
|
-
_a[
|
|
947
|
+
_a[_DYN_MAX_AJAX_CALLS_PER_V9 /* @min:maxAjaxCallsPerView */] = 500,
|
|
948
|
+
_a[_DYN_DISABLE_AJAX_TRACKIN12 /* @min:disableAjaxTracking */] = false,
|
|
949
|
+
_a[_DYN_DISABLE_FETCH_TRACKI13 /* @min:disableFetchTracking */] = false,
|
|
950
|
+
_a[_DYN_EXCLUDE_REQUEST_FROM11 /* @min:excludeRequestFromAutoTrackingPatterns */] = undefined,
|
|
950
951
|
_a.disableCorrelationHeaders = false,
|
|
951
952
|
_a.distributedTracingMode = 1 /* eDistributedTracingModes.AI_AND_W3C */,
|
|
952
953
|
_a.correlationHeaderExcludedDomains = DfltAjaxCorrelationHeaderExDomains,
|
|
@@ -954,12 +955,12 @@ var AjaxMonitor = /** @class */ (function (_super) {
|
|
|
954
955
|
_a.correlationHeaderExcludePatterns = undefined,
|
|
955
956
|
_a[_DYN_APP_ID /* @min:appId */] = undefined,
|
|
956
957
|
_a.enableCorsCorrelation = false,
|
|
957
|
-
_a[
|
|
958
|
-
_a[
|
|
959
|
-
_a[
|
|
960
|
-
_a[
|
|
958
|
+
_a[_DYN_ENABLE_REQUEST_HEADE6 /* @min:enableRequestHeaderTracking */] = false,
|
|
959
|
+
_a[_DYN_ENABLE_RESPONSE_HEAD10 /* @min:enableResponseHeaderTracking */] = false,
|
|
960
|
+
_a[_DYN_ENABLE_AJAX_ERROR_ST7 /* @min:enableAjaxErrorStatusText */] = false,
|
|
961
|
+
_a[_DYN_ENABLE_AJAX_PERF_TRA8 /* @min:enableAjaxPerfTracking */] = false,
|
|
961
962
|
_a.maxAjaxPerfLookupAttempts = 3,
|
|
962
|
-
_a[
|
|
963
|
+
_a[_DYN_AJAX_PERF_LOOKUP_DEL18 /* @min:ajaxPerfLookupDelay */] = 25,
|
|
963
964
|
_a.ignoreHeaders = [
|
|
964
965
|
"Authorization",
|
|
965
966
|
"X-API-Key",
|