Add AppInsights context flag to envelope (#1282)

* Add AppInsights context flag to envelope

* Fix typo

* Use add processor instead of patching
This commit is contained in:
Karl Burtram
2018-04-26 21:26:51 -07:00
committed by GitHub
parent 0f087915f6
commit 0c663e5555

View File

@@ -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';
}