@microsoft/applicationinsights-dependencies-js 3.0.0-beta.2208-03 → 3.0.0-beta.2208-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/applicationinsights-dependencies-js.integrity.json +9 -9
- package/browser/applicationinsights-dependencies-js.js +826 -681
- 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 +92 -19
- package/dist/applicationinsights-dependencies-js.api.md +10 -6
- package/dist/applicationinsights-dependencies-js.d.ts +27 -4
- package/dist/applicationinsights-dependencies-js.js +826 -681
- 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 +4 -4
- package/dist-esm/InternalConstants.js.map +1 -1
- package/dist-esm/__DynamicConstants.js +28 -23
- package/dist-esm/__DynamicConstants.js.map +1 -1
- package/dist-esm/ajax.js +56 -54
- 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 +5 -4
- package/src/InternalConstants.ts +3 -3
- package/src/__DynamicConstants.ts +27 -22
- package/src/ajax.ts +14 -14
- package/src/ajaxRecord.ts +62 -5
- package/tsconfig.json +1 -1
- package/types/__DynamicConstants.d.ts +22 -17
- package/types/ajax.d.ts +2 -2
- package/types/ajaxRecord.d.ts +24 -2
- package/types/tsdoc-metadata.json +1 -1
|
@@ -6,37 +6,39 @@
|
|
|
6
6
|
// AUTO GENERATED FILE: This file is Auto Generated during build.
|
|
7
7
|
// ##############################################################
|
|
8
8
|
|
|
9
|
-
//
|
|
10
|
-
// Note: DON'T Export these const from the package as we are still targeting
|
|
11
|
-
//
|
|
9
|
+
// ###########################################################################################################################################
|
|
10
|
+
// Note: DON'T Export these const from the package as we are still targeting IE this will export a mutable variables that someone could change
|
|
11
|
+
// ###########################################################################################################################################
|
|
12
12
|
|
|
13
13
|
export const _DYN_REQUEST_URL = "requestUrl"; // Count: 12
|
|
14
14
|
export const _DYN_INST = "inst"; // Count: 5
|
|
15
15
|
export const _DYN_LENGTH = "length"; // Count: 9
|
|
16
|
-
export const _DYN_TRACE_ID = "traceID"; // Count:
|
|
16
|
+
export const _DYN_TRACE_ID = "traceID"; // Count: 9
|
|
17
17
|
export const _DYN_SPAN_ID = "spanID"; // Count: 8
|
|
18
|
-
export const _DYN_TRACE_FLAGS = "traceFlags"; // Count:
|
|
18
|
+
export const _DYN_TRACE_FLAGS = "traceFlags"; // Count: 13
|
|
19
19
|
export const _DYN_CORE = "core"; // Count: 6
|
|
20
|
+
export const _DYN_TRACE_ID0 = "traceId"; // Count: 5
|
|
21
|
+
export const _DYN_SPAN_ID1 = "spanId"; // Count: 5
|
|
20
22
|
export const _DYN_GET_DEFAULT_CONFIG = "getDefaultConfig"; // Count: 2
|
|
21
|
-
export const
|
|
22
|
-
export const
|
|
23
|
+
export const _DYN_TRACK_DEPENDENCY_DAT2 = "trackDependencyDataInternal"; // Count: 4
|
|
24
|
+
export const _DYN_INCLUDE_CORRELATION_3 = "includeCorrelationHeaders"; // Count: 4
|
|
23
25
|
export const _DYN_GET_ABSOLUTE_URL = "getAbsoluteUrl"; // Count: 3
|
|
24
26
|
export const _DYN_HEADERS = "headers"; // Count: 6
|
|
25
27
|
export const _DYN_REQUEST_HEADERS = "requestHeaders"; // Count: 13
|
|
26
28
|
export const _DYN_APP_ID = "appId"; // Count: 5
|
|
27
29
|
export const _DYN_SET_REQUEST_HEADER = "setRequestHeader"; // Count: 3
|
|
28
|
-
export const
|
|
30
|
+
export const _DYN_DISTRIBUTED_TRACING_4 = "distributedTracingMode"; // Count: 3
|
|
29
31
|
export const _DYN_START_TIME = "startTime"; // Count: 6
|
|
30
32
|
export const _DYN_TO_LOWER_CASE = "toLowerCase"; // Count: 6
|
|
31
|
-
export const
|
|
32
|
-
export const
|
|
33
|
-
export const
|
|
34
|
-
export const
|
|
35
|
-
export const
|
|
36
|
-
export const
|
|
33
|
+
export const _DYN_ENABLE_REQUEST_HEADE5 = "enableRequestHeaderTracking"; // Count: 2
|
|
34
|
+
export const _DYN_ENABLE_AJAX_ERROR_ST6 = "enableAjaxErrorStatusText"; // Count: 2
|
|
35
|
+
export const _DYN_ENABLE_AJAX_PERF_TRA7 = "enableAjaxPerfTracking"; // Count: 2
|
|
36
|
+
export const _DYN_MAX_AJAX_CALLS_PER_V8 = "maxAjaxCallsPerView"; // Count: 2
|
|
37
|
+
export const _DYN_ENABLE_RESPONSE_HEAD9 = "enableResponseHeaderTracking"; // Count: 2
|
|
38
|
+
export const _DYN_EXCLUDE_REQUEST_FROM10 = "excludeRequestFromAutoTrackingPatterns"; // Count: 2
|
|
37
39
|
export const _DYN_ADD_REQUEST_CONTEXT = "addRequestContext"; // Count: 2
|
|
38
|
-
export const
|
|
39
|
-
export const
|
|
40
|
+
export const _DYN_DISABLE_AJAX_TRACKIN11 = "disableAjaxTracking"; // Count: 2
|
|
41
|
+
export const _DYN_DISABLE_FETCH_TRACKI12 = "disableFetchTracking"; // Count: 2
|
|
40
42
|
export const _DYN_STATUS = "status"; // Count: 10
|
|
41
43
|
export const _DYN_STATUS_TEXT = "statusText"; // Count: 8
|
|
42
44
|
export const _DYN_HEADER_MAP = "headerMap"; // Count: 8
|
|
@@ -44,19 +46,22 @@ export const _DYN_OPEN_DONE = "openDone"; // Count: 3
|
|
|
44
46
|
export const _DYN_SEND_DONE = "sendDone"; // Count: 3
|
|
45
47
|
export const _DYN_REQUEST_SENT_TIME = "requestSentTime"; // Count: 9
|
|
46
48
|
export const _DYN_ABORT_DONE = "abortDone"; // Count: 3
|
|
49
|
+
export const _DYN_GET_TRACE_ID = "getTraceId"; // Count: 3
|
|
50
|
+
export const _DYN_GET_TRACE_FLAGS = "getTraceFlags"; // Count: 3
|
|
47
51
|
export const _DYN_METHOD = "method"; // Count: 10
|
|
48
52
|
export const _DYN_ERROR_STATUS_TEXT = "errorStatusText"; // Count: 3
|
|
49
|
-
export const
|
|
53
|
+
export const _DYN_STATE_CHANGE_ATTACHE13 = "stateChangeAttached"; // Count: 2
|
|
50
54
|
export const _DYN_RESPONSE_TEXT = "responseText"; // Count: 5
|
|
51
|
-
export const
|
|
55
|
+
export const _DYN_RESPONSE_FINISHED_TI14 = "responseFinishedTime"; // Count: 7
|
|
52
56
|
export const _DYN__CREATE_TRACK_ITEM = "CreateTrackItem"; // Count: 3
|
|
53
57
|
export const _DYN_RESPONSE = "response"; // Count: 4
|
|
54
|
-
export const
|
|
55
|
-
export const
|
|
58
|
+
export const _DYN_GET_ALL_RESPONSE_HEA15 = "getAllResponseHeaders"; // Count: 2
|
|
59
|
+
export const _DYN_GET_PART_APROPS = "getPartAProps"; // Count: 3
|
|
56
60
|
export const _DYN_PERF_MARK = "perfMark"; // Count: 4
|
|
57
|
-
export const
|
|
61
|
+
export const _DYN_AJAX_PERF_LOOKUP_DEL16 = "ajaxPerfLookupDelay"; // Count: 2
|
|
58
62
|
export const _DYN_NAME = "name"; // Count: 6
|
|
59
63
|
export const _DYN_PERF_TIMING = "perfTiming"; // Count: 3
|
|
60
|
-
export const
|
|
64
|
+
export const _DYN_AJAX_DIAGNOSTICS_MES17 = "ajaxDiagnosticsMessage"; // Count: 3
|
|
61
65
|
export const _DYN_CORRELATION_CONTEXT = "correlationContext"; // Count: 3
|
|
62
66
|
export const _DYN_AJAX_TOTAL_DURATION = "ajaxTotalDuration"; // Count: 3
|
|
67
|
+
export const _DYN_EVENT_TRACE_CTX = "eventTraceCtx"; // Count: 3
|
package/src/ajax.ts
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
|
|
4
4
|
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
DisabledPropertyName, IConfig, ICorrelationConfig, IDependencyTelemetry, IRequestContext, ITelemetryContext, PropertiesPluginIdentifier,
|
|
7
|
+
RemoteDependencyData, RequestHeaders, correlationIdCanIncludeCorrelationHeader, correlationIdGetCorrelationContext,
|
|
8
|
+
createDistributedTraceContextFromTrace, createTelemetryItem, createTraceParent, dateTimeUtilsNow, eDistributedTracingModes,
|
|
9
|
+
eRequestHeaders, formatTraceParent, isInternalApplicationInsightsEndpoint
|
|
9
10
|
} from "@microsoft/applicationinsights-common";
|
|
10
11
|
import {
|
|
11
12
|
BaseTelemetryPlugin, IAppInsightsCore, IConfiguration, ICustomProperties, IDistributedTraceContext, IInstrumentCallDetails,
|
|
@@ -23,7 +24,6 @@ const AJAX_MONITOR_PREFIX = "ai.ajxmn.";
|
|
|
23
24
|
const strDiagLog = "diagLog";
|
|
24
25
|
const strAjaxData = "ajaxData";
|
|
25
26
|
const strFetch = "fetch";
|
|
26
|
-
const strTrackDependencyDataInternal = "trackDependencyDataInternal"; // Using string to help with minification
|
|
27
27
|
|
|
28
28
|
// Using a global value so that to handle same iKey with multiple app insights instances (mostly for testing)
|
|
29
29
|
let _markCount: number = 0;
|
|
@@ -292,7 +292,7 @@ export class AjaxMonitor extends BaseTelemetryPlugin implements IDependenciesPlu
|
|
|
292
292
|
};
|
|
293
293
|
|
|
294
294
|
_self.trackDependencyData = (dependency: IDependencyTelemetry, properties?: { [key: string]: any }) => {
|
|
295
|
-
_self
|
|
295
|
+
_self.trackDependencyDataInternal(dependency, properties);
|
|
296
296
|
}
|
|
297
297
|
|
|
298
298
|
_self.includeCorrelationHeaders = (ajaxData: ajaxRecord, input?: Request | string, init?: RequestInit, xhr?: XMLHttpRequestInstrumented): any => {
|
|
@@ -302,7 +302,7 @@ export class AjaxMonitor extends BaseTelemetryPlugin implements IDependenciesPlu
|
|
|
302
302
|
_processDependencyListeners(_dependencyListeners, _self.core, ajaxData, xhr, input, init);
|
|
303
303
|
|
|
304
304
|
if (input) { // Fetch
|
|
305
|
-
if (
|
|
305
|
+
if (correlationIdCanIncludeCorrelationHeader(_config, ajaxData.getAbsoluteUrl(), currentWindowHost)) {
|
|
306
306
|
if (!init) {
|
|
307
307
|
init = {};
|
|
308
308
|
}
|
|
@@ -343,7 +343,7 @@ export class AjaxMonitor extends BaseTelemetryPlugin implements IDependenciesPlu
|
|
|
343
343
|
|
|
344
344
|
return init;
|
|
345
345
|
} else if (xhr) { // XHR
|
|
346
|
-
if (
|
|
346
|
+
if (correlationIdCanIncludeCorrelationHeader(_config, ajaxData.getAbsoluteUrl(), currentWindowHost)) {
|
|
347
347
|
if (_isUsingAIHeaders) {
|
|
348
348
|
const id = "|" + ajaxData.traceID + "." + ajaxData.spanID;
|
|
349
349
|
xhr.setRequestHeader(RequestHeaders[eRequestHeaders.requestIdHeader], id);
|
|
@@ -378,7 +378,7 @@ export class AjaxMonitor extends BaseTelemetryPlugin implements IDependenciesPlu
|
|
|
378
378
|
return undefined;
|
|
379
379
|
}
|
|
380
380
|
|
|
381
|
-
_self
|
|
381
|
+
_self.trackDependencyDataInternal = (dependency: IDependencyTelemetry, properties?: { [key: string]: any }, systemProperties?: { [key: string]: any }) => {
|
|
382
382
|
if (_maxAjaxCallsPerView === -1 || _trackAjaxAttempts < _maxAjaxCallsPerView) {
|
|
383
383
|
// Hack since expected format in w3c mode is |abc.def.
|
|
384
384
|
// Non-w3c format is |abc.def
|
|
@@ -789,7 +789,7 @@ export class AjaxMonitor extends BaseTelemetryPlugin implements IDependenciesPlu
|
|
|
789
789
|
const traceID = (distributedTraceCtx && distributedTraceCtx.getTraceId()) || generateW3CId();
|
|
790
790
|
const spanID = generateW3CId().substr(0, 16);
|
|
791
791
|
|
|
792
|
-
const ajaxData = new ajaxRecord(traceID, spanID, _self[strDiagLog]());
|
|
792
|
+
const ajaxData = new ajaxRecord(traceID, spanID, _self[strDiagLog](), _self.core?.getTraceCtx());
|
|
793
793
|
ajaxData.traceFlags = distributedTraceCtx && distributedTraceCtx.getTraceFlags();
|
|
794
794
|
ajaxData.method = method;
|
|
795
795
|
ajaxData.requestUrl = url;
|
|
@@ -906,7 +906,7 @@ export class AjaxMonitor extends BaseTelemetryPlugin implements IDependenciesPlu
|
|
|
906
906
|
if (properties !== undefined) {
|
|
907
907
|
dependency.properties = {...dependency.properties, ...properties};
|
|
908
908
|
}
|
|
909
|
-
_self
|
|
909
|
+
_self.trackDependencyDataInternal(dependency, null, ajaxData.getPartAProps());
|
|
910
910
|
} else {
|
|
911
911
|
_reportXhrError(null, {
|
|
912
912
|
requestSentTime: ajaxData.requestSentTime,
|
|
@@ -933,7 +933,7 @@ export class AjaxMonitor extends BaseTelemetryPlugin implements IDependenciesPlu
|
|
|
933
933
|
const index = _indexOf(responseHeadersString.toLowerCase(), RequestHeaders[eRequestHeaders.requestContextHeaderLowerCase]);
|
|
934
934
|
if (index !== -1) {
|
|
935
935
|
const responseHeader = xhr.getResponseHeader(RequestHeaders[eRequestHeaders.requestContextHeader]);
|
|
936
|
-
return
|
|
936
|
+
return correlationIdGetCorrelationContext(responseHeader);
|
|
937
937
|
}
|
|
938
938
|
}
|
|
939
939
|
} catch (e) {
|
|
@@ -1031,7 +1031,7 @@ export class AjaxMonitor extends BaseTelemetryPlugin implements IDependenciesPlu
|
|
|
1031
1031
|
const traceID = (distributedTraceCtx && distributedTraceCtx.getTraceId()) || generateW3CId();
|
|
1032
1032
|
const spanID = generateW3CId().substr(0, 16);
|
|
1033
1033
|
|
|
1034
|
-
let ajaxData = new ajaxRecord(traceID, spanID, _self[strDiagLog]());
|
|
1034
|
+
let ajaxData = new ajaxRecord(traceID, spanID, _self[strDiagLog](), _self.core?.getTraceCtx());
|
|
1035
1035
|
ajaxData.traceFlags = distributedTraceCtx && distributedTraceCtx.getTraceFlags();
|
|
1036
1036
|
ajaxData.requestSentTime = dateTimeUtilsNow();
|
|
1037
1037
|
ajaxData.errorStatusText = _enableAjaxErrorStatusText;
|
|
@@ -1126,7 +1126,7 @@ export class AjaxMonitor extends BaseTelemetryPlugin implements IDependenciesPlu
|
|
|
1126
1126
|
if (properties !== undefined) {
|
|
1127
1127
|
dependency.properties = {...dependency.properties, ...properties};
|
|
1128
1128
|
}
|
|
1129
|
-
_self
|
|
1129
|
+
_self.trackDependencyDataInternal(dependency, null, ajaxData.getPartAProps());
|
|
1130
1130
|
} else {
|
|
1131
1131
|
_reportFetchError(_eInternalMessageId.FailedMonitorAjaxDur, null,
|
|
1132
1132
|
{
|
|
@@ -1143,7 +1143,7 @@ export class AjaxMonitor extends BaseTelemetryPlugin implements IDependenciesPlu
|
|
|
1143
1143
|
if (response && response.headers) {
|
|
1144
1144
|
try {
|
|
1145
1145
|
const responseHeader: string = response.headers.get(RequestHeaders[eRequestHeaders.requestContextHeader]);
|
|
1146
|
-
return
|
|
1146
|
+
return correlationIdGetCorrelationContext(responseHeader);
|
|
1147
1147
|
} catch (e) {
|
|
1148
1148
|
_throwInternalWarning(_self,
|
|
1149
1149
|
_eInternalMessageId.FailedMonitorAjaxGetCorrelationHeader,
|
package/src/ajaxRecord.ts
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
|
|
4
4
|
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
5
5
|
import {
|
|
6
|
-
IDependencyTelemetry, dataSanitizeUrl, dateTimeUtilsDuration, msToTimeSpan, urlGetAbsoluteUrl, urlGetCompleteUrl
|
|
6
|
+
Extensions, IDependencyTelemetry, dataSanitizeUrl, dateTimeUtilsDuration, msToTimeSpan, urlGetAbsoluteUrl, urlGetCompleteUrl
|
|
7
7
|
} from "@microsoft/applicationinsights-common";
|
|
8
8
|
import {
|
|
9
|
-
IDiagnosticLogger, arrForEach, isNumber, isString, normalizeJsName, objForEachKey, objKeys
|
|
9
|
+
IDiagnosticLogger, IDistributedTraceContext, arrForEach, isNullOrUndefined, isNumber, isString, normalizeJsName, objForEachKey, objKeys
|
|
10
10
|
} from "@microsoft/applicationinsights-core-js";
|
|
11
11
|
import { STR_DURATION, STR_PROPERTIES } from "./InternalConstants";
|
|
12
12
|
|
|
@@ -19,6 +19,12 @@ export interface IAjaxRecordResponse {
|
|
|
19
19
|
response?: Object
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
interface ITraceCtx {
|
|
23
|
+
traceId: string;
|
|
24
|
+
spanId: string;
|
|
25
|
+
traceFlags: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
22
28
|
/** @ignore */
|
|
23
29
|
function _calcPerfDuration(resourceEntry:PerformanceResourceTiming, start:string, end:string) {
|
|
24
30
|
let result = 0;
|
|
@@ -237,11 +243,27 @@ export class ajaxRecord {
|
|
|
237
243
|
// <summary>Determines whether or not JavaScript exception occured in xhr.onreadystatechange code. 1 if occured, otherwise 0.</summary>
|
|
238
244
|
public clientFailure: number;
|
|
239
245
|
|
|
246
|
+
/**
|
|
247
|
+
* The traceId to use for the dependency call
|
|
248
|
+
*/
|
|
240
249
|
public traceID: string;
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* The spanId to use for the dependency call
|
|
253
|
+
*/
|
|
241
254
|
public spanID: string;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* The traceFlags to use for the dependency call
|
|
258
|
+
*/
|
|
242
259
|
public traceFlags?: number;
|
|
243
260
|
|
|
244
|
-
|
|
261
|
+
/**
|
|
262
|
+
* The trace context to use for reporting the remote dependency call
|
|
263
|
+
*/
|
|
264
|
+
public eventTraceCtx: ITraceCtx;
|
|
265
|
+
|
|
266
|
+
constructor(traceId: string, spanId: string, logger: IDiagnosticLogger, traceCtx?: IDistributedTraceContext) {
|
|
245
267
|
let self = this;
|
|
246
268
|
let _logger: IDiagnosticLogger = logger;
|
|
247
269
|
let strResponseText = "responseText";
|
|
@@ -269,8 +291,19 @@ export class ajaxRecord {
|
|
|
269
291
|
self.xhrMonitoringState = new XHRMonitoringState();
|
|
270
292
|
self.clientFailure = 0;
|
|
271
293
|
|
|
272
|
-
self.traceID =
|
|
273
|
-
self.spanID =
|
|
294
|
+
self.traceID = traceId;
|
|
295
|
+
self.spanID = spanId;
|
|
296
|
+
self.traceFlags = traceCtx?.getTraceFlags();
|
|
297
|
+
|
|
298
|
+
if (traceCtx) {
|
|
299
|
+
self.eventTraceCtx = {
|
|
300
|
+
traceId: traceCtx.getTraceId(),
|
|
301
|
+
spanId: traceCtx.getSpanId(),
|
|
302
|
+
traceFlags: traceCtx.getTraceFlags()
|
|
303
|
+
};
|
|
304
|
+
} else {
|
|
305
|
+
self.eventTraceCtx = null;
|
|
306
|
+
}
|
|
274
307
|
|
|
275
308
|
dynamicProto(ajaxRecord, self, (self) => {
|
|
276
309
|
self.getAbsoluteUrl= () => {
|
|
@@ -349,6 +382,25 @@ export class ajaxRecord {
|
|
|
349
382
|
|
|
350
383
|
return dependency;
|
|
351
384
|
}
|
|
385
|
+
|
|
386
|
+
self.getPartAProps = () => {
|
|
387
|
+
let partA: { [key: string]: any } = null;
|
|
388
|
+
|
|
389
|
+
let traceCtx = self.eventTraceCtx;
|
|
390
|
+
if (traceCtx && (traceCtx.traceId || traceCtx.spanId)) {
|
|
391
|
+
partA = {};
|
|
392
|
+
let traceExt = partA[Extensions.TraceExt] = {
|
|
393
|
+
traceID: traceCtx.traceId,
|
|
394
|
+
parentID: traceCtx.spanId
|
|
395
|
+
} as { [key: string]: any };
|
|
396
|
+
|
|
397
|
+
if (!isNullOrUndefined(traceCtx.traceFlags)) {
|
|
398
|
+
traceExt.traceFlags = traceCtx.traceFlags;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
return partA
|
|
403
|
+
};
|
|
352
404
|
});
|
|
353
405
|
}
|
|
354
406
|
|
|
@@ -366,4 +418,9 @@ export class ajaxRecord {
|
|
|
366
418
|
// @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
|
|
367
419
|
return null;
|
|
368
420
|
}
|
|
421
|
+
|
|
422
|
+
public getPartAProps(): { [key: string]: any } {
|
|
423
|
+
// @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
|
|
424
|
+
return null;
|
|
425
|
+
}
|
|
369
426
|
}
|
package/tsconfig.json
CHANGED
|
@@ -5,26 +5,28 @@ export declare const _DYN_TRACE_ID = "traceID";
|
|
|
5
5
|
export declare const _DYN_SPAN_ID = "spanID";
|
|
6
6
|
export declare const _DYN_TRACE_FLAGS = "traceFlags";
|
|
7
7
|
export declare const _DYN_CORE = "core";
|
|
8
|
+
export declare const _DYN_TRACE_ID0 = "traceId";
|
|
9
|
+
export declare const _DYN_SPAN_ID1 = "spanId";
|
|
8
10
|
export declare const _DYN_GET_DEFAULT_CONFIG = "getDefaultConfig";
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
+
export declare const _DYN_TRACK_DEPENDENCY_DAT2 = "trackDependencyDataInternal";
|
|
12
|
+
export declare const _DYN_INCLUDE_CORRELATION_3 = "includeCorrelationHeaders";
|
|
11
13
|
export declare const _DYN_GET_ABSOLUTE_URL = "getAbsoluteUrl";
|
|
12
14
|
export declare const _DYN_HEADERS = "headers";
|
|
13
15
|
export declare const _DYN_REQUEST_HEADERS = "requestHeaders";
|
|
14
16
|
export declare const _DYN_APP_ID = "appId";
|
|
15
17
|
export declare const _DYN_SET_REQUEST_HEADER = "setRequestHeader";
|
|
16
|
-
export declare const
|
|
18
|
+
export declare const _DYN_DISTRIBUTED_TRACING_4 = "distributedTracingMode";
|
|
17
19
|
export declare const _DYN_START_TIME = "startTime";
|
|
18
20
|
export declare const _DYN_TO_LOWER_CASE = "toLowerCase";
|
|
19
|
-
export declare const
|
|
20
|
-
export declare const
|
|
21
|
-
export declare const
|
|
22
|
-
export declare const
|
|
23
|
-
export declare const
|
|
24
|
-
export declare const
|
|
21
|
+
export declare const _DYN_ENABLE_REQUEST_HEADE5 = "enableRequestHeaderTracking";
|
|
22
|
+
export declare const _DYN_ENABLE_AJAX_ERROR_ST6 = "enableAjaxErrorStatusText";
|
|
23
|
+
export declare const _DYN_ENABLE_AJAX_PERF_TRA7 = "enableAjaxPerfTracking";
|
|
24
|
+
export declare const _DYN_MAX_AJAX_CALLS_PER_V8 = "maxAjaxCallsPerView";
|
|
25
|
+
export declare const _DYN_ENABLE_RESPONSE_HEAD9 = "enableResponseHeaderTracking";
|
|
26
|
+
export declare const _DYN_EXCLUDE_REQUEST_FROM10 = "excludeRequestFromAutoTrackingPatterns";
|
|
25
27
|
export declare const _DYN_ADD_REQUEST_CONTEXT = "addRequestContext";
|
|
26
|
-
export declare const
|
|
27
|
-
export declare const
|
|
28
|
+
export declare const _DYN_DISABLE_AJAX_TRACKIN11 = "disableAjaxTracking";
|
|
29
|
+
export declare const _DYN_DISABLE_FETCH_TRACKI12 = "disableFetchTracking";
|
|
28
30
|
export declare const _DYN_STATUS = "status";
|
|
29
31
|
export declare const _DYN_STATUS_TEXT = "statusText";
|
|
30
32
|
export declare const _DYN_HEADER_MAP = "headerMap";
|
|
@@ -32,19 +34,22 @@ export declare const _DYN_OPEN_DONE = "openDone";
|
|
|
32
34
|
export declare const _DYN_SEND_DONE = "sendDone";
|
|
33
35
|
export declare const _DYN_REQUEST_SENT_TIME = "requestSentTime";
|
|
34
36
|
export declare const _DYN_ABORT_DONE = "abortDone";
|
|
37
|
+
export declare const _DYN_GET_TRACE_ID = "getTraceId";
|
|
38
|
+
export declare const _DYN_GET_TRACE_FLAGS = "getTraceFlags";
|
|
35
39
|
export declare const _DYN_METHOD = "method";
|
|
36
40
|
export declare const _DYN_ERROR_STATUS_TEXT = "errorStatusText";
|
|
37
|
-
export declare const
|
|
41
|
+
export declare const _DYN_STATE_CHANGE_ATTACHE13 = "stateChangeAttached";
|
|
38
42
|
export declare const _DYN_RESPONSE_TEXT = "responseText";
|
|
39
|
-
export declare const
|
|
43
|
+
export declare const _DYN_RESPONSE_FINISHED_TI14 = "responseFinishedTime";
|
|
40
44
|
export declare const _DYN__CREATE_TRACK_ITEM = "CreateTrackItem";
|
|
41
45
|
export declare const _DYN_RESPONSE = "response";
|
|
42
|
-
export declare const
|
|
43
|
-
export declare const
|
|
46
|
+
export declare const _DYN_GET_ALL_RESPONSE_HEA15 = "getAllResponseHeaders";
|
|
47
|
+
export declare const _DYN_GET_PART_APROPS = "getPartAProps";
|
|
44
48
|
export declare const _DYN_PERF_MARK = "perfMark";
|
|
45
|
-
export declare const
|
|
49
|
+
export declare const _DYN_AJAX_PERF_LOOKUP_DEL16 = "ajaxPerfLookupDelay";
|
|
46
50
|
export declare const _DYN_NAME = "name";
|
|
47
51
|
export declare const _DYN_PERF_TIMING = "perfTiming";
|
|
48
|
-
export declare const
|
|
52
|
+
export declare const _DYN_AJAX_DIAGNOSTICS_MES17 = "ajaxDiagnosticsMessage";
|
|
49
53
|
export declare const _DYN_CORRELATION_CONTEXT = "correlationContext";
|
|
50
54
|
export declare const _DYN_AJAX_TOTAL_DURATION = "ajaxTotalDuration";
|
|
55
|
+
export declare const _DYN_EVENT_TRACE_CTX = "eventTraceCtx";
|
package/types/ajax.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IConfig, ICorrelationConfig, IDependencyTelemetry } from "@microsoft/applicationinsights-common";
|
|
2
2
|
import { BaseTelemetryPlugin, IAppInsightsCore, IConfiguration, IPlugin, IProcessTelemetryContext, ITelemetryItem, ITelemetryPluginChain } from "@microsoft/applicationinsights-core-js";
|
|
3
3
|
import { DependencyListenerFunction, IDependencyListenerContainer, IDependencyListenerHandler } from "./DependencyListener";
|
|
4
|
-
import {
|
|
4
|
+
import { _DYN_INCLUDE_CORRELATION_3 } from "./__DynamicConstants";
|
|
5
5
|
import { ajaxRecord } from "./ajaxRecord";
|
|
6
6
|
export interface XMLHttpRequestInstrumented extends XMLHttpRequest {
|
|
7
7
|
ajaxData: ajaxRecord;
|
|
@@ -15,7 +15,7 @@ export interface IDependenciesPlugin extends IDependencyListenerContainer {
|
|
|
15
15
|
trackDependencyData(dependency: IDependencyTelemetry): void;
|
|
16
16
|
}
|
|
17
17
|
export interface IInstrumentationRequirements extends IDependenciesPlugin {
|
|
18
|
-
[
|
|
18
|
+
[_DYN_INCLUDE_CORRELATION_3]: (ajaxData: ajaxRecord, input?: Request | string, init?: RequestInit, xhr?: XMLHttpRequestInstrumented) => any;
|
|
19
19
|
}
|
|
20
20
|
export declare class AjaxMonitor extends BaseTelemetryPlugin implements IDependenciesPlugin, IInstrumentationRequirements {
|
|
21
21
|
static identifier: string;
|
package/types/ajaxRecord.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IDependencyTelemetry } from "@microsoft/applicationinsights-common";
|
|
2
|
-
import { IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
|
|
2
|
+
import { IDiagnosticLogger, IDistributedTraceContext } from "@microsoft/applicationinsights-core-js";
|
|
3
3
|
import { _DYN_HEADER_MAP } from "./__DynamicConstants";
|
|
4
4
|
export interface IAjaxRecordResponse {
|
|
5
5
|
statusText: string;
|
|
@@ -9,6 +9,11 @@ export interface IAjaxRecordResponse {
|
|
|
9
9
|
responseText?: string;
|
|
10
10
|
response?: Object;
|
|
11
11
|
}
|
|
12
|
+
interface ITraceCtx {
|
|
13
|
+
traceId: string;
|
|
14
|
+
spanId: string;
|
|
15
|
+
traceFlags: number;
|
|
16
|
+
}
|
|
12
17
|
export declare class XHRMonitoringState {
|
|
13
18
|
openDone: boolean;
|
|
14
19
|
setRequestHeaderDone: boolean;
|
|
@@ -42,11 +47,28 @@ export declare class ajaxRecord {
|
|
|
42
47
|
endTime: number;
|
|
43
48
|
xhrMonitoringState: XHRMonitoringState;
|
|
44
49
|
clientFailure: number;
|
|
50
|
+
/**
|
|
51
|
+
* The traceId to use for the dependency call
|
|
52
|
+
*/
|
|
45
53
|
traceID: string;
|
|
54
|
+
/**
|
|
55
|
+
* The spanId to use for the dependency call
|
|
56
|
+
*/
|
|
46
57
|
spanID: string;
|
|
58
|
+
/**
|
|
59
|
+
* The traceFlags to use for the dependency call
|
|
60
|
+
*/
|
|
47
61
|
traceFlags?: number;
|
|
48
|
-
|
|
62
|
+
/**
|
|
63
|
+
* The trace context to use for reporting the remote dependency call
|
|
64
|
+
*/
|
|
65
|
+
eventTraceCtx: ITraceCtx;
|
|
66
|
+
constructor(traceId: string, spanId: string, logger: IDiagnosticLogger, traceCtx?: IDistributedTraceContext);
|
|
49
67
|
getAbsoluteUrl(): string;
|
|
50
68
|
getPathName(): string;
|
|
51
69
|
CreateTrackItem(ajaxType: string, enableRequestHeaderTracking: boolean, getResponse: () => IAjaxRecordResponse): IDependencyTelemetry;
|
|
70
|
+
getPartAProps(): {
|
|
71
|
+
[key: string]: any;
|
|
72
|
+
};
|
|
52
73
|
}
|
|
74
|
+
export {};
|