From 0c663e5555ae45755834069323fd08bb6c08abf8 Mon Sep 17 00:00:00 2001 From: Karl Burtram Date: Thu, 26 Apr 2018 21:26:51 -0700 Subject: [PATCH] Add AppInsights context flag to envelope (#1282) * Add AppInsights context flag to envelope * Fix typo * Use add processor instead of patching --- src/vs/platform/telemetry/node/appInsightsAppender.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/vs/platform/telemetry/node/appInsightsAppender.ts b/src/vs/platform/telemetry/node/appInsightsAppender.ts index 9886b6ce20..f46e0c34a1 100644 --- a/src/vs/platform/telemetry/node/appInsightsAppender.ts +++ b/src/vs/platform/telemetry/node/appInsightsAppender.ts @@ -31,7 +31,17 @@ function getClient(aiKey: string): typeof appInsights.client { const client = appInsights.getClient(aiKey); client.channel.setOfflineMode(true); + + // {{SQL CARBON EDIT}} client.context.tags[client.context.keys.deviceMachineName] = ''; //prevent App Insights from reporting machine name + client.context.tags[client.context.keys.cloudRoleInstance] = ''; //prevent App Insights from reporting machine name + + // set envelope flags to suppress Vortex ingest header + client.addTelemetryProcessor((envelope, contextObjects) => { + envelope.flags = 0x200000; + return true; + }); + if (aiKey.indexOf('AIF-') === 0) { client.config.endpointUrl = 'https://vortex.data.microsoft.com/collect/v1'; }