@microsoft/applicationinsights-web 2.8.0-beta.2203-02 → 2.8.0-beta.2203-05
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/{ai.2.8.0-beta.2203-02.cjs.js → ai.2.8.0-beta.2203-05.cjs.js} +828 -359
- package/browser/ai.2.8.0-beta.2203-05.cjs.js.map +1 -0
- package/browser/ai.2.8.0-beta.2203-05.cjs.min.js +6 -0
- package/browser/ai.2.8.0-beta.2203-05.cjs.min.js.map +1 -0
- package/browser/{ai.2.8.0-beta.2203-02.gbl.js → ai.2.8.0-beta.2203-05.gbl.js} +828 -359
- package/browser/ai.2.8.0-beta.2203-05.gbl.js.map +1 -0
- package/browser/ai.2.8.0-beta.2203-05.gbl.min.js +6 -0
- package/browser/ai.2.8.0-beta.2203-05.gbl.min.js.map +1 -0
- package/browser/ai.2.8.0-beta.2203-05.integrity.json +66 -0
- package/browser/{ai.2.8.0-beta.2203-02.js → ai.2.8.0-beta.2203-05.js} +828 -359
- package/browser/ai.2.8.0-beta.2203-05.js.map +1 -0
- package/browser/ai.2.8.0-beta.2203-05.min.js +6 -0
- package/browser/ai.2.8.0-beta.2203-05.min.js.map +1 -0
- package/browser/ai.2.cjs.js +827 -358
- package/browser/ai.2.cjs.js.map +1 -1
- package/browser/ai.2.cjs.min.js +2 -2
- package/browser/ai.2.cjs.min.js.map +1 -1
- package/browser/ai.2.gbl.js +827 -358
- package/browser/ai.2.gbl.js.map +1 -1
- package/browser/ai.2.gbl.min.js +2 -2
- package/browser/ai.2.gbl.min.js.map +1 -1
- package/browser/ai.2.js +827 -358
- package/browser/ai.2.js.map +1 -1
- package/browser/ai.2.min.js +2 -2
- package/browser/ai.2.min.js.map +1 -1
- package/dist/applicationinsights-web.api.json +735 -167
- package/dist/applicationinsights-web.api.md +22 -19
- package/dist/applicationinsights-web.d.ts +168 -106
- package/dist/applicationinsights-web.js +828 -359
- package/dist/applicationinsights-web.js.map +1 -1
- package/dist/applicationinsights-web.min.js +2 -2
- package/dist/applicationinsights-web.min.js.map +1 -1
- package/dist/applicationinsights-web.rollup.d.ts +168 -106
- package/dist-esm/ApplicationInsightsContainer.js +1 -1
- package/dist-esm/ApplicationInsightsDeprecated.js +1 -1
- package/dist-esm/Init.js +1 -1
- package/dist-esm/Initialization.js +1 -1
- package/dist-esm/applicationinsights-web.js +1 -1
- package/package.json +7 -7
- package/types/Initialization.d.ts +1 -1
- package/browser/ai.2.8.0-beta.2203-02.cjs.js.map +0 -1
- package/browser/ai.2.8.0-beta.2203-02.cjs.min.js +0 -6
- package/browser/ai.2.8.0-beta.2203-02.cjs.min.js.map +0 -1
- package/browser/ai.2.8.0-beta.2203-02.gbl.js.map +0 -1
- package/browser/ai.2.8.0-beta.2203-02.gbl.min.js +0 -6
- package/browser/ai.2.8.0-beta.2203-02.gbl.min.js.map +0 -1
- package/browser/ai.2.8.0-beta.2203-02.integrity.json +0 -66
- package/browser/ai.2.8.0-beta.2203-02.js.map +0 -1
- package/browser/ai.2.8.0-beta.2203-02.min.js +0 -6
- package/browser/ai.2.8.0-beta.2203-02.min.js.map +0 -1
|
@@ -16,33 +16,25 @@ export class AppInsightsCore extends BaseCore implements IAppInsightsCore {
|
|
|
16
16
|
// @public (undocumented)
|
|
17
17
|
export class ApplicationAnalytics extends BaseTelemetryPlugin implements IAppInsights, IAppInsightsInternal {
|
|
18
18
|
constructor();
|
|
19
|
+
// Warning: (ae-forgotten-export) The symbol "ITelemetryInitializerHandler" needs to be exported by the entry point applicationinsights-web.d.ts
|
|
20
|
+
//
|
|
19
21
|
// (undocumented)
|
|
20
|
-
addTelemetryInitializer(telemetryInitializer: (item: ITelemetryItem) => boolean | void): void;
|
|
22
|
+
addTelemetryInitializer(telemetryInitializer: (item: ITelemetryItem) => boolean | void): ITelemetryInitializerHandler | void;
|
|
21
23
|
// (undocumented)
|
|
22
24
|
autoRoutePVDelay: number;
|
|
23
25
|
// (undocumented)
|
|
24
26
|
config: IConfig;
|
|
25
27
|
// Warning: (ae-forgotten-export) The symbol "ICookieMgr" needs to be exported by the entry point applicationinsights-web.d.ts
|
|
26
28
|
getCookieMgr(): ICookieMgr;
|
|
29
|
+
// Warning: (ae-forgotten-export) The symbol "_getDefaultConfig" needs to be exported by the entry point applicationinsights-web.d.ts
|
|
30
|
+
//
|
|
27
31
|
// (undocumented)
|
|
28
|
-
static getDefaultConfig
|
|
32
|
+
static getDefaultConfig: typeof _getDefaultConfig;
|
|
29
33
|
// (undocumented)
|
|
30
34
|
identifier: string;
|
|
31
35
|
// (undocumented)
|
|
32
36
|
initialize(config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain): void;
|
|
33
37
|
_onerror(exception: IAutoExceptionTelemetry): void;
|
|
34
|
-
// Warning: (ae-forgotten-export) The symbol "PageViewManager" needs to be exported by the entry point applicationinsights-web.d.ts
|
|
35
|
-
//
|
|
36
|
-
// (undocumented)
|
|
37
|
-
protected _pageViewManager: PageViewManager;
|
|
38
|
-
// Warning: (ae-forgotten-export) The symbol "PageViewPerformanceManager" needs to be exported by the entry point applicationinsights-web.d.ts
|
|
39
|
-
//
|
|
40
|
-
// (undocumented)
|
|
41
|
-
protected _pageViewPerformanceManager: PageViewPerformanceManager;
|
|
42
|
-
// Warning: (ae-forgotten-export) The symbol "PageVisitTimeManager" needs to be exported by the entry point applicationinsights-web.d.ts
|
|
43
|
-
//
|
|
44
|
-
// (undocumented)
|
|
45
|
-
protected _pageVisitTimeManager: PageVisitTimeManager;
|
|
46
38
|
// (undocumented)
|
|
47
39
|
priority: number;
|
|
48
40
|
// (undocumented)
|
|
@@ -79,8 +71,6 @@ export class ApplicationAnalytics extends BaseTelemetryPlugin implements IAppIns
|
|
|
79
71
|
[key: string]: number;
|
|
80
72
|
}): void;
|
|
81
73
|
// (undocumented)
|
|
82
|
-
protected _telemetryInitializers: Array<(envelope: ITelemetryItem) => boolean | void>;
|
|
83
|
-
// (undocumented)
|
|
84
74
|
trackEvent(event: IEventTelemetry, customProperties?: ICustomProperties): void;
|
|
85
75
|
trackException(exception: IExceptionTelemetry, customProperties?: ICustomProperties): void;
|
|
86
76
|
trackMetric(metric: IMetricTelemetry, customProperties?: ICustomProperties): void;
|
|
@@ -97,7 +87,7 @@ export class ApplicationInsights implements IApplicationInsights {
|
|
|
97
87
|
// (undocumented)
|
|
98
88
|
addHousekeepingBeforeUnload(appInsightsInstance: IApplicationInsights): void;
|
|
99
89
|
// (undocumented)
|
|
100
|
-
addTelemetryInitializer(telemetryInitializer: (item: ITelemetryItem) => boolean | void): void;
|
|
90
|
+
addTelemetryInitializer(telemetryInitializer: (item: ITelemetryItem) => boolean | void): void | ITelemetryInitializerHandler;
|
|
101
91
|
// (undocumented)
|
|
102
92
|
appInsights: ApplicationAnalytics;
|
|
103
93
|
clearAuthenticatedUserContext(): void;
|
|
@@ -157,9 +147,12 @@ export class ApplicationInsightsContainer {
|
|
|
157
147
|
export class BaseCore implements IAppInsightsCore {
|
|
158
148
|
constructor();
|
|
159
149
|
addNotificationListener(listener: INotificationListener): void;
|
|
150
|
+
// (undocumented)
|
|
151
|
+
addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting: boolean, doAsync: boolean, addCb?: (added?: boolean) => void): void;
|
|
160
152
|
// Warning: (ae-forgotten-export) The symbol "TelemetryInitializerFunction" needs to be exported by the entry point applicationinsights-web.d.ts
|
|
161
|
-
// Warning: (ae-forgotten-export) The symbol "ITelemetryInitializerHandler" needs to be exported by the entry point applicationinsights-web.d.ts
|
|
162
153
|
addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler | void;
|
|
154
|
+
// Warning: (ae-forgotten-export) The symbol "UnloadHandler" needs to be exported by the entry point applicationinsights-web.d.ts
|
|
155
|
+
addUnloadCb(handler: UnloadHandler): void;
|
|
163
156
|
// (undocumented)
|
|
164
157
|
config: IConfiguration;
|
|
165
158
|
// (undocumented)
|
|
@@ -200,6 +193,11 @@ export class BaseCore implements IAppInsightsCore {
|
|
|
200
193
|
stopPollingInternalLogs(): void;
|
|
201
194
|
// (undocumented)
|
|
202
195
|
track(telemetryItem: ITelemetryItem): void;
|
|
196
|
+
// Warning: (ae-forgotten-export) The symbol "ITelemetryUnloadState" needs to be exported by the entry point applicationinsights-web.d.ts
|
|
197
|
+
unload(isAsync?: boolean, unloadComplete?: (unloadState: ITelemetryUnloadState) => void, cbTimeout?: number): void;
|
|
198
|
+
// Warning: (ae-forgotten-export) The symbol "IProcessTelemetryUpdateContext" needs to be exported by the entry point applicationinsights-web.d.ts
|
|
199
|
+
// Warning: (ae-forgotten-export) The symbol "ITelemetryUpdateState" needs to be exported by the entry point applicationinsights-web.d.ts
|
|
200
|
+
protected _updateHook?(updateCtx: IProcessTelemetryUpdateContext, updateState: ITelemetryUpdateState): void | boolean;
|
|
203
201
|
}
|
|
204
202
|
|
|
205
203
|
// @public
|
|
@@ -207,11 +205,12 @@ export abstract class BaseTelemetryPlugin implements ITelemetryPlugin {
|
|
|
207
205
|
constructor();
|
|
208
206
|
// Warning: (ae-forgotten-export) The symbol "IInstrumentHook" needs to be exported by the entry point applicationinsights-web.d.ts
|
|
209
207
|
protected _addHook(hooks: IInstrumentHook | IInstrumentHook[]): void;
|
|
208
|
+
protected _addUnloadCb(handler: UnloadHandler): void;
|
|
210
209
|
core: IAppInsightsCore;
|
|
211
210
|
diagLog: (itemCtx?: IProcessTelemetryContext) => IDiagnosticLogger;
|
|
212
211
|
// Warning: (ae-forgotten-export) The symbol "IProcessTelemetryUnloadContext" needs to be exported by the entry point applicationinsights-web.d.ts
|
|
213
|
-
// Warning: (ae-forgotten-export) The symbol "ITelemetryUnloadState" needs to be exported by the entry point applicationinsights-web.d.ts
|
|
214
212
|
protected _doTeardown?: (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState, asyncCallback?: () => void) => void | boolean;
|
|
213
|
+
protected _doUpdate?: (updateCtx?: IProcessTelemetryUpdateContext, updateState?: ITelemetryUpdateState, asyncCallback?: () => void) => void | boolean;
|
|
215
214
|
protected _getTelCtx: (currentCtx?: IProcessTelemetryContext) => IProcessTelemetryContext;
|
|
216
215
|
// (undocumented)
|
|
217
216
|
identifier: string;
|
|
@@ -226,6 +225,7 @@ export abstract class BaseTelemetryPlugin implements ITelemetryPlugin {
|
|
|
226
225
|
protected setInitialized: (isInitialized: boolean) => void;
|
|
227
226
|
setNextPlugin: (next: ITelemetryPlugin | ITelemetryPluginChain) => void;
|
|
228
227
|
teardown(unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState): void | boolean;
|
|
228
|
+
update(updateCtx: IProcessTelemetryUpdateContext, updateState: ITelemetryUpdateState): void | boolean;
|
|
229
229
|
// (undocumented)
|
|
230
230
|
version?: string;
|
|
231
231
|
}
|
|
@@ -391,7 +391,9 @@ export interface IAppInsights {
|
|
|
391
391
|
// @public (undocumented)
|
|
392
392
|
export interface IAppInsightsCore extends IPerfManagerProvider {
|
|
393
393
|
addNotificationListener?(listener: INotificationListener): void;
|
|
394
|
+
addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting: boolean, doAsync: boolean, addCb?: (added?: boolean) => void): void;
|
|
394
395
|
addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler | void;
|
|
396
|
+
addUnloadCb(handler: UnloadHandler): void;
|
|
395
397
|
// (undocumented)
|
|
396
398
|
config: IConfiguration;
|
|
397
399
|
evtNamespace(): string;
|
|
@@ -414,6 +416,7 @@ export interface IAppInsightsCore extends IPerfManagerProvider {
|
|
|
414
416
|
stopPollingInternalLogs?(): void;
|
|
415
417
|
// (undocumented)
|
|
416
418
|
track(telemetryItem: ITelemetryItem): void;
|
|
419
|
+
unload(isAsync?: boolean, unloadComplete?: () => void): void;
|
|
417
420
|
}
|
|
418
421
|
|
|
419
422
|
// @public (undocumented)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Microsoft.ApplicationInsights, 2.8.0-beta.2203-
|
|
2
|
+
* Microsoft.ApplicationInsights, 2.8.0-beta.2203-05
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* Microsoft Application Insights Team
|
|
@@ -48,16 +48,12 @@ declare namespace ApplicationInsights {
|
|
|
48
48
|
|
|
49
49
|
class ApplicationAnalytics extends BaseTelemetryPlugin implements IAppInsights, IAppInsightsInternal {
|
|
50
50
|
static Version: string;
|
|
51
|
-
static getDefaultConfig
|
|
51
|
+
static getDefaultConfig: typeof _getDefaultConfig;
|
|
52
52
|
identifier: string;
|
|
53
53
|
priority: number;
|
|
54
54
|
config: IConfig;
|
|
55
55
|
queue: Array<() => void>;
|
|
56
56
|
autoRoutePVDelay: number;
|
|
57
|
-
protected _telemetryInitializers: Array<(envelope: ITelemetryItem) => boolean | void>;
|
|
58
|
-
protected _pageViewManager: PageViewManager;
|
|
59
|
-
protected _pageViewPerformanceManager: PageViewPerformanceManager;
|
|
60
|
-
protected _pageVisitTimeManager: PageVisitTimeManager;
|
|
61
57
|
constructor();
|
|
62
58
|
/**
|
|
63
59
|
* Get the current cookie manager for this instance
|
|
@@ -181,7 +177,7 @@ declare namespace ApplicationInsights {
|
|
|
181
177
|
* @memberof ApplicationInsights
|
|
182
178
|
*/
|
|
183
179
|
_onerror(exception: IAutoExceptionTelemetry): void;
|
|
184
|
-
addTelemetryInitializer(telemetryInitializer: (item: ITelemetryItem) => boolean | void): void;
|
|
180
|
+
addTelemetryInitializer(telemetryInitializer: (item: ITelemetryItem) => boolean | void): ITelemetryInitializerHandler | void;
|
|
185
181
|
initialize(config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain): void;
|
|
186
182
|
}
|
|
187
183
|
|
|
@@ -292,7 +288,7 @@ declare namespace ApplicationInsights {
|
|
|
292
288
|
}, measurements?: {
|
|
293
289
|
[key: string]: number;
|
|
294
290
|
}): void;
|
|
295
|
-
addTelemetryInitializer(telemetryInitializer: (item: ITelemetryItem) => boolean | void): void;
|
|
291
|
+
addTelemetryInitializer(telemetryInitializer: (item: ITelemetryItem) => boolean | void): void | ITelemetryInitializerHandler;
|
|
296
292
|
/**
|
|
297
293
|
* Set the authenticated user id and the account id. Used for identifying a specific signed-in user. Parameters must not contain whitespace or ,;=|
|
|
298
294
|
*
|
|
@@ -417,12 +413,34 @@ declare namespace ApplicationInsights {
|
|
|
417
413
|
* @returns - A ITelemetryInitializerHandler to enable the initializer to be removed
|
|
418
414
|
*/
|
|
419
415
|
addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler | void;
|
|
416
|
+
/**
|
|
417
|
+
* Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered
|
|
418
|
+
* to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous
|
|
419
|
+
* unload call return `true` stating that all plugins reported that they also unloaded, the recommended
|
|
420
|
+
* approach is to create a new instance and initialize that instance.
|
|
421
|
+
* This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
|
|
422
|
+
* to successfully remove any global references or they may just be completing the unload process asynchronously.
|
|
423
|
+
*/
|
|
424
|
+
unload(isAsync?: boolean, unloadComplete?: (unloadState: ITelemetryUnloadState) => void, cbTimeout?: number): void;
|
|
420
425
|
getPlugin<T extends IPlugin = IPlugin>(pluginIdentifier: string): ILoadedPlugin<T>;
|
|
426
|
+
addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting: boolean, doAsync: boolean, addCb?: (added?: boolean) => void): void;
|
|
421
427
|
/**
|
|
422
428
|
* Returns the unique event namespace that should be used
|
|
423
429
|
*/
|
|
424
430
|
evtNamespace(): string;
|
|
431
|
+
/**
|
|
432
|
+
* Add an unload handler that will be called when the SDK is being unloaded
|
|
433
|
+
* @param handler - the handler
|
|
434
|
+
*/
|
|
435
|
+
addUnloadCb(handler: UnloadHandler): void;
|
|
425
436
|
protected releaseQueue(): void;
|
|
437
|
+
/**
|
|
438
|
+
* Hook for Core extensions to allow them to update their own configuration before updating all of the plugins.
|
|
439
|
+
* @param updateCtx - The plugin update context
|
|
440
|
+
* @param updateState - The Update State
|
|
441
|
+
* @returns boolean - True means the extension class will call updateState otherwise the Core will
|
|
442
|
+
*/
|
|
443
|
+
protected _updateHook?(updateCtx: IProcessTelemetryUpdateContext, updateState: ITelemetryUpdateState): void | boolean;
|
|
426
444
|
}
|
|
427
445
|
|
|
428
446
|
/**
|
|
@@ -479,6 +497,14 @@ declare namespace ApplicationInsights {
|
|
|
479
497
|
* @returns boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
|
|
480
498
|
*/
|
|
481
499
|
protected _doTeardown?: (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState, asyncCallback?: () => void) => void | boolean;
|
|
500
|
+
/**
|
|
501
|
+
* Extension hook to allow implementations to perform some additional update operations before the BaseTelemetryPlugin finishes it's removal
|
|
502
|
+
* @param updateCtx - This is the context that should be used during updating.
|
|
503
|
+
* @param updateState - The details / state of the update process, it holds details like the current and previous configuration.
|
|
504
|
+
* @param asyncCallback - An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async update operations.
|
|
505
|
+
* @returns boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
|
|
506
|
+
*/
|
|
507
|
+
protected _doUpdate?: (updateCtx?: IProcessTelemetryUpdateContext, updateState?: ITelemetryUpdateState, asyncCallback?: () => void) => void | boolean;
|
|
482
508
|
constructor();
|
|
483
509
|
initialize(config: IConfiguration, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain): void;
|
|
484
510
|
/**
|
|
@@ -491,6 +517,18 @@ declare namespace ApplicationInsights {
|
|
|
491
517
|
*/
|
|
492
518
|
teardown(unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState): void | boolean;
|
|
493
519
|
abstract processTelemetry(env: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
520
|
+
/**
|
|
521
|
+
* The the plugin should re-evaluate configuration and update any cached configuration settings.
|
|
522
|
+
* @param updateCtx - This is the context that should be used during updating.
|
|
523
|
+
* @param updateState - The details / state of the update process, it holds details like the current and previous configuration.
|
|
524
|
+
* @returns boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
|
|
525
|
+
*/
|
|
526
|
+
update(updateCtx: IProcessTelemetryUpdateContext, updateState: ITelemetryUpdateState): void | boolean;
|
|
527
|
+
/**
|
|
528
|
+
* Add an unload handler that will be called when the SDK is being unloaded
|
|
529
|
+
* @param handler - the handler
|
|
530
|
+
*/
|
|
531
|
+
protected _addUnloadCb(handler: UnloadHandler): void;
|
|
494
532
|
/**
|
|
495
533
|
* Add this hook so that it is automatically removed during unloading
|
|
496
534
|
* @param hooks - The single hook or an array of IInstrumentHook objects
|
|
@@ -957,6 +995,8 @@ declare namespace ApplicationInsights {
|
|
|
957
995
|
*/
|
|
958
996
|
function _formatErrorCode(errorObj: any): any;
|
|
959
997
|
|
|
998
|
+
function _getDefaultConfig(config?: IConfig): IConfig;
|
|
999
|
+
|
|
960
1000
|
const enum GetExtCfgMergeType {
|
|
961
1001
|
None = 0,
|
|
962
1002
|
MergeDefaultOnly = 1,
|
|
@@ -1050,15 +1090,36 @@ declare namespace ApplicationInsights {
|
|
|
1050
1090
|
* Return a new instance of the IProcessTelemetryContext for processing events
|
|
1051
1091
|
*/
|
|
1052
1092
|
getProcessTelContext(): IProcessTelemetryContext;
|
|
1093
|
+
/**
|
|
1094
|
+
* Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered
|
|
1095
|
+
* to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous
|
|
1096
|
+
* unload call return `true` stating that all plugins reported that they also unloaded, the recommended
|
|
1097
|
+
* approach is to create a new instance and initialize that instance.
|
|
1098
|
+
* This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
|
|
1099
|
+
* to successfully remove any global references or they may just be completing the unload process asynchronously.
|
|
1100
|
+
*/
|
|
1101
|
+
unload(isAsync?: boolean, unloadComplete?: () => void): void;
|
|
1053
1102
|
/**
|
|
1054
1103
|
* Find and return the (first) plugin with the specified identifier if present
|
|
1055
1104
|
* @param pluginIdentifier
|
|
1056
1105
|
*/
|
|
1057
1106
|
getPlugin<T extends IPlugin = IPlugin>(pluginIdentifier: string): ILoadedPlugin<T>;
|
|
1107
|
+
/**
|
|
1108
|
+
* Add a new plugin to the installation
|
|
1109
|
+
* @param plugin - The new plugin to add
|
|
1110
|
+
* @param replaceExisting - should any existing plugin be replaced
|
|
1111
|
+
* @param doAsync - Should the add be performed asynchronously
|
|
1112
|
+
*/
|
|
1113
|
+
addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting: boolean, doAsync: boolean, addCb?: (added?: boolean) => void): void;
|
|
1058
1114
|
/**
|
|
1059
1115
|
* Returns the unique event namespace that should be used when registering events
|
|
1060
1116
|
*/
|
|
1061
1117
|
evtNamespace(): string;
|
|
1118
|
+
/**
|
|
1119
|
+
* Add a handler that will be called when the SDK is being unloaded
|
|
1120
|
+
* @param handler - the handler
|
|
1121
|
+
*/
|
|
1122
|
+
addUnloadCb(handler: UnloadHandler): void;
|
|
1062
1123
|
}
|
|
1063
1124
|
|
|
1064
1125
|
interface IAppInsightsDeprecated {
|
|
@@ -2678,6 +2739,11 @@ declare namespace ApplicationInsights {
|
|
|
2678
2739
|
* You must always supply the error callback
|
|
2679
2740
|
*/
|
|
2680
2741
|
interface IInstrumentHooksCallbacks {
|
|
2742
|
+
/**
|
|
2743
|
+
* [Optional] Namespace details (same as the namespace used for events), useful for debugging and testing to
|
|
2744
|
+
* identify the source of the instrumented hooks
|
|
2745
|
+
*/
|
|
2746
|
+
ns?: string | string[];
|
|
2681
2747
|
/**
|
|
2682
2748
|
* The hook callback to call before the original function is called
|
|
2683
2749
|
*/
|
|
@@ -2736,6 +2802,7 @@ declare namespace ApplicationInsights {
|
|
|
2736
2802
|
* (unless it's also been re-initialized)
|
|
2737
2803
|
*/
|
|
2738
2804
|
setEnabled: (isEnabled: boolean) => void;
|
|
2805
|
+
remove: (isAsync?: boolean, removeCb?: (removed?: boolean) => void) => void;
|
|
2739
2806
|
}
|
|
2740
2807
|
|
|
2741
2808
|
interface ILocation {
|
|
@@ -3257,8 +3324,8 @@ declare namespace ApplicationInsights {
|
|
|
3257
3324
|
}
|
|
3258
3325
|
|
|
3259
3326
|
/**
|
|
3260
|
-
* The current context for the current call to
|
|
3261
|
-
*
|
|
3327
|
+
* The current context for the current call to teardown() implementations, used to support when plugins are being removed
|
|
3328
|
+
* or the SDK is being unloaded.
|
|
3262
3329
|
*/
|
|
3263
3330
|
interface IProcessTelemetryUnloadContext extends IBaseProcessingContext {
|
|
3264
3331
|
/**
|
|
@@ -3277,6 +3344,27 @@ declare namespace ApplicationInsights {
|
|
|
3277
3344
|
createNew: (plugins?: IPlugin[] | ITelemetryPluginChain, startAt?: IPlugin) => IProcessTelemetryUnloadContext;
|
|
3278
3345
|
}
|
|
3279
3346
|
|
|
3347
|
+
/**
|
|
3348
|
+
* The current context for the current call to the plugin update() implementations, used to support the notifications
|
|
3349
|
+
* for when plugins are added, removed or the configuration was changed.
|
|
3350
|
+
*/
|
|
3351
|
+
interface IProcessTelemetryUpdateContext extends IBaseProcessingContext {
|
|
3352
|
+
/**
|
|
3353
|
+
* This Plugin has finished unloading, so unload the next one
|
|
3354
|
+
* @param updateState - The update State
|
|
3355
|
+
* @returns boolean (true) if there is no more plugins to process otherwise false or undefined (void)
|
|
3356
|
+
*/
|
|
3357
|
+
processNext: (updateState: ITelemetryUpdateState) => boolean | void;
|
|
3358
|
+
/**
|
|
3359
|
+
* Create a new context using the core and config from the current instance, returns a new instance of the same type
|
|
3360
|
+
* @param plugins - The execution order to process the plugins, if null or not supplied
|
|
3361
|
+
* then the current execution order will be copied.
|
|
3362
|
+
* @param startAt - The plugin to start processing from, if missing from the execution
|
|
3363
|
+
* order then the next plugin will be NOT set.
|
|
3364
|
+
*/
|
|
3365
|
+
createNew: (plugins?: IPlugin[] | ITelemetryPluginChain, startAt?: IPlugin) => IProcessTelemetryUpdateContext;
|
|
3366
|
+
}
|
|
3367
|
+
|
|
3280
3368
|
interface IPropertiesPlugin {
|
|
3281
3369
|
readonly context: ITelemetryContext;
|
|
3282
3370
|
}
|
|
@@ -3673,6 +3761,15 @@ declare namespace ApplicationInsights {
|
|
|
3673
3761
|
* to later plugins (vs appending items to the telemetry item)
|
|
3674
3762
|
*/
|
|
3675
3763
|
processTelemetry: (env: ITelemetryItem, itemCtx?: IProcessTelemetryContext) => void;
|
|
3764
|
+
/**
|
|
3765
|
+
* The the plugin should re-evaluate configuration and update any cached configuration settings or
|
|
3766
|
+
* plugins. If implemented this method will be called whenever a plugin is added or removed and if
|
|
3767
|
+
* the configuration has bee updated.
|
|
3768
|
+
* @param updateCtx - This is the context that should be used during updating.
|
|
3769
|
+
* @param updateState - The details / state of the update process, it holds details like the current and previous configuration.
|
|
3770
|
+
* @returns boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
|
|
3771
|
+
*/
|
|
3772
|
+
update?: (updateCtx: IProcessTelemetryUpdateContext, updateState: ITelemetryUpdateState) => void | boolean;
|
|
3676
3773
|
}
|
|
3677
3774
|
|
|
3678
3775
|
interface ITelemetryTrace {
|
|
@@ -3700,6 +3797,27 @@ declare namespace ApplicationInsights {
|
|
|
3700
3797
|
flushComplete?: boolean;
|
|
3701
3798
|
}
|
|
3702
3799
|
|
|
3800
|
+
interface ITelemetryUpdateState {
|
|
3801
|
+
/**
|
|
3802
|
+
* Identifies the reason for the update notification, this is a bitwise numeric value
|
|
3803
|
+
*/
|
|
3804
|
+
reason: TelemetryUpdateReason;
|
|
3805
|
+
/**
|
|
3806
|
+
* If this is a configuration update this was the previous configuration that was used
|
|
3807
|
+
*/
|
|
3808
|
+
/**
|
|
3809
|
+
* If this is a configuration update is the new configuration that is being used
|
|
3810
|
+
*/
|
|
3811
|
+
/**
|
|
3812
|
+
* This holds a collection of plugins that have been added (if the reason identifies that one or more plugins have been added)
|
|
3813
|
+
*/
|
|
3814
|
+
added?: IPlugin[];
|
|
3815
|
+
/**
|
|
3816
|
+
* This holds a collection of plugins that have been removed (if the reason identifies that one or more plugins have been removed)
|
|
3817
|
+
*/
|
|
3818
|
+
removed?: IPlugin[];
|
|
3819
|
+
}
|
|
3820
|
+
|
|
3703
3821
|
interface ITraceState {
|
|
3704
3822
|
}
|
|
3705
3823
|
|
|
@@ -4145,26 +4263,6 @@ declare namespace ApplicationInsights {
|
|
|
4145
4263
|
constructor();
|
|
4146
4264
|
}
|
|
4147
4265
|
|
|
4148
|
-
/**
|
|
4149
|
-
* Class encapsulates sending page views and page view performance telemetry.
|
|
4150
|
-
*/
|
|
4151
|
-
class PageViewManager {
|
|
4152
|
-
constructor(appInsights: IAppInsightsInternal, overridePageViewDuration: boolean, core: IAppInsightsCore, pageViewPerformanceManager: PageViewPerformanceManager);
|
|
4153
|
-
/**
|
|
4154
|
-
* Currently supported cases:
|
|
4155
|
-
* 1) (default case) track page view called with default parameters, overridePageViewDuration = false. Page view is sent with page view performance when navigation timing data is available.
|
|
4156
|
-
* a. If navigation timing is not supported then page view is sent right away with undefined duration. Page view performance is not sent.
|
|
4157
|
-
* 2) overridePageViewDuration = true, custom duration provided. Custom duration is used, page view sends right away.
|
|
4158
|
-
* 3) overridePageViewDuration = true, custom duration NOT provided. Page view is sent right away, duration is time spent from page load till now (or undefined if navigation timing is not supported).
|
|
4159
|
-
* 4) overridePageViewDuration = false, custom duration is provided. Page view is sent right away with custom duration.
|
|
4160
|
-
*
|
|
4161
|
-
* In all cases page view performance is sent once (only for the 1st call of trackPageView), or not sent if navigation timing is not supported.
|
|
4162
|
-
*/
|
|
4163
|
-
trackPageView(pageView: IPageViewTelemetry, customProperties?: {
|
|
4164
|
-
[key: string]: any;
|
|
4165
|
-
}): void;
|
|
4166
|
-
}
|
|
4167
|
-
|
|
4168
4266
|
/**
|
|
4169
4267
|
* An instance of PageViewPerf represents: a page view with no performance data, a page view with performance data, or just the performance data of an earlier page request.
|
|
4170
4268
|
*/
|
|
@@ -4242,81 +4340,6 @@ declare namespace ApplicationInsights {
|
|
|
4242
4340
|
}, cs4BaseData?: IPageViewPerformanceTelemetry);
|
|
4243
4341
|
}
|
|
4244
4342
|
|
|
4245
|
-
/**
|
|
4246
|
-
* Class encapsulates sending page view performance telemetry.
|
|
4247
|
-
*/
|
|
4248
|
-
class PageViewPerformanceManager {
|
|
4249
|
-
private _logger;
|
|
4250
|
-
private MAX_DURATION_ALLOWED;
|
|
4251
|
-
constructor(core: IAppInsightsCore);
|
|
4252
|
-
populatePageViewPerformanceEvent(pageViewPerformance: IPageViewPerformanceTelemetryInternal): void;
|
|
4253
|
-
getPerformanceTiming(): PerformanceTiming | null;
|
|
4254
|
-
getPerformanceNavigationTiming(): PerformanceNavigationTiming | null;
|
|
4255
|
-
/**
|
|
4256
|
-
* Returns true is window PerformanceNavigationTiming API is supported, false otherwise.
|
|
4257
|
-
*/
|
|
4258
|
-
isPerformanceNavigationTimingSupported(): boolean;
|
|
4259
|
-
/**
|
|
4260
|
-
* Returns true is window performance timing API is supported, false otherwise.
|
|
4261
|
-
*/
|
|
4262
|
-
isPerformanceTimingSupported(): PerformanceTiming;
|
|
4263
|
-
/**
|
|
4264
|
-
* As page loads different parts of performance timing numbers get set. When all of them are set we can report it.
|
|
4265
|
-
* Returns true if ready, false otherwise.
|
|
4266
|
-
*/
|
|
4267
|
-
isPerformanceTimingDataReady(): boolean;
|
|
4268
|
-
/**
|
|
4269
|
-
* This method tells if given durations should be excluded from collection.
|
|
4270
|
-
*/
|
|
4271
|
-
shouldCollectDuration(...durations: number[]): boolean;
|
|
4272
|
-
}
|
|
4273
|
-
|
|
4274
|
-
class PageVisitData {
|
|
4275
|
-
pageName: string;
|
|
4276
|
-
pageUrl: string;
|
|
4277
|
-
pageVisitStartTime: number;
|
|
4278
|
-
pageVisitTime: number;
|
|
4279
|
-
constructor(pageName: string, pageUrl: string);
|
|
4280
|
-
}
|
|
4281
|
-
|
|
4282
|
-
/**
|
|
4283
|
-
* Used to track page visit durations
|
|
4284
|
-
*/
|
|
4285
|
-
class PageVisitTimeManager {
|
|
4286
|
-
private prevPageVisitDataKeyName;
|
|
4287
|
-
private pageVisitTimeTrackingHandler;
|
|
4288
|
-
private _logger;
|
|
4289
|
-
/**
|
|
4290
|
-
* Creates a new instance of PageVisitTimeManager
|
|
4291
|
-
* @param pageVisitTimeTrackingHandler Delegate that will be called to send telemetry data to AI (when trackPreviousPageVisit is called)
|
|
4292
|
-
* @returns {}
|
|
4293
|
-
*/
|
|
4294
|
-
constructor(logger: IDiagnosticLogger, pageVisitTimeTrackingHandler: (pageName: string, pageUrl: string, pageVisitTime: number) => void);
|
|
4295
|
-
/**
|
|
4296
|
-
* Tracks the previous page visit time telemetry (if exists) and starts timing of new page visit time
|
|
4297
|
-
* @param currentPageName Name of page to begin timing for visit duration
|
|
4298
|
-
* @param currentPageUrl Url of page to begin timing for visit duration
|
|
4299
|
-
*/
|
|
4300
|
-
trackPreviousPageVisit(currentPageName: string, currentPageUrl: string): void;
|
|
4301
|
-
/**
|
|
4302
|
-
* Stops timing of current page (if exists) and starts timing for duration of visit to pageName
|
|
4303
|
-
* @param pageName Name of page to begin timing visit duration
|
|
4304
|
-
* @returns {PageVisitData} Page visit data (including duration) of pageName from last call to start or restart, if exists. Null if not.
|
|
4305
|
-
*/
|
|
4306
|
-
restartPageVisitTimer(pageName: string, pageUrl: string): PageVisitData;
|
|
4307
|
-
/**
|
|
4308
|
-
* Starts timing visit duration of pageName
|
|
4309
|
-
* @param pageName
|
|
4310
|
-
* @returns {}
|
|
4311
|
-
*/
|
|
4312
|
-
startPageVisitTimer(pageName: string, pageUrl: string): void;
|
|
4313
|
-
/**
|
|
4314
|
-
* Stops timing of current page, if exists.
|
|
4315
|
-
* @returns {PageVisitData} Page visit data (including duration) of pageName from call to start, if exists. Null if not.
|
|
4316
|
-
*/
|
|
4317
|
-
stopPageVisitTimer(): PageVisitData;
|
|
4318
|
-
}
|
|
4319
|
-
|
|
4320
4343
|
function parseConnectionString(connectionString?: string): ConnectionString;
|
|
4321
4344
|
|
|
4322
4345
|
class PerfEvent implements IPerfEvent {
|
|
@@ -4604,6 +4627,10 @@ declare namespace ApplicationInsights {
|
|
|
4604
4627
|
* The event(s) being sent as a retry
|
|
4605
4628
|
*/
|
|
4606
4629
|
Retry = 5,
|
|
4630
|
+
/**
|
|
4631
|
+
* The SDK is unloading
|
|
4632
|
+
*/
|
|
4633
|
+
SdkUnload = 6,
|
|
4607
4634
|
/**
|
|
4608
4635
|
* Maximum batch size would be exceeded
|
|
4609
4636
|
*/
|
|
@@ -4789,7 +4816,40 @@ declare namespace ApplicationInsights {
|
|
|
4789
4816
|
/**
|
|
4790
4817
|
* Teardown has been called without any context.
|
|
4791
4818
|
*/
|
|
4792
|
-
ManualTeardown = 0
|
|
4819
|
+
ManualTeardown = 0,
|
|
4820
|
+
/**
|
|
4821
|
+
* Just this plugin is being removed
|
|
4822
|
+
*/
|
|
4823
|
+
PluginUnload = 1,
|
|
4824
|
+
/**
|
|
4825
|
+
* This instance of the plugin is being removed and replaced
|
|
4826
|
+
*/
|
|
4827
|
+
PluginReplace = 2,
|
|
4828
|
+
/**
|
|
4829
|
+
* The entire SDK is being unloaded
|
|
4830
|
+
*/
|
|
4831
|
+
SdkUnload = 50
|
|
4832
|
+
}
|
|
4833
|
+
|
|
4834
|
+
/**
|
|
4835
|
+
* The TelemetryUpdateReason enumeration contains a set of bit-wise values that specify the reason for update request.
|
|
4836
|
+
*/
|
|
4837
|
+
const enum TelemetryUpdateReason {
|
|
4838
|
+
/**
|
|
4839
|
+
* Unknown.
|
|
4840
|
+
*/
|
|
4841
|
+
Unknown = 0,
|
|
4842
|
+
/**
|
|
4843
|
+
* The configuration has ben updated or changed
|
|
4844
|
+
*/
|
|
4845
|
+
/**
|
|
4846
|
+
* One or more plugins have been added
|
|
4847
|
+
*/
|
|
4848
|
+
PluginAdded = 16,
|
|
4849
|
+
/**
|
|
4850
|
+
* One or more plugins have been removed
|
|
4851
|
+
*/
|
|
4852
|
+
PluginRemoved = 32
|
|
4793
4853
|
}
|
|
4794
4854
|
|
|
4795
4855
|
class Trace extends MessageData implements ISerializable {
|
|
@@ -4809,6 +4869,8 @@ declare namespace ApplicationInsights {
|
|
|
4809
4869
|
});
|
|
4810
4870
|
}
|
|
4811
4871
|
|
|
4872
|
+
type UnloadHandler = (itemCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState) => void;
|
|
4873
|
+
|
|
4812
4874
|
const Util: IUtil;
|
|
4813
4875
|
|
|
4814
4876
|
interface XDomainRequest extends XMLHttpRequestEventTarget {
|