mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
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:
@@ -31,7 +31,17 @@ function getClient(aiKey: string): typeof appInsights.client {
|
|||||||
|
|
||||||
const client = appInsights.getClient(aiKey);
|
const client = appInsights.getClient(aiKey);
|
||||||
client.channel.setOfflineMode(true);
|
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.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) {
|
if (aiKey.indexOf('AIF-') === 0) {
|
||||||
client.config.endpointUrl = 'https://vortex.data.microsoft.com/collect/v1';
|
client.config.endpointUrl = 'https://vortex.data.microsoft.com/collect/v1';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user