@microsoft/applicationinsights-dependencies-js 2.8.6-nightly.2208-01 → 3.0.0-beta.2208-03
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 +74 -215
- 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 +10 -87
- package/dist/applicationinsights-dependencies-js.api.md +6 -10
- package/dist/applicationinsights-dependencies-js.d.ts +4 -27
- package/dist/applicationinsights-dependencies-js.js +74 -215
- 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 +4 -27
- package/dist-esm/DependencyListener.js +1 -1
- package/dist-esm/InternalConstants.js +1 -1
- package/dist-esm/__DynamicConstants.js +20 -27
- package/dist-esm/__DynamicConstants.js.map +1 -1
- package/dist-esm/ajax.js +52 -53
- package/dist-esm/ajax.js.map +1 -1
- package/dist-esm/ajaxRecord.js +9 -38
- 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 +4 -4
- package/src/__DynamicConstants.ts +19 -26
- package/src/ajax.ts +7 -6
- package/src/ajaxRecord.ts +5 -62
- package/types/__DynamicConstants.d.ts +17 -24
- package/types/ajax.d.ts +2 -2
- package/types/ajaxRecord.d.ts +2 -24
- package/types/tsdoc-metadata.json +1 -1
|
@@ -13,33 +13,30 @@
|
|
|
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: 8
|
|
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: 8
|
|
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
|
|
22
20
|
export const _DYN_GET_DEFAULT_CONFIG = "getDefaultConfig"; // Count: 2
|
|
23
|
-
export const
|
|
24
|
-
export const
|
|
25
|
-
export const _DYN_CAN_INCLUDE_CORRELAT4 = "canIncludeCorrelationHeader"; // Count: 2
|
|
21
|
+
export const _DYN_INCLUDE_CORRELATION_0 = "includeCorrelationHeaders"; // Count: 4
|
|
22
|
+
export const _DYN_CAN_INCLUDE_CORRELAT1 = "canIncludeCorrelationHeader"; // Count: 2
|
|
26
23
|
export const _DYN_GET_ABSOLUTE_URL = "getAbsoluteUrl"; // Count: 3
|
|
27
24
|
export const _DYN_HEADERS = "headers"; // Count: 6
|
|
28
25
|
export const _DYN_REQUEST_HEADERS = "requestHeaders"; // Count: 13
|
|
29
26
|
export const _DYN_APP_ID = "appId"; // Count: 5
|
|
30
27
|
export const _DYN_SET_REQUEST_HEADER = "setRequestHeader"; // Count: 3
|
|
31
|
-
export const
|
|
28
|
+
export const _DYN_DISTRIBUTED_TRACING_2 = "distributedTracingMode"; // Count: 3
|
|
32
29
|
export const _DYN_START_TIME = "startTime"; // Count: 6
|
|
33
30
|
export const _DYN_TO_LOWER_CASE = "toLowerCase"; // Count: 6
|
|
34
|
-
export const
|
|
35
|
-
export const
|
|
36
|
-
export const
|
|
37
|
-
export const
|
|
38
|
-
export const
|
|
39
|
-
export const
|
|
31
|
+
export const _DYN_ENABLE_REQUEST_HEADE3 = "enableRequestHeaderTracking"; // Count: 2
|
|
32
|
+
export const _DYN_ENABLE_AJAX_ERROR_ST4 = "enableAjaxErrorStatusText"; // Count: 2
|
|
33
|
+
export const _DYN_ENABLE_AJAX_PERF_TRA5 = "enableAjaxPerfTracking"; // Count: 2
|
|
34
|
+
export const _DYN_MAX_AJAX_CALLS_PER_V6 = "maxAjaxCallsPerView"; // Count: 2
|
|
35
|
+
export const _DYN_ENABLE_RESPONSE_HEAD7 = "enableResponseHeaderTracking"; // Count: 2
|
|
36
|
+
export const _DYN_EXCLUDE_REQUEST_FROM8 = "excludeRequestFromAutoTrackingPatterns"; // Count: 2
|
|
40
37
|
export const _DYN_ADD_REQUEST_CONTEXT = "addRequestContext"; // Count: 2
|
|
41
|
-
export const
|
|
42
|
-
export const
|
|
38
|
+
export const _DYN_DISABLE_AJAX_TRACKIN9 = "disableAjaxTracking"; // Count: 2
|
|
39
|
+
export const _DYN_DISABLE_FETCH_TRACKI10 = "disableFetchTracking"; // Count: 2
|
|
43
40
|
export const _DYN_STATUS = "status"; // Count: 10
|
|
44
41
|
export const _DYN_STATUS_TEXT = "statusText"; // Count: 8
|
|
45
42
|
export const _DYN_HEADER_MAP = "headerMap"; // Count: 8
|
|
@@ -47,23 +44,19 @@ export const _DYN_OPEN_DONE = "openDone"; // Count: 3
|
|
|
47
44
|
export const _DYN_SEND_DONE = "sendDone"; // Count: 3
|
|
48
45
|
export const _DYN_REQUEST_SENT_TIME = "requestSentTime"; // Count: 9
|
|
49
46
|
export const _DYN_ABORT_DONE = "abortDone"; // Count: 3
|
|
50
|
-
export const _DYN_GET_TRACE_ID = "getTraceId"; // Count: 3
|
|
51
|
-
export const _DYN_GET_TRACE_FLAGS = "getTraceFlags"; // Count: 3
|
|
52
47
|
export const _DYN_METHOD = "method"; // Count: 10
|
|
53
48
|
export const _DYN_ERROR_STATUS_TEXT = "errorStatusText"; // Count: 3
|
|
54
|
-
export const
|
|
49
|
+
export const _DYN_STATE_CHANGE_ATTACHE11 = "stateChangeAttached"; // Count: 2
|
|
55
50
|
export const _DYN_RESPONSE_TEXT = "responseText"; // Count: 5
|
|
56
|
-
export const
|
|
51
|
+
export const _DYN_RESPONSE_FINISHED_TI12 = "responseFinishedTime"; // Count: 7
|
|
57
52
|
export const _DYN__CREATE_TRACK_ITEM = "CreateTrackItem"; // Count: 3
|
|
58
53
|
export const _DYN_RESPONSE = "response"; // Count: 4
|
|
59
|
-
export const
|
|
60
|
-
export const
|
|
61
|
-
export const _DYN_GET_CORRELATION_CONT17 = "getCorrelationContext"; // Count: 2
|
|
54
|
+
export const _DYN_GET_ALL_RESPONSE_HEA13 = "getAllResponseHeaders"; // Count: 2
|
|
55
|
+
export const _DYN_GET_CORRELATION_CONT14 = "getCorrelationContext"; // Count: 2
|
|
62
56
|
export const _DYN_PERF_MARK = "perfMark"; // Count: 4
|
|
63
|
-
export const
|
|
57
|
+
export const _DYN_AJAX_PERF_LOOKUP_DEL15 = "ajaxPerfLookupDelay"; // Count: 2
|
|
64
58
|
export const _DYN_NAME = "name"; // Count: 6
|
|
65
59
|
export const _DYN_PERF_TIMING = "perfTiming"; // Count: 3
|
|
66
|
-
export const
|
|
60
|
+
export const _DYN_AJAX_DIAGNOSTICS_MES16 = "ajaxDiagnosticsMessage"; // Count: 3
|
|
67
61
|
export const _DYN_CORRELATION_CONTEXT = "correlationContext"; // Count: 3
|
|
68
62
|
export const _DYN_AJAX_TOTAL_DURATION = "ajaxTotalDuration"; // Count: 3
|
|
69
|
-
export const _DYN_EVENT_TRACE_CTX = "eventTraceCtx"; // Count: 3
|
package/src/ajax.ts
CHANGED
|
@@ -23,6 +23,7 @@ const AJAX_MONITOR_PREFIX = "ai.ajxmn.";
|
|
|
23
23
|
const strDiagLog = "diagLog";
|
|
24
24
|
const strAjaxData = "ajaxData";
|
|
25
25
|
const strFetch = "fetch";
|
|
26
|
+
const strTrackDependencyDataInternal = "trackDependencyDataInternal"; // Using string to help with minification
|
|
26
27
|
|
|
27
28
|
// Using a global value so that to handle same iKey with multiple app insights instances (mostly for testing)
|
|
28
29
|
let _markCount: number = 0;
|
|
@@ -291,7 +292,7 @@ export class AjaxMonitor extends BaseTelemetryPlugin implements IDependenciesPlu
|
|
|
291
292
|
};
|
|
292
293
|
|
|
293
294
|
_self.trackDependencyData = (dependency: IDependencyTelemetry, properties?: { [key: string]: any }) => {
|
|
294
|
-
_self
|
|
295
|
+
_self[strTrackDependencyDataInternal](dependency, properties);
|
|
295
296
|
}
|
|
296
297
|
|
|
297
298
|
_self.includeCorrelationHeaders = (ajaxData: ajaxRecord, input?: Request | string, init?: RequestInit, xhr?: XMLHttpRequestInstrumented): any => {
|
|
@@ -377,7 +378,7 @@ export class AjaxMonitor extends BaseTelemetryPlugin implements IDependenciesPlu
|
|
|
377
378
|
return undefined;
|
|
378
379
|
}
|
|
379
380
|
|
|
380
|
-
_self
|
|
381
|
+
_self[strTrackDependencyDataInternal] = (dependency: IDependencyTelemetry, properties?: { [key: string]: any }, systemProperties?: { [key: string]: any }) => {
|
|
381
382
|
if (_maxAjaxCallsPerView === -1 || _trackAjaxAttempts < _maxAjaxCallsPerView) {
|
|
382
383
|
// Hack since expected format in w3c mode is |abc.def.
|
|
383
384
|
// Non-w3c format is |abc.def
|
|
@@ -788,7 +789,7 @@ export class AjaxMonitor extends BaseTelemetryPlugin implements IDependenciesPlu
|
|
|
788
789
|
const traceID = (distributedTraceCtx && distributedTraceCtx.getTraceId()) || generateW3CId();
|
|
789
790
|
const spanID = generateW3CId().substr(0, 16);
|
|
790
791
|
|
|
791
|
-
const ajaxData = new ajaxRecord(traceID, spanID, _self[strDiagLog]()
|
|
792
|
+
const ajaxData = new ajaxRecord(traceID, spanID, _self[strDiagLog]());
|
|
792
793
|
ajaxData.traceFlags = distributedTraceCtx && distributedTraceCtx.getTraceFlags();
|
|
793
794
|
ajaxData.method = method;
|
|
794
795
|
ajaxData.requestUrl = url;
|
|
@@ -905,7 +906,7 @@ export class AjaxMonitor extends BaseTelemetryPlugin implements IDependenciesPlu
|
|
|
905
906
|
if (properties !== undefined) {
|
|
906
907
|
dependency.properties = {...dependency.properties, ...properties};
|
|
907
908
|
}
|
|
908
|
-
_self
|
|
909
|
+
_self[strTrackDependencyDataInternal](dependency);
|
|
909
910
|
} else {
|
|
910
911
|
_reportXhrError(null, {
|
|
911
912
|
requestSentTime: ajaxData.requestSentTime,
|
|
@@ -1030,7 +1031,7 @@ export class AjaxMonitor extends BaseTelemetryPlugin implements IDependenciesPlu
|
|
|
1030
1031
|
const traceID = (distributedTraceCtx && distributedTraceCtx.getTraceId()) || generateW3CId();
|
|
1031
1032
|
const spanID = generateW3CId().substr(0, 16);
|
|
1032
1033
|
|
|
1033
|
-
let ajaxData = new ajaxRecord(traceID, spanID, _self[strDiagLog]()
|
|
1034
|
+
let ajaxData = new ajaxRecord(traceID, spanID, _self[strDiagLog]());
|
|
1034
1035
|
ajaxData.traceFlags = distributedTraceCtx && distributedTraceCtx.getTraceFlags();
|
|
1035
1036
|
ajaxData.requestSentTime = dateTimeUtilsNow();
|
|
1036
1037
|
ajaxData.errorStatusText = _enableAjaxErrorStatusText;
|
|
@@ -1125,7 +1126,7 @@ export class AjaxMonitor extends BaseTelemetryPlugin implements IDependenciesPlu
|
|
|
1125
1126
|
if (properties !== undefined) {
|
|
1126
1127
|
dependency.properties = {...dependency.properties, ...properties};
|
|
1127
1128
|
}
|
|
1128
|
-
_self
|
|
1129
|
+
_self[strTrackDependencyDataInternal](dependency);
|
|
1129
1130
|
} else {
|
|
1130
1131
|
_reportFetchError(_eInternalMessageId.FailedMonitorAjaxDur, null,
|
|
1131
1132
|
{
|
package/src/ajaxRecord.ts
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
|
|
4
4
|
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
5
5
|
import {
|
|
6
|
-
|
|
6
|
+
IDependencyTelemetry, dataSanitizeUrl, dateTimeUtilsDuration, msToTimeSpan, urlGetAbsoluteUrl, urlGetCompleteUrl
|
|
7
7
|
} from "@microsoft/applicationinsights-common";
|
|
8
8
|
import {
|
|
9
|
-
IDiagnosticLogger,
|
|
9
|
+
IDiagnosticLogger, arrForEach, isNumber, isString, normalizeJsName, objForEachKey, objKeys
|
|
10
10
|
} from "@microsoft/applicationinsights-core-js";
|
|
11
11
|
import { STR_DURATION, STR_PROPERTIES } from "./InternalConstants";
|
|
12
12
|
|
|
@@ -19,12 +19,6 @@ 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
|
-
|
|
28
22
|
/** @ignore */
|
|
29
23
|
function _calcPerfDuration(resourceEntry:PerformanceResourceTiming, start:string, end:string) {
|
|
30
24
|
let result = 0;
|
|
@@ -243,27 +237,11 @@ export class ajaxRecord {
|
|
|
243
237
|
// <summary>Determines whether or not JavaScript exception occured in xhr.onreadystatechange code. 1 if occured, otherwise 0.</summary>
|
|
244
238
|
public clientFailure: number;
|
|
245
239
|
|
|
246
|
-
/**
|
|
247
|
-
* The traceId to use for the dependency call
|
|
248
|
-
*/
|
|
249
240
|
public traceID: string;
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
* The spanId to use for the dependency call
|
|
253
|
-
*/
|
|
254
241
|
public spanID: string;
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* The traceFlags to use for the dependency call
|
|
258
|
-
*/
|
|
259
242
|
public traceFlags?: number;
|
|
260
243
|
|
|
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) {
|
|
244
|
+
constructor(traceID: string, spanID: string, logger: IDiagnosticLogger) {
|
|
267
245
|
let self = this;
|
|
268
246
|
let _logger: IDiagnosticLogger = logger;
|
|
269
247
|
let strResponseText = "responseText";
|
|
@@ -291,19 +269,8 @@ export class ajaxRecord {
|
|
|
291
269
|
self.xhrMonitoringState = new XHRMonitoringState();
|
|
292
270
|
self.clientFailure = 0;
|
|
293
271
|
|
|
294
|
-
self.traceID =
|
|
295
|
-
self.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
|
-
}
|
|
272
|
+
self.traceID = traceID;
|
|
273
|
+
self.spanID = spanID;
|
|
307
274
|
|
|
308
275
|
dynamicProto(ajaxRecord, self, (self) => {
|
|
309
276
|
self.getAbsoluteUrl= () => {
|
|
@@ -382,25 +349,6 @@ export class ajaxRecord {
|
|
|
382
349
|
|
|
383
350
|
return dependency;
|
|
384
351
|
}
|
|
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
|
-
};
|
|
404
352
|
});
|
|
405
353
|
}
|
|
406
354
|
|
|
@@ -418,9 +366,4 @@ export class ajaxRecord {
|
|
|
418
366
|
// @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
|
|
419
367
|
return null;
|
|
420
368
|
}
|
|
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
|
-
}
|
|
426
369
|
}
|
|
@@ -5,29 +5,26 @@ 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";
|
|
10
8
|
export declare const _DYN_GET_DEFAULT_CONFIG = "getDefaultConfig";
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const _DYN_CAN_INCLUDE_CORRELAT4 = "canIncludeCorrelationHeader";
|
|
9
|
+
export declare const _DYN_INCLUDE_CORRELATION_0 = "includeCorrelationHeaders";
|
|
10
|
+
export declare const _DYN_CAN_INCLUDE_CORRELAT1 = "canIncludeCorrelationHeader";
|
|
14
11
|
export declare const _DYN_GET_ABSOLUTE_URL = "getAbsoluteUrl";
|
|
15
12
|
export declare const _DYN_HEADERS = "headers";
|
|
16
13
|
export declare const _DYN_REQUEST_HEADERS = "requestHeaders";
|
|
17
14
|
export declare const _DYN_APP_ID = "appId";
|
|
18
15
|
export declare const _DYN_SET_REQUEST_HEADER = "setRequestHeader";
|
|
19
|
-
export declare const
|
|
16
|
+
export declare const _DYN_DISTRIBUTED_TRACING_2 = "distributedTracingMode";
|
|
20
17
|
export declare const _DYN_START_TIME = "startTime";
|
|
21
18
|
export declare const _DYN_TO_LOWER_CASE = "toLowerCase";
|
|
22
|
-
export declare const
|
|
23
|
-
export declare const
|
|
24
|
-
export declare const
|
|
25
|
-
export declare const
|
|
26
|
-
export declare const
|
|
27
|
-
export declare const
|
|
19
|
+
export declare const _DYN_ENABLE_REQUEST_HEADE3 = "enableRequestHeaderTracking";
|
|
20
|
+
export declare const _DYN_ENABLE_AJAX_ERROR_ST4 = "enableAjaxErrorStatusText";
|
|
21
|
+
export declare const _DYN_ENABLE_AJAX_PERF_TRA5 = "enableAjaxPerfTracking";
|
|
22
|
+
export declare const _DYN_MAX_AJAX_CALLS_PER_V6 = "maxAjaxCallsPerView";
|
|
23
|
+
export declare const _DYN_ENABLE_RESPONSE_HEAD7 = "enableResponseHeaderTracking";
|
|
24
|
+
export declare const _DYN_EXCLUDE_REQUEST_FROM8 = "excludeRequestFromAutoTrackingPatterns";
|
|
28
25
|
export declare const _DYN_ADD_REQUEST_CONTEXT = "addRequestContext";
|
|
29
|
-
export declare const
|
|
30
|
-
export declare const
|
|
26
|
+
export declare const _DYN_DISABLE_AJAX_TRACKIN9 = "disableAjaxTracking";
|
|
27
|
+
export declare const _DYN_DISABLE_FETCH_TRACKI10 = "disableFetchTracking";
|
|
31
28
|
export declare const _DYN_STATUS = "status";
|
|
32
29
|
export declare const _DYN_STATUS_TEXT = "statusText";
|
|
33
30
|
export declare const _DYN_HEADER_MAP = "headerMap";
|
|
@@ -35,23 +32,19 @@ export declare const _DYN_OPEN_DONE = "openDone";
|
|
|
35
32
|
export declare const _DYN_SEND_DONE = "sendDone";
|
|
36
33
|
export declare const _DYN_REQUEST_SENT_TIME = "requestSentTime";
|
|
37
34
|
export declare const _DYN_ABORT_DONE = "abortDone";
|
|
38
|
-
export declare const _DYN_GET_TRACE_ID = "getTraceId";
|
|
39
|
-
export declare const _DYN_GET_TRACE_FLAGS = "getTraceFlags";
|
|
40
35
|
export declare const _DYN_METHOD = "method";
|
|
41
36
|
export declare const _DYN_ERROR_STATUS_TEXT = "errorStatusText";
|
|
42
|
-
export declare const
|
|
37
|
+
export declare const _DYN_STATE_CHANGE_ATTACHE11 = "stateChangeAttached";
|
|
43
38
|
export declare const _DYN_RESPONSE_TEXT = "responseText";
|
|
44
|
-
export declare const
|
|
39
|
+
export declare const _DYN_RESPONSE_FINISHED_TI12 = "responseFinishedTime";
|
|
45
40
|
export declare const _DYN__CREATE_TRACK_ITEM = "CreateTrackItem";
|
|
46
41
|
export declare const _DYN_RESPONSE = "response";
|
|
47
|
-
export declare const
|
|
48
|
-
export declare const
|
|
49
|
-
export declare const _DYN_GET_CORRELATION_CONT17 = "getCorrelationContext";
|
|
42
|
+
export declare const _DYN_GET_ALL_RESPONSE_HEA13 = "getAllResponseHeaders";
|
|
43
|
+
export declare const _DYN_GET_CORRELATION_CONT14 = "getCorrelationContext";
|
|
50
44
|
export declare const _DYN_PERF_MARK = "perfMark";
|
|
51
|
-
export declare const
|
|
45
|
+
export declare const _DYN_AJAX_PERF_LOOKUP_DEL15 = "ajaxPerfLookupDelay";
|
|
52
46
|
export declare const _DYN_NAME = "name";
|
|
53
47
|
export declare const _DYN_PERF_TIMING = "perfTiming";
|
|
54
|
-
export declare const
|
|
48
|
+
export declare const _DYN_AJAX_DIAGNOSTICS_MES16 = "ajaxDiagnosticsMessage";
|
|
55
49
|
export declare const _DYN_CORRELATION_CONTEXT = "correlationContext";
|
|
56
50
|
export declare const _DYN_AJAX_TOTAL_DURATION = "ajaxTotalDuration";
|
|
57
|
-
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_0 } 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_0]: (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
|
|
2
|
+
import { IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
|
|
3
3
|
import { _DYN_HEADER_MAP } from "./__DynamicConstants";
|
|
4
4
|
export interface IAjaxRecordResponse {
|
|
5
5
|
statusText: string;
|
|
@@ -9,11 +9,6 @@ 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
|
-
}
|
|
17
12
|
export declare class XHRMonitoringState {
|
|
18
13
|
openDone: boolean;
|
|
19
14
|
setRequestHeaderDone: boolean;
|
|
@@ -47,28 +42,11 @@ export declare class ajaxRecord {
|
|
|
47
42
|
endTime: number;
|
|
48
43
|
xhrMonitoringState: XHRMonitoringState;
|
|
49
44
|
clientFailure: number;
|
|
50
|
-
/**
|
|
51
|
-
* The traceId to use for the dependency call
|
|
52
|
-
*/
|
|
53
45
|
traceID: string;
|
|
54
|
-
/**
|
|
55
|
-
* The spanId to use for the dependency call
|
|
56
|
-
*/
|
|
57
46
|
spanID: string;
|
|
58
|
-
/**
|
|
59
|
-
* The traceFlags to use for the dependency call
|
|
60
|
-
*/
|
|
61
47
|
traceFlags?: number;
|
|
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);
|
|
48
|
+
constructor(traceID: string, spanID: string, logger: IDiagnosticLogger);
|
|
67
49
|
getAbsoluteUrl(): string;
|
|
68
50
|
getPathName(): string;
|
|
69
51
|
CreateTrackItem(ajaxType: string, enableRequestHeaderTracking: boolean, getResponse: () => IAjaxRecordResponse): IDependencyTelemetry;
|
|
70
|
-
getPartAProps(): {
|
|
71
|
-
[key: string]: any;
|
|
72
|
-
};
|
|
73
52
|
}
|
|
74
|
-
export {};
|