@webex/internal-plugin-metrics 3.12.0-next.3 → 3.12.0-next.30
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/dist/batcher.js +3 -0
- package/dist/batcher.js.map +1 -1
- package/dist/call-diagnostic/call-diagnostic-metrics-batcher.js +23 -0
- package/dist/call-diagnostic/call-diagnostic-metrics-batcher.js.map +1 -1
- package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js +68 -51
- package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js.map +1 -1
- package/dist/call-diagnostic/call-diagnostic-metrics.js +59 -8
- package/dist/call-diagnostic/call-diagnostic-metrics.js.map +1 -1
- package/dist/call-diagnostic/call-diagnostic-metrics.util.js +5 -0
- package/dist/call-diagnostic/call-diagnostic-metrics.util.js.map +1 -1
- package/dist/call-diagnostic/config.js +16 -3
- package/dist/call-diagnostic/config.js.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/metrics.js +1 -1
- package/dist/metrics.types.js.map +1 -1
- package/dist/prelogin-metrics-batcher.js +23 -0
- package/dist/prelogin-metrics-batcher.js.map +1 -1
- package/dist/types/call-diagnostic/call-diagnostic-metrics-latencies.d.ts +9 -0
- package/dist/types/call-diagnostic/call-diagnostic-metrics.d.ts +39 -13
- package/dist/types/call-diagnostic/config.d.ts +4 -0
- package/dist/types/config.d.ts +1 -0
- package/dist/types/metrics.types.d.ts +2 -2
- package/package.json +11 -11
- package/src/batcher.js +4 -0
- package/src/call-diagnostic/call-diagnostic-metrics-batcher.ts +26 -0
- package/src/call-diagnostic/call-diagnostic-metrics-latencies.ts +140 -69
- package/src/call-diagnostic/call-diagnostic-metrics.ts +51 -1
- package/src/call-diagnostic/call-diagnostic-metrics.util.ts +5 -0
- package/src/call-diagnostic/config.ts +14 -0
- package/src/config.js +1 -0
- package/src/metrics.types.ts +1 -1
- package/src/prelogin-metrics-batcher.ts +26 -0
- package/test/unit/spec/batcher.js +43 -0
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-batcher.ts +150 -2
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-latencies.ts +243 -288
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts +689 -159
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.util.ts +27 -0
- package/test/unit/spec/prelogin-metrics-batcher.ts +190 -36
|
@@ -7,6 +7,7 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
|
|
10
|
+
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/array/is-array"));
|
|
10
11
|
var _lodash = require("lodash");
|
|
11
12
|
var _batcher = _interopRequireDefault(require("./batcher"));
|
|
12
13
|
var _callDiagnosticMetrics = require("./call-diagnostic/call-diagnostic-metrics.util");
|
|
@@ -70,11 +71,33 @@ var PreLoginMetricsBatcher = _batcher.default.extend({
|
|
|
70
71
|
waitForServiceTimeout: this.webex.config.metrics.waitForServiceTimeout
|
|
71
72
|
}).then(function (res) {
|
|
72
73
|
_this.webex.logger.log(PRE_LOGIN_METRICS_IDENTIFIER, "PreLoginMetricsBatcher: @submitHttpRequest#".concat(batchId, ". Request successful."));
|
|
74
|
+
_this.handleHttpResponseStatus(res === null || res === void 0 ? void 0 : res.statusCode, payload);
|
|
73
75
|
return res;
|
|
74
76
|
}).catch(function (err) {
|
|
75
77
|
_this.webex.logger.error(PRE_LOGIN_METRICS_IDENTIFIER, "PreLoginMetricsBatcher: @submitHttpRequest#".concat(batchId, ". Request failed:"), "error: ".concat((0, _utils.generateCommonErrorMetadata)(err)));
|
|
78
|
+
_this.handleHttpResponseStatus(err === null || err === void 0 ? void 0 : err.statusCode, payload);
|
|
76
79
|
return _promise.default.reject(err);
|
|
77
80
|
});
|
|
81
|
+
},
|
|
82
|
+
/**
|
|
83
|
+
* React to the HTTP status code returned by the prelogin metrics endpoint.
|
|
84
|
+
* Only items submitted with `markTelemetryOptOutOnResponse: true` opt into
|
|
85
|
+
* this behavior.
|
|
86
|
+
* @param {number | undefined} statusCode
|
|
87
|
+
* @param {any[]} payload Items flushed in this HTTP batch.
|
|
88
|
+
* @returns {void}
|
|
89
|
+
*/
|
|
90
|
+
handleHttpResponseStatus: function handleHttpResponseStatus(statusCode, payload) {
|
|
91
|
+
var shouldMark = (0, _isArray.default)(payload) && payload.some(function (item) {
|
|
92
|
+
return (item === null || item === void 0 ? void 0 : item.markTelemetryOptOutOnResponse) === true;
|
|
93
|
+
});
|
|
94
|
+
if (!shouldMark) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
if (statusCode === 200) {
|
|
98
|
+
var _this$webex$internal$, _this$webex$internal$2;
|
|
99
|
+
(_this$webex$internal$ = this.webex.internal.newMetrics) === null || _this$webex$internal$ === void 0 ? void 0 : (_this$webex$internal$2 = _this$webex$internal$.callDiagnosticMetrics) === null || _this$webex$internal$2 === void 0 ? void 0 : _this$webex$internal$2.setIsTelemetryOptOutAutomatic(true);
|
|
100
|
+
}
|
|
78
101
|
}
|
|
79
102
|
});
|
|
80
103
|
var _default = exports.default = PreLoginMetricsBatcher;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_lodash","require","_batcher","_interopRequireDefault","_callDiagnosticMetrics","_utils","PRE_LOGIN_METRICS_IDENTIFIER","PreLoginMetricsBatcher","Batcher","extend","namespace","preLoginId","undefined","savePreLoginId","prepareItem","item","_promise","default","resolve","prepareDiagnosticMetricItem","webex","prepareRequest","queue","forEach","eventPayload","originTime","sent","Date","toISOString","submitHttpRequest","payload","_this","batchId","uniqueId","logger","error","concat","reject","Error","request","method","service","resource","headers","authorization","body","metrics","waitForServiceTimeout","config","then","res","log","catch","err","generateCommonErrorMetadata","_default","exports"],"sources":["prelogin-metrics-batcher.ts"],"sourcesContent":["import {uniqueId} from 'lodash';\nimport Batcher from './batcher';\nimport {prepareDiagnosticMetricItem} from './call-diagnostic/call-diagnostic-metrics.util';\nimport {generateCommonErrorMetadata} from './utils';\n\nconst PRE_LOGIN_METRICS_IDENTIFIER = 'Pre Login Metrics -->';\n\nconst PreLoginMetricsBatcher = Batcher.extend({\n namespace: 'Metrics',\n preLoginId: undefined,\n\n /**\n * Save the pre-login ID.\n * @param {string} preLoginId The pre-login ID to be saved.\n * @returns {void}\n */\n savePreLoginId(preLoginId) {\n this.preLoginId = preLoginId;\n },\n\n /**\n * Prepare item\n * @param {any} item\n * @returns {Promise<any>}\n */\n prepareItem(item) {\n return Promise.resolve(prepareDiagnosticMetricItem(this.webex, item));\n },\n\n /**\n * Prepare request, add time sensitive date etc.\n * @param {any[]} queue\n * @returns {Promise<any[]>}\n */\n prepareRequest(queue) {\n // Add sent timestamp\n queue.forEach((item) => {\n item.eventPayload.originTime = item.eventPayload.originTime || {};\n item.eventPayload.originTime.sent = new Date().toISOString();\n });\n\n return Promise.resolve(queue);\n },\n\n /**\n *\n * @param {any} payload\n * @returns {Promise<any>}\n */\n submitHttpRequest(payload: any) {\n const batchId = uniqueId('prelogin-batch-');\n if (this.preLoginId === undefined) {\n this.webex.logger.error(\n PRE_LOGIN_METRICS_IDENTIFIER,\n `PreLoginMetricsBatcher: @submitHttpRequest#${batchId}. PreLoginId is not set.`\n );\n\n return Promise.reject(new Error('PreLoginId is not set.'));\n }\n\n return this.webex\n .request({\n method: 'POST',\n service: 'metrics',\n resource: 'clientmetrics-prelogin',\n headers: {\n authorization: false,\n 'x-prelogin-userid': this.preLoginId,\n },\n body: {\n metrics: payload,\n },\n waitForServiceTimeout: this.webex.config.metrics.waitForServiceTimeout,\n })\n .then((res) => {\n this.webex.logger.log(\n PRE_LOGIN_METRICS_IDENTIFIER,\n `PreLoginMetricsBatcher: @submitHttpRequest#${batchId}. Request successful.`\n );\n\n return res;\n })\n .catch((err) => {\n this.webex.logger.error(\n PRE_LOGIN_METRICS_IDENTIFIER,\n `PreLoginMetricsBatcher: @submitHttpRequest#${batchId}. Request failed:`,\n `error: ${generateCommonErrorMetadata(err)}`\n );\n\n return Promise.reject(err);\n });\n },\n});\n\nexport default PreLoginMetricsBatcher;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_lodash","require","_batcher","_interopRequireDefault","_callDiagnosticMetrics","_utils","PRE_LOGIN_METRICS_IDENTIFIER","PreLoginMetricsBatcher","Batcher","extend","namespace","preLoginId","undefined","savePreLoginId","prepareItem","item","_promise","default","resolve","prepareDiagnosticMetricItem","webex","prepareRequest","queue","forEach","eventPayload","originTime","sent","Date","toISOString","submitHttpRequest","payload","_this","batchId","uniqueId","logger","error","concat","reject","Error","request","method","service","resource","headers","authorization","body","metrics","waitForServiceTimeout","config","then","res","log","handleHttpResponseStatus","statusCode","catch","err","generateCommonErrorMetadata","shouldMark","_isArray","some","markTelemetryOptOutOnResponse","_this$webex$internal$","_this$webex$internal$2","internal","newMetrics","callDiagnosticMetrics","setIsTelemetryOptOutAutomatic","_default","exports"],"sources":["prelogin-metrics-batcher.ts"],"sourcesContent":["import {uniqueId} from 'lodash';\nimport Batcher from './batcher';\nimport {prepareDiagnosticMetricItem} from './call-diagnostic/call-diagnostic-metrics.util';\nimport {generateCommonErrorMetadata} from './utils';\n\nconst PRE_LOGIN_METRICS_IDENTIFIER = 'Pre Login Metrics -->';\n\nconst PreLoginMetricsBatcher = Batcher.extend({\n namespace: 'Metrics',\n preLoginId: undefined,\n\n /**\n * Save the pre-login ID.\n * @param {string} preLoginId The pre-login ID to be saved.\n * @returns {void}\n */\n savePreLoginId(preLoginId) {\n this.preLoginId = preLoginId;\n },\n\n /**\n * Prepare item\n * @param {any} item\n * @returns {Promise<any>}\n */\n prepareItem(item) {\n return Promise.resolve(prepareDiagnosticMetricItem(this.webex, item));\n },\n\n /**\n * Prepare request, add time sensitive date etc.\n * @param {any[]} queue\n * @returns {Promise<any[]>}\n */\n prepareRequest(queue) {\n // Add sent timestamp\n queue.forEach((item) => {\n item.eventPayload.originTime = item.eventPayload.originTime || {};\n item.eventPayload.originTime.sent = new Date().toISOString();\n });\n\n return Promise.resolve(queue);\n },\n\n /**\n *\n * @param {any} payload\n * @returns {Promise<any>}\n */\n submitHttpRequest(payload: any) {\n const batchId = uniqueId('prelogin-batch-');\n if (this.preLoginId === undefined) {\n this.webex.logger.error(\n PRE_LOGIN_METRICS_IDENTIFIER,\n `PreLoginMetricsBatcher: @submitHttpRequest#${batchId}. PreLoginId is not set.`\n );\n\n return Promise.reject(new Error('PreLoginId is not set.'));\n }\n\n return this.webex\n .request({\n method: 'POST',\n service: 'metrics',\n resource: 'clientmetrics-prelogin',\n headers: {\n authorization: false,\n 'x-prelogin-userid': this.preLoginId,\n },\n body: {\n metrics: payload,\n },\n waitForServiceTimeout: this.webex.config.metrics.waitForServiceTimeout,\n })\n .then((res) => {\n this.webex.logger.log(\n PRE_LOGIN_METRICS_IDENTIFIER,\n `PreLoginMetricsBatcher: @submitHttpRequest#${batchId}. Request successful.`\n );\n\n this.handleHttpResponseStatus(res?.statusCode, payload);\n\n return res;\n })\n .catch((err) => {\n this.webex.logger.error(\n PRE_LOGIN_METRICS_IDENTIFIER,\n `PreLoginMetricsBatcher: @submitHttpRequest#${batchId}. Request failed:`,\n `error: ${generateCommonErrorMetadata(err)}`\n );\n\n this.handleHttpResponseStatus(err?.statusCode, payload);\n\n return Promise.reject(err);\n });\n },\n\n /**\n * React to the HTTP status code returned by the prelogin metrics endpoint.\n * Only items submitted with `markTelemetryOptOutOnResponse: true` opt into\n * this behavior.\n * @param {number | undefined} statusCode\n * @param {any[]} payload Items flushed in this HTTP batch.\n * @returns {void}\n */\n handleHttpResponseStatus(statusCode: number | undefined, payload: any[]) {\n const shouldMark =\n Array.isArray(payload) &&\n payload.some((item) => item?.markTelemetryOptOutOnResponse === true);\n\n if (!shouldMark) {\n return;\n }\n\n if (statusCode === 200) {\n this.webex.internal.newMetrics?.callDiagnosticMetrics?.setIsTelemetryOptOutAutomatic(true);\n }\n },\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A,CAAAC,OAAA,CAAQoB,MAAM,CAACkB,GAAG,CAAC;IAC5B,CAAC,CAAC;EACN,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEH,wBAAwB,WAAxBA,wBAAwBA,CAACC,UAA8B,EAAEvB,OAAc,EAAE;IACvE,IAAM2B,UAAU,GACd,IAAAC,QAAA,CAAAzC,OAAA,EAAca,OAAO,CAAC,IACtBA,OAAO,CAAC6B,IAAI,CAAC,UAAC5C,IAAI;MAAA,OAAK,CAAAA,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAE6C,6BAA6B,MAAK,IAAI;IAAA,EAAC;IAEtE,IAAI,CAACH,UAAU,EAAE;MACf;IACF;IAEA,IAAIJ,UAAU,KAAK,GAAG,EAAE;MAAA,IAAAQ,qBAAA,EAAAC,sBAAA;MACtB,CAAAD,qBAAA,OAAI,CAACzC,KAAK,CAAC2C,QAAQ,CAACC,UAAU,cAAAH,qBAAA,wBAAAC,sBAAA,GAA9BD,qBAAA,CAAgCI,qBAAqB,cAAAH,sBAAA,uBAArDA,sBAAA,CAAuDI,6BAA6B,CAAC,IAAI,CAAC;IAC5F;EACF;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAnD,OAAA,GAEYV,sBAAsB","ignoreList":[]}
|
|
@@ -149,6 +149,15 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
149
149
|
* @returns - latency
|
|
150
150
|
*/
|
|
151
151
|
getStayLobbyTime(): number;
|
|
152
|
+
/**
|
|
153
|
+
* Stay lobby time capped by a certain timestamp.
|
|
154
|
+
* This is to handle the case where the target end timestamp could happen before the lobby is exited,
|
|
155
|
+
* for example media-engine.ready or client.ice.end
|
|
156
|
+
* This is supposed to be called AFTER the end timestamp happens
|
|
157
|
+
* @param endTimestampKey name of the target end event
|
|
158
|
+
* @returns - latency
|
|
159
|
+
*/
|
|
160
|
+
getStayLobbyTimeCappedBy(endTimestampKey: MetricEventNames): number;
|
|
152
161
|
/**
|
|
153
162
|
* Page JMT
|
|
154
163
|
* @returns - latency
|
|
@@ -36,6 +36,8 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
36
36
|
private isMercuryConnected;
|
|
37
37
|
private eventLimitTracker;
|
|
38
38
|
private eventLimitWarningsLogged;
|
|
39
|
+
private isTelemetryOptOutManual;
|
|
40
|
+
private isTelemetryOptOutAutomatic;
|
|
39
41
|
validator: (options: {
|
|
40
42
|
type: 'mqe' | 'ce';
|
|
41
43
|
event: Event;
|
|
@@ -53,6 +55,21 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
53
55
|
* @returns one of 'login-ci','unverified-guest', null
|
|
54
56
|
*/
|
|
55
57
|
getCurLoginType(): "unverified-guest" | "login-ci";
|
|
58
|
+
/**
|
|
59
|
+
* Returns the telemetryOptOut value of the current user
|
|
60
|
+
* @returns one of 'manual', 'automatic', undefined
|
|
61
|
+
*/
|
|
62
|
+
getTelemetryOptOut(): "manual" | "automatic";
|
|
63
|
+
/**
|
|
64
|
+
* Sets the manual telemetry opt-out status for the current user
|
|
65
|
+
* @param value - boolean value indicating manual telemetry opt-out status
|
|
66
|
+
*/
|
|
67
|
+
setIsTelemetryOptOutManual(value: boolean): void;
|
|
68
|
+
/**
|
|
69
|
+
* Sets the automatic telemetry opt-out status for the current user
|
|
70
|
+
* @param value - boolean value indicating automatic telemetry opt-out status
|
|
71
|
+
*/
|
|
72
|
+
setIsTelemetryOptOutAutomatic(value: boolean): void;
|
|
56
73
|
/**
|
|
57
74
|
* Returns if the meeting has converged architecture enabled
|
|
58
75
|
* @param options.meetingId
|
|
@@ -84,6 +101,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
84
101
|
userAgent: string;
|
|
85
102
|
buildType?: "debug" | "test" | "prod" | "tap" | "analyzer-test";
|
|
86
103
|
upgradeChannel?: string;
|
|
104
|
+
upgradeSource?: string;
|
|
87
105
|
instanceId?: string;
|
|
88
106
|
networkType: "wifi" | "ethernet" | "cellular" | "unknown";
|
|
89
107
|
localIP?: string;
|
|
@@ -137,11 +155,12 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
137
155
|
architecture: "unknown" | "intel32" | "intel64" | "amd32" | "amd64" | "arm32" | "arm64" | "armv9" | "armv8" | "armv7" | "armv6" | "x86_64" | "x86_32";
|
|
138
156
|
staticPerformance?: string;
|
|
139
157
|
clockSpeedGigaHertz?: number;
|
|
140
|
-
additionalProperties?:
|
|
158
|
+
additionalProperties?: never;
|
|
141
159
|
};
|
|
142
160
|
shareType?: "cb-normal-share" | "ce-airplay-share" | "ce-direct-share" | "ce-gui-loopback-share" | "ce-input-source-share" | "ce-input-source-share-hdmi" | "ce-input-source-share-usbc" | "ce-jpg-share" | "ce-miracast-share" | "mcs-normal-share" | "mcs-normal-audio-share" | "mcs-hfps-share" | "mcs-hfps-audio-share";
|
|
143
161
|
videoDisplayMode?: "grid-view" | "active-speaker-view";
|
|
144
|
-
videoLayoutType?: "stack" | "stackWithShare" | "sideBySide" | "sideBySideWithShare" | "grid" | "floatingActive" | "floatingThumbnail" | "floatingGrid" | "overlay" | "focus" | "prominent" | "focusWithShare" | "prominentWithShare" | "equal" | "equalWithShare" | "largeGallery";
|
|
162
|
+
videoLayoutType?: "auto" | "stack" | "stackWithShare" | "sideBySide" | "sideBySideWithShare" | "grid" | "floatingActive" | "floatingThumbnail" | "floatingGrid" | "overlay" | "focus" | "prominent" | "focusWithShare" | "prominentWithShare" | "equal" | "equalWithShare" | "largeGallery" | "autoWithShare";
|
|
163
|
+
appliedLayout?: "auto" | "stack" | "stackWithShare" | "sideBySide" | "sideBySideWithShare" | "grid" | "floatingActive" | "floatingThumbnail" | "floatingGrid" | "overlay" | "focus" | "prominent" | "focusWithShare" | "prominentWithShare" | "equal" | "equalWithShare" | "largeGallery" | "autoWithShare";
|
|
145
164
|
videoRenderType?: "wme" | "client_d3d" | "client_gdi";
|
|
146
165
|
vdiInfo?: {};
|
|
147
166
|
is64BitsClient?: boolean;
|
|
@@ -153,13 +172,16 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
153
172
|
vendorId?: string;
|
|
154
173
|
staticPerformanceLevel?: string;
|
|
155
174
|
staticPerformanceScore?: number;
|
|
156
|
-
|
|
175
|
+
preInstalledTime?: string;
|
|
176
|
+
preInstalledType?: "installer" | "launcher" | "app";
|
|
177
|
+
preInstalledVersion?: string;
|
|
178
|
+
additionalProperties?: never;
|
|
157
179
|
};
|
|
158
180
|
emmVendorId?: string;
|
|
159
181
|
isHybridMedia?: boolean;
|
|
160
182
|
originData?: {};
|
|
161
183
|
serviceVersion?: string;
|
|
162
|
-
additionalProperties?:
|
|
184
|
+
additionalProperties?: never;
|
|
163
185
|
};
|
|
164
186
|
/**
|
|
165
187
|
* Gather identifier details for call diagnostic payload.
|
|
@@ -183,7 +205,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
183
205
|
imiAppId: string;
|
|
184
206
|
sessionId: string;
|
|
185
207
|
sessionInstanceId: string;
|
|
186
|
-
additionalProperties?:
|
|
208
|
+
additionalProperties?: never;
|
|
187
209
|
};
|
|
188
210
|
csdmDeviceUrl?: string;
|
|
189
211
|
destinationBreakoutSessionId?: string;
|
|
@@ -200,6 +222,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
200
222
|
callId?: string;
|
|
201
223
|
pairCallId?: string;
|
|
202
224
|
llmWebsocketUrl?: string;
|
|
225
|
+
locusCluster?: string;
|
|
203
226
|
locusId?: string;
|
|
204
227
|
locusJoinUrl?: string;
|
|
205
228
|
locusSessionId?: string;
|
|
@@ -227,7 +250,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
227
250
|
sipSessionId?: {
|
|
228
251
|
local?: string;
|
|
229
252
|
remote?: string;
|
|
230
|
-
additionalProperties?:
|
|
253
|
+
additionalProperties?: never;
|
|
231
254
|
};
|
|
232
255
|
sipUri?: string;
|
|
233
256
|
subConfId?: string;
|
|
@@ -255,7 +278,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
255
278
|
idForEndpointAB?: string;
|
|
256
279
|
customerOrgId?: string;
|
|
257
280
|
correlationId: string;
|
|
258
|
-
additionalProperties?:
|
|
281
|
+
additionalProperties?: never;
|
|
259
282
|
} | {
|
|
260
283
|
aggregatedBreakoutMoveId?: string;
|
|
261
284
|
attendeeId?: string;
|
|
@@ -273,7 +296,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
273
296
|
imiAppId: string;
|
|
274
297
|
sessionId: string;
|
|
275
298
|
sessionInstanceId: string;
|
|
276
|
-
additionalProperties?:
|
|
299
|
+
additionalProperties?: never;
|
|
277
300
|
};
|
|
278
301
|
csdmDeviceUrl?: string;
|
|
279
302
|
destinationBreakoutSessionId?: string;
|
|
@@ -290,6 +313,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
290
313
|
callId?: string;
|
|
291
314
|
pairCallId?: string;
|
|
292
315
|
llmWebsocketUrl?: string;
|
|
316
|
+
locusCluster?: string;
|
|
293
317
|
locusId?: string;
|
|
294
318
|
locusJoinUrl?: string;
|
|
295
319
|
locusSessionId?: string;
|
|
@@ -317,7 +341,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
317
341
|
sipSessionId?: {
|
|
318
342
|
local?: string;
|
|
319
343
|
remote?: string;
|
|
320
|
-
additionalProperties?:
|
|
344
|
+
additionalProperties?: never;
|
|
321
345
|
};
|
|
322
346
|
sipUri?: string;
|
|
323
347
|
subConfId?: string;
|
|
@@ -345,7 +369,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
345
369
|
idForEndpointAB?: string;
|
|
346
370
|
customerOrgId?: string;
|
|
347
371
|
correlationId: string;
|
|
348
|
-
additionalProperties?:
|
|
372
|
+
additionalProperties?: never;
|
|
349
373
|
} | {
|
|
350
374
|
aggregatedBreakoutMoveId?: string;
|
|
351
375
|
attendeeId?: string;
|
|
@@ -363,7 +387,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
363
387
|
imiAppId: string;
|
|
364
388
|
sessionId: string;
|
|
365
389
|
sessionInstanceId: string;
|
|
366
|
-
additionalProperties?:
|
|
390
|
+
additionalProperties?: never;
|
|
367
391
|
};
|
|
368
392
|
csdmDeviceUrl?: string;
|
|
369
393
|
destinationBreakoutSessionId?: string;
|
|
@@ -380,6 +404,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
380
404
|
callId?: string;
|
|
381
405
|
pairCallId?: string;
|
|
382
406
|
llmWebsocketUrl?: string;
|
|
407
|
+
locusCluster?: string;
|
|
383
408
|
locusId?: string;
|
|
384
409
|
locusJoinUrl?: string;
|
|
385
410
|
locusSessionId?: string;
|
|
@@ -407,7 +432,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
407
432
|
sipSessionId?: {
|
|
408
433
|
local?: string;
|
|
409
434
|
remote?: string;
|
|
410
|
-
additionalProperties?:
|
|
435
|
+
additionalProperties?: never;
|
|
411
436
|
};
|
|
412
437
|
sipUri?: string;
|
|
413
438
|
subConfId?: string;
|
|
@@ -435,7 +460,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
435
460
|
idForEndpointAB?: string;
|
|
436
461
|
customerOrgId?: string;
|
|
437
462
|
correlationId: string;
|
|
438
|
-
additionalProperties?:
|
|
463
|
+
additionalProperties?: never;
|
|
439
464
|
};
|
|
440
465
|
/**
|
|
441
466
|
* Create diagnostic event, which can hold client event, feature event or MQE event data.
|
|
@@ -606,6 +631,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
606
631
|
* Prepare the event and send the request to metrics-a service, pre login.
|
|
607
632
|
* @param event
|
|
608
633
|
* @param preLoginId
|
|
634
|
+
* @param markTelemetryOptOutOnResponse
|
|
609
635
|
* @returns
|
|
610
636
|
*/
|
|
611
637
|
submitToCallDiagnosticsPreLogin: (event: Event, preLoginId?: string) => Promise<any>;
|
|
@@ -102,11 +102,13 @@ export declare const ERROR_DESCRIPTIONS: {
|
|
|
102
102
|
WEBRTC_API_NOT_AVAILABLE: string;
|
|
103
103
|
WDM_RESTRICTED_REGION: string;
|
|
104
104
|
USER_NOT_ALLOWED_JOIN_WEBINAR: string;
|
|
105
|
+
INVALID_MEETING_INFO: string;
|
|
105
106
|
};
|
|
106
107
|
export declare const SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP: {
|
|
107
108
|
58400: number;
|
|
108
109
|
99002: number;
|
|
109
110
|
99009: number;
|
|
111
|
+
99019: number;
|
|
110
112
|
58500: number;
|
|
111
113
|
400001: number;
|
|
112
114
|
403004: number;
|
|
@@ -134,6 +136,7 @@ export declare const SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP: {
|
|
|
134
136
|
423001: number;
|
|
135
137
|
423005: number;
|
|
136
138
|
423006: number;
|
|
139
|
+
423008: number;
|
|
137
140
|
423010: number;
|
|
138
141
|
423012: number;
|
|
139
142
|
423013: number;
|
|
@@ -147,6 +150,7 @@ export declare const SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP: {
|
|
|
147
150
|
403037: number;
|
|
148
151
|
403003: number;
|
|
149
152
|
403030: number;
|
|
153
|
+
403106: number;
|
|
150
154
|
2403001: number;
|
|
151
155
|
2403002: number;
|
|
152
156
|
2403003: number;
|
package/dist/types/config.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export type SubmitMQEOptions = {
|
|
|
42
42
|
globalMeetingId?: string;
|
|
43
43
|
};
|
|
44
44
|
export type InternalEvent = {
|
|
45
|
-
name: 'internal.client.meetinginfo.request' | 'internal.client.meetinginfo.response' | 'internal.register.device.request' | 'internal.register.device.response' | 'internal.reset.join.latencies' | 'internal.
|
|
45
|
+
name: 'internal.client.meetinginfo.request' | 'internal.client.meetinginfo.response' | 'internal.register.device.request' | 'internal.register.device.response' | 'internal.reset.join.latencies' | 'internal.host.meeting.participant.admitted' | 'internal.client.meeting.interstitial-window.showed' | 'internal.client.interstitial-window.click.joinbutton' | 'internal.client.add-media.turn-discovery.start' | 'internal.client.add-media.turn-discovery.end' | 'internal.client.share.initiated' | 'internal.client.share.stopped';
|
|
46
46
|
payload?: never;
|
|
47
47
|
options?: never;
|
|
48
48
|
};
|
|
@@ -154,7 +154,7 @@ export type BuildClientEventFetchRequestOptions = (args: {
|
|
|
154
154
|
payload?: RecursivePartial<ClientEvent['payload']>;
|
|
155
155
|
options?: SubmitClientEventOptions;
|
|
156
156
|
}) => Promise<any>;
|
|
157
|
-
export type PreComputedLatencies = 'internal.client.pageJMT' | 'internal.download.time' | 'internal.get.cluster.time' | 'internal.click.to.interstitial' | 'internal.click.to.interstitial.with.user.delay' | 'internal.refresh.captcha.time' | 'internal.exchange.ci.token.time' | 'internal.get.u2c.time' | 'internal.call.init.join.req' | 'internal.other.app.api.time' | 'internal.api.fetch.intelligence.models';
|
|
157
|
+
export type PreComputedLatencies = 'internal.client.pageJMT' | 'internal.download.time' | 'internal.get.cluster.time' | 'internal.click.to.interstitial' | 'internal.click.to.interstitial.with.user.delay' | 'internal.click.to.interstitial.for.client.jmt' | 'internal.refresh.captcha.time' | 'internal.exchange.ci.token.time' | 'internal.get.u2c.time' | 'internal.call.init.join.req' | 'internal.other.app.api.time' | 'internal.api.fetch.intelligence.models';
|
|
158
158
|
export interface IdType {
|
|
159
159
|
meetingId?: string;
|
|
160
160
|
callId?: string;
|
package/package.json
CHANGED
|
@@ -24,23 +24,23 @@
|
|
|
24
24
|
"@sinonjs/fake-timers": "^6.0.1",
|
|
25
25
|
"@webex/babel-config-legacy": "0.0.0",
|
|
26
26
|
"@webex/eslint-config-legacy": "0.0.0",
|
|
27
|
-
"@webex/event-dictionary-ts": "^1.0.2073",
|
|
28
27
|
"@webex/jest-config-legacy": "0.0.0",
|
|
29
28
|
"@webex/legacy-tools": "0.0.0",
|
|
30
|
-
"@webex/test-helper-chai": "3.
|
|
31
|
-
"@webex/test-helper-mocha": "3.
|
|
32
|
-
"@webex/test-helper-mock-webex": "3.
|
|
33
|
-
"@webex/test-helper-test-users": "3.
|
|
29
|
+
"@webex/test-helper-chai": "3.12.0-next.5",
|
|
30
|
+
"@webex/test-helper-mocha": "3.12.0-next.5",
|
|
31
|
+
"@webex/test-helper-mock-webex": "3.12.0-next.5",
|
|
32
|
+
"@webex/test-helper-test-users": "3.12.0-next.5",
|
|
34
33
|
"eslint": "^8.24.0",
|
|
35
34
|
"prettier": "^2.7.1",
|
|
36
35
|
"sinon": "^9.2.4"
|
|
37
36
|
},
|
|
38
37
|
"dependencies": {
|
|
39
|
-
"@webex/common": "3.
|
|
40
|
-
"@webex/common-timers": "3.
|
|
41
|
-
"@webex/
|
|
42
|
-
"@webex/test-helper-
|
|
43
|
-
"@webex/webex
|
|
38
|
+
"@webex/common": "3.12.0-next.5",
|
|
39
|
+
"@webex/common-timers": "3.12.0-next.5",
|
|
40
|
+
"@webex/event-dictionary-ts": "^1.0.2191",
|
|
41
|
+
"@webex/test-helper-chai": "3.12.0-next.5",
|
|
42
|
+
"@webex/test-helper-mock-webex": "3.12.0-next.5",
|
|
43
|
+
"@webex/webex-core": "3.12.0-next.30",
|
|
44
44
|
"ip-anonymize": "^0.1.0",
|
|
45
45
|
"lodash": "^4.17.21",
|
|
46
46
|
"uuid": "^3.3.2"
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"test:style": "eslint ./src/**/*.*",
|
|
54
54
|
"test:unit": "webex-legacy-tools test --unit --runner mocha"
|
|
55
55
|
},
|
|
56
|
-
"version": "3.12.0-next.
|
|
56
|
+
"version": "3.12.0-next.30"
|
|
57
57
|
}
|
package/src/batcher.js
CHANGED
|
@@ -75,6 +75,10 @@ const MetricsBatcher = Batcher.extend({
|
|
|
75
75
|
*/
|
|
76
76
|
handleHttpError(reason) {
|
|
77
77
|
if (reason instanceof WebexHttpError.NetworkOrCORSError) {
|
|
78
|
+
if (!this.config.batcherRetryOnNetworkError) {
|
|
79
|
+
return Reflect.apply(Batcher.prototype.handleHttpError, this, [reason]);
|
|
80
|
+
}
|
|
81
|
+
|
|
78
82
|
this.logger.warn(
|
|
79
83
|
'metrics-batcher: received network error submitting metrics, reenqueuing payload'
|
|
80
84
|
);
|
|
@@ -55,6 +55,8 @@ const CallDiagnosticEventsBatcher = Batcher.extend({
|
|
|
55
55
|
`CallDiagnosticEventsBatcher: @submitHttpRequest#${batchId}. Request successful.`
|
|
56
56
|
);
|
|
57
57
|
|
|
58
|
+
this.handleHttpResponseStatus(res?.statusCode, payload);
|
|
59
|
+
|
|
58
60
|
return res;
|
|
59
61
|
})
|
|
60
62
|
.catch((err) => {
|
|
@@ -64,9 +66,33 @@ const CallDiagnosticEventsBatcher = Batcher.extend({
|
|
|
64
66
|
`error: ${generateCommonErrorMetadata(err)}`
|
|
65
67
|
);
|
|
66
68
|
|
|
69
|
+
this.handleHttpResponseStatus(err?.statusCode, payload);
|
|
70
|
+
|
|
67
71
|
return Promise.reject(err);
|
|
68
72
|
});
|
|
69
73
|
},
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* React to the HTTP status code returned by the metrics endpoint.
|
|
77
|
+
* Only items submitted with `markTelemetryOptOutOnResponse: true` opt into
|
|
78
|
+
* this behavior.
|
|
79
|
+
* @param {number | undefined} statusCode
|
|
80
|
+
* @param {any[]} payload Items flushed in this HTTP batch.
|
|
81
|
+
* @returns {void}
|
|
82
|
+
*/
|
|
83
|
+
handleHttpResponseStatus(statusCode: number | undefined, payload: any[]) {
|
|
84
|
+
const shouldMark =
|
|
85
|
+
Array.isArray(payload) &&
|
|
86
|
+
payload.some((item) => item?.markTelemetryOptOutOnResponse === true);
|
|
87
|
+
|
|
88
|
+
if (!shouldMark) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (statusCode === 200) {
|
|
93
|
+
this.webex.internal.newMetrics?.callDiagnosticMetrics?.setIsTelemetryOptOutAutomatic(true);
|
|
94
|
+
}
|
|
95
|
+
},
|
|
70
96
|
});
|
|
71
97
|
|
|
72
98
|
export default CallDiagnosticEventsBatcher;
|