@microsoft/applicationinsights-common 3.0.0-beta.2210-19 → 3.0.0-beta.2210-21
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-common.integrity.json +9 -9
- package/browser/applicationinsights-common.js +385 -159
- package/browser/applicationinsights-common.js.map +1 -1
- package/browser/applicationinsights-common.min.js +2 -2
- package/browser/applicationinsights-common.min.js.map +1 -1
- package/dist/applicationinsights-common.api.json +2048 -1176
- package/dist/applicationinsights-common.api.md +65 -0
- package/dist/applicationinsights-common.d.ts +118 -1
- package/dist/applicationinsights-common.js +385 -159
- package/dist/applicationinsights-common.js.map +1 -1
- package/dist/applicationinsights-common.min.js +2 -2
- package/dist/applicationinsights-common.min.js.map +1 -1
- package/dist/applicationinsights-common.rollup.d.ts +118 -1
- package/dist-esm/ConnectionStringParser.js +1 -1
- package/dist-esm/Constants.js +1 -1
- package/dist-esm/DomHelperFuncs.js +1 -1
- package/dist-esm/Enums.js +1 -1
- package/dist-esm/HelperFuncs.js +1 -1
- package/dist-esm/Interfaces/ConnectionString.js +1 -1
- package/dist-esm/Interfaces/Context/IApplication.js +1 -1
- package/dist-esm/Interfaces/Context/IDevice.js +1 -1
- package/dist-esm/Interfaces/Context/IInternal.js +1 -1
- package/dist-esm/Interfaces/Context/ILocation.js +1 -1
- package/dist-esm/Interfaces/Context/IOperatingSystem.js +1 -1
- package/dist-esm/Interfaces/Context/ISample.js +1 -1
- package/dist-esm/Interfaces/Context/ISession.js +1 -1
- package/dist-esm/Interfaces/Context/ITelemetryTrace.js +1 -1
- package/dist-esm/Interfaces/Context/IUser.js +1 -1
- package/dist-esm/Interfaces/Context/IWeb.js +1 -1
- package/dist-esm/Interfaces/Contracts/AvailabilityData.js +1 -1
- package/dist-esm/Interfaces/Contracts/ContextTagKeys.js +1 -1
- package/dist-esm/Interfaces/Contracts/DataPointType.js +1 -1
- package/dist-esm/Interfaces/Contracts/DependencyKind.js +1 -1
- package/dist-esm/Interfaces/Contracts/DependencySourceType.js +1 -1
- package/dist-esm/Interfaces/Contracts/IBase.js +1 -1
- package/dist-esm/Interfaces/Contracts/IData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IDataPoint.js +1 -1
- package/dist-esm/Interfaces/Contracts/IDomain.js +1 -1
- package/dist-esm/Interfaces/Contracts/IEnvelope.js +1 -1
- package/dist-esm/Interfaces/Contracts/IEventData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IExceptionData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IExceptionDetails.js +1 -1
- package/dist-esm/Interfaces/Contracts/IMessageData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IMetricData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IPageViewData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IPageViewPerfData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IRemoteDependencyData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IStackFrame.js +1 -1
- package/dist-esm/Interfaces/Contracts/RequestData.js +1 -1
- package/dist-esm/Interfaces/Contracts/SeverityLevel.js +1 -1
- package/dist-esm/Interfaces/IAppInsights.js +1 -1
- package/dist-esm/Interfaces/IChannelControlsAI.js +1 -1
- package/dist-esm/Interfaces/IConfig.js +1 -1
- package/dist-esm/Interfaces/ICorrelationConfig.js +1 -1
- package/dist-esm/Interfaces/IDependencyTelemetry.js +1 -1
- package/dist-esm/Interfaces/IEventTelemetry.js +1 -1
- package/dist-esm/Interfaces/IExceptionTelemetry.js +1 -1
- package/dist-esm/Interfaces/IMetricTelemetry.js +1 -1
- package/dist-esm/Interfaces/IPageViewPerformanceTelemetry.js +1 -1
- package/dist-esm/Interfaces/IPageViewTelemetry.js +1 -1
- package/dist-esm/Interfaces/IPartC.js +1 -1
- package/dist-esm/Interfaces/IPropertiesPlugin.js +1 -1
- package/dist-esm/Interfaces/IRequestContext.js +1 -1
- package/dist-esm/Interfaces/ITelemetryContext.js +1 -1
- package/dist-esm/Interfaces/IThrottleMgr.js +6 -0
- package/dist-esm/Interfaces/IThrottleMgr.js.map +1 -0
- package/dist-esm/Interfaces/ITraceTelemetry.js +1 -1
- package/dist-esm/Interfaces/PartAExtensions.js +1 -1
- package/dist-esm/Interfaces/Telemetry/IEnvelope.js +1 -1
- package/dist-esm/Interfaces/Telemetry/ISerializable.js +1 -1
- package/dist-esm/RequestResponseHeaders.js +1 -1
- package/dist-esm/StorageHelperFuncs.js +1 -1
- package/dist-esm/Telemetry/Common/Data.js +1 -1
- package/dist-esm/Telemetry/Common/DataPoint.js +1 -1
- package/dist-esm/Telemetry/Common/DataSanitizer.js +1 -1
- package/dist-esm/Telemetry/Common/Envelope.js +1 -1
- package/dist-esm/Telemetry/Event.js +1 -1
- package/dist-esm/Telemetry/Exception.js +1 -1
- package/dist-esm/Telemetry/Metric.js +3 -3
- package/dist-esm/Telemetry/Metric.js.map +1 -1
- package/dist-esm/Telemetry/PageView.js +1 -1
- package/dist-esm/Telemetry/PageViewPerformance.js +1 -1
- package/dist-esm/Telemetry/RemoteDependencyData.js +1 -1
- package/dist-esm/Telemetry/Trace.js +1 -1
- package/dist-esm/TelemetryItemCreator.js +1 -1
- package/dist-esm/ThrottleMgr.js +259 -0
- package/dist-esm/ThrottleMgr.js.map +1 -0
- package/dist-esm/UrlHelperFuncs.js +1 -1
- package/dist-esm/Util.js +1 -1
- package/dist-esm/__DynamicConstants.js +10 -4
- package/dist-esm/__DynamicConstants.js.map +1 -1
- package/dist-esm/applicationinsights-common.js +2 -1
- package/dist-esm/applicationinsights-common.js.map +1 -1
- package/package.json +5 -4
- package/src/Enums.ts +6 -0
- package/src/Interfaces/IThrottleMgr.ts +109 -0
- package/src/ThrottleMgr.ts +285 -0
- package/src/__DynamicConstants.ts +9 -3
- package/src/applicationinsights-common.ts +3 -1
- package/types/Enums.d.ts +5 -0
- package/types/Interfaces/IThrottleMgr.d.ts +94 -0
- package/types/ThrottleMgr.d.ts +12 -0
- package/types/__DynamicConstants.d.ts +8 -2
- package/types/applicationinsights-common.d.ts +3 -1
|
@@ -6,9 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
import { createTraceParent } from '@microsoft/applicationinsights-core-js';
|
|
8
8
|
import { _eInternalMessageId } from '@microsoft/applicationinsights-core-js';
|
|
9
|
+
import { eLoggingSeverity } from '@microsoft/applicationinsights-core-js';
|
|
9
10
|
import { EnumValue } from '@microsoft/applicationinsights-core-js';
|
|
10
11
|
import { findW3cTraceParent } from '@microsoft/applicationinsights-core-js';
|
|
11
12
|
import { formatTraceParent } from '@microsoft/applicationinsights-core-js';
|
|
13
|
+
import { IAppInsightsCore } from '@microsoft/applicationinsights-core-js';
|
|
12
14
|
import { IChannelControls } from '@microsoft/applicationinsights-core-js';
|
|
13
15
|
import { IConfiguration } from '@microsoft/applicationinsights-core-js';
|
|
14
16
|
import { ICookieMgr } from '@microsoft/applicationinsights-core-js';
|
|
@@ -838,6 +840,50 @@ export interface ITelemetryTrace {
|
|
|
838
840
|
traceState?: ITraceState;
|
|
839
841
|
}
|
|
840
842
|
|
|
843
|
+
// @public
|
|
844
|
+
export interface IThrottleInterval {
|
|
845
|
+
dayInterval?: number;
|
|
846
|
+
maxTimesPerMonth?: number;
|
|
847
|
+
monthInterval?: number;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
// @public
|
|
851
|
+
export interface IThrottleLimit {
|
|
852
|
+
maxSendNumber?: number;
|
|
853
|
+
samplingRate?: number;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
// @public
|
|
857
|
+
export interface IThrottleLocalStorageObj {
|
|
858
|
+
count: number;
|
|
859
|
+
date: Date;
|
|
860
|
+
preTriggerDate?: Date;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
// @public
|
|
864
|
+
export interface IThrottleMgrConfig {
|
|
865
|
+
disabled?: boolean;
|
|
866
|
+
interval?: IThrottleInterval;
|
|
867
|
+
limit?: IThrottleLimit;
|
|
868
|
+
msgKey: IThrottleMsgKey;
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
// @public (undocumented)
|
|
872
|
+
export const enum IThrottleMsgKey {
|
|
873
|
+
// (undocumented)
|
|
874
|
+
cdnDeprecate = 2,
|
|
875
|
+
// (undocumented)
|
|
876
|
+
default = 0,
|
|
877
|
+
// (undocumented)
|
|
878
|
+
ikeyDeprecate = 1
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
// @public
|
|
882
|
+
export interface IThrottleResult {
|
|
883
|
+
isThrottled: boolean;
|
|
884
|
+
throttleNum: number;
|
|
885
|
+
}
|
|
886
|
+
|
|
841
887
|
export { ITraceParent }
|
|
842
888
|
|
|
843
889
|
// @public (undocumented)
|
|
@@ -1083,6 +1129,25 @@ export class TelemetryItemCreator {
|
|
|
1083
1129
|
static create: typeof createTelemetryItem;
|
|
1084
1130
|
}
|
|
1085
1131
|
|
|
1132
|
+
// @public (undocumented)
|
|
1133
|
+
export class ThrottleMgr {
|
|
1134
|
+
constructor(throttleMgr?: IThrottleMgrConfig, core?: IAppInsightsCore, namePrefix?: string);
|
|
1135
|
+
// (undocumented)
|
|
1136
|
+
canThrottle: () => boolean;
|
|
1137
|
+
// (undocumented)
|
|
1138
|
+
flush: () => boolean;
|
|
1139
|
+
// (undocumented)
|
|
1140
|
+
getConfig: () => IThrottleMgrConfig;
|
|
1141
|
+
// (undocumented)
|
|
1142
|
+
isReady: () => boolean;
|
|
1143
|
+
// (undocumented)
|
|
1144
|
+
isTriggered: () => boolean;
|
|
1145
|
+
// (undocumented)
|
|
1146
|
+
onReadyState: (isReady?: boolean) => boolean;
|
|
1147
|
+
// (undocumented)
|
|
1148
|
+
sendMessage: (msgID: _eInternalMessageId, message: string, severity?: eLoggingSeverity) => IThrottleResult | null;
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1086
1151
|
// Warning: (ae-forgotten-export) The symbol "IMessageData" needs to be exported by the entry point applicationinsights-common.d.ts
|
|
1087
1152
|
//
|
|
1088
1153
|
// @public (undocumented)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Microsoft Application Insights Common JavaScript Library, 3.0.0-beta.2210-
|
|
2
|
+
* Microsoft Application Insights Common JavaScript Library, 3.0.0-beta.2210-21
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* Microsoft Application Insights Team
|
|
@@ -9,9 +9,11 @@
|
|
|
9
9
|
declare namespace ApplicationInsights {
|
|
10
10
|
import { createTraceParent } from '@microsoft/applicationinsights-core-js';
|
|
11
11
|
import { _eInternalMessageId } from '@microsoft/applicationinsights-core-js';
|
|
12
|
+
import { eLoggingSeverity } from '@microsoft/applicationinsights-core-js';
|
|
12
13
|
import { EnumValue } from '@microsoft/applicationinsights-core-js';
|
|
13
14
|
import { findW3cTraceParent } from '@microsoft/applicationinsights-core-js';
|
|
14
15
|
import { formatTraceParent } from '@microsoft/applicationinsights-core-js';
|
|
16
|
+
import { IAppInsightsCore } from '@microsoft/applicationinsights-core-js';
|
|
15
17
|
import { IChannelControls } from '@microsoft/applicationinsights-core-js';
|
|
16
18
|
import { IConfiguration } from '@microsoft/applicationinsights-core-js';
|
|
17
19
|
import { ICookieMgr } from '@microsoft/applicationinsights-core-js';
|
|
@@ -1955,6 +1957,110 @@ declare namespace ApplicationInsights {
|
|
|
1955
1957
|
name?: string;
|
|
1956
1958
|
}
|
|
1957
1959
|
|
|
1960
|
+
/**
|
|
1961
|
+
* Identifies frequency of items sent
|
|
1962
|
+
* Default: send data on 28th every 3 month each year
|
|
1963
|
+
*/
|
|
1964
|
+
interface IThrottleInterval {
|
|
1965
|
+
/**
|
|
1966
|
+
* Identifies month interval that items can be sent
|
|
1967
|
+
* For example, if it is set to 2 and start date is in Jan, items will be sent out every two months (Jan, March, May etc.)
|
|
1968
|
+
* Default: 3
|
|
1969
|
+
*/
|
|
1970
|
+
monthInterval?: number;
|
|
1971
|
+
/**
|
|
1972
|
+
* Identifies days that items can be sent within a month
|
|
1973
|
+
* Default: 28
|
|
1974
|
+
*/
|
|
1975
|
+
dayInterval?: number;
|
|
1976
|
+
/**
|
|
1977
|
+
* Identifies max times items can be sent within a month
|
|
1978
|
+
* Default: 1
|
|
1979
|
+
*/
|
|
1980
|
+
maxTimesPerMonth?: number;
|
|
1981
|
+
}
|
|
1982
|
+
|
|
1983
|
+
/**
|
|
1984
|
+
* Identifies limit number/percentage of items sent per time
|
|
1985
|
+
* If both are provided, minimum number between the two will be used
|
|
1986
|
+
*/
|
|
1987
|
+
interface IThrottleLimit {
|
|
1988
|
+
/**
|
|
1989
|
+
* Identifies sampling percentage of items per time
|
|
1990
|
+
* The percentage is set to 4 decimal places, for example: 1 means 0.0001%
|
|
1991
|
+
* Default: 100 (0.01%)
|
|
1992
|
+
*/
|
|
1993
|
+
samplingRate?: number;
|
|
1994
|
+
/**
|
|
1995
|
+
* Identifies limit number of items per time
|
|
1996
|
+
* Default: 1
|
|
1997
|
+
*/
|
|
1998
|
+
maxSendNumber?: number;
|
|
1999
|
+
}
|
|
2000
|
+
|
|
2001
|
+
/**
|
|
2002
|
+
* Identifies object for local storage
|
|
2003
|
+
*/
|
|
2004
|
+
interface IThrottleLocalStorageObj {
|
|
2005
|
+
/**
|
|
2006
|
+
* Identifies start date
|
|
2007
|
+
*/
|
|
2008
|
+
date: Date;
|
|
2009
|
+
/**
|
|
2010
|
+
* Identifies current count
|
|
2011
|
+
*/
|
|
2012
|
+
count: number;
|
|
2013
|
+
/**
|
|
2014
|
+
* identifies previous triggered throttle date
|
|
2015
|
+
*/
|
|
2016
|
+
preTriggerDate?: Date;
|
|
2017
|
+
}
|
|
2018
|
+
|
|
2019
|
+
/**
|
|
2020
|
+
* Identifies basic config
|
|
2021
|
+
*/
|
|
2022
|
+
interface IThrottleMgrConfig {
|
|
2023
|
+
/**
|
|
2024
|
+
* Identifies message key to be used for local storage key
|
|
2025
|
+
*/
|
|
2026
|
+
msgKey: IThrottleMsgKey;
|
|
2027
|
+
/**
|
|
2028
|
+
* Identifies if throttle is disabled
|
|
2029
|
+
* Default: false
|
|
2030
|
+
*/
|
|
2031
|
+
disabled?: boolean;
|
|
2032
|
+
/**
|
|
2033
|
+
* Identifies limit number/percentage of items sent per time
|
|
2034
|
+
*/
|
|
2035
|
+
limit?: IThrottleLimit;
|
|
2036
|
+
/**
|
|
2037
|
+
* Identifies frequency of items sent
|
|
2038
|
+
* Default: send data on 28th every 3 month each year
|
|
2039
|
+
*/
|
|
2040
|
+
interval?: IThrottleInterval;
|
|
2041
|
+
}
|
|
2042
|
+
|
|
2043
|
+
const enum IThrottleMsgKey {
|
|
2044
|
+
default = 0,
|
|
2045
|
+
ikeyDeprecate = 1,
|
|
2046
|
+
cdnDeprecate = 2
|
|
2047
|
+
}
|
|
2048
|
+
|
|
2049
|
+
/**
|
|
2050
|
+
* Identifies throttle result
|
|
2051
|
+
*/
|
|
2052
|
+
interface IThrottleResult {
|
|
2053
|
+
/**
|
|
2054
|
+
* Identifies if items are sent
|
|
2055
|
+
*/
|
|
2056
|
+
isThrottled: boolean;
|
|
2057
|
+
/**
|
|
2058
|
+
* Identifies numbers of items are sent
|
|
2059
|
+
* if isThrottled is false, it will be set to 0
|
|
2060
|
+
*/
|
|
2061
|
+
throttleNum: number;
|
|
2062
|
+
}
|
|
2063
|
+
|
|
1958
2064
|
export { ITraceParent }
|
|
1959
2065
|
|
|
1960
2066
|
interface ITraceState {
|
|
@@ -2345,6 +2451,17 @@ declare namespace ApplicationInsights {
|
|
|
2345
2451
|
static create: typeof createTelemetryItem;
|
|
2346
2452
|
}
|
|
2347
2453
|
|
|
2454
|
+
class ThrottleMgr {
|
|
2455
|
+
canThrottle: () => boolean;
|
|
2456
|
+
sendMessage: (msgID: _eInternalMessageId, message: string, severity?: eLoggingSeverity) => IThrottleResult | null;
|
|
2457
|
+
getConfig: () => IThrottleMgrConfig;
|
|
2458
|
+
isTriggered: () => boolean;
|
|
2459
|
+
isReady: () => boolean;
|
|
2460
|
+
onReadyState: (isReady?: boolean) => boolean;
|
|
2461
|
+
flush: () => boolean;
|
|
2462
|
+
constructor(throttleMgr?: IThrottleMgrConfig, core?: IAppInsightsCore, namePrefix?: string);
|
|
2463
|
+
}
|
|
2464
|
+
|
|
2348
2465
|
class Trace implements IMessageData, ISerializable {
|
|
2349
2466
|
static envelopeType: string;
|
|
2350
2467
|
static dataType: string;
|