diff --git a/build/lib/stats.js b/build/lib/stats.js index 41076e56047..56904cd4baa 100644 --- a/build/lib/stats.js +++ b/build/lib/stats.js @@ -105,14 +105,15 @@ function submitAllStats(productJson) { .setAutoCollectPerformance(false) .setAutoCollectRequests(false) .start(); - appInsights.defaultClient.config.endpointUrl = 'https://vortex.data.microsoft.com/collect/v1'; + var client = appInsights.getClient(productJson.aiConfig.asimovKey); + client.config.endpointUrl = 'https://vortex.data.microsoft.com/collect/v1'; /* __GDPR__ "monacoworkbench/bundleStats" : { "outcome" : {"classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true } } */ - appInsights.defaultClient.trackEvent("monacoworkbench/bundleStats", undefined, measurements); - appInsights.defaultClient.sendPendingData(function () { return resolve(); }); + client.trackEvent("monacoworkbench/bundleStats", undefined, measurements); + client.sendPendingData(function () { return resolve(); }); }); } exports.submitAllStats = submitAllStats; diff --git a/build/lib/stats.ts b/build/lib/stats.ts index 7f000caae4a..a36e9a0a6c7 100644 --- a/build/lib/stats.ts +++ b/build/lib/stats.ts @@ -111,14 +111,16 @@ export function submitAllStats(productJson: any): Promise { .setAutoCollectRequests(false) .start(); - appInsights.defaultClient.config.endpointUrl = 'https://vortex.data.microsoft.com/collect/v1'; + const client = appInsights.getClient(productJson.aiConfig.asimovKey); + client.config.endpointUrl = 'https://vortex.data.microsoft.com/collect/v1'; + /* __GDPR__ "monacoworkbench/bundleStats" : { "outcome" : {"classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true } } */ - appInsights.defaultClient.trackEvent(`monacoworkbench/bundleStats`, undefined, measurements); - appInsights.defaultClient.sendPendingData(() => resolve()); + client.trackEvent(`monacoworkbench/bundleStats`, undefined, measurements); + client.sendPendingData(() => resolve()); }); }