Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop Application Insights from posting to Debug console

Now I really do quite like the new Application Insights with Visual Studio 2013, and I don't want to remove it. However, it does spam my Debug output quite a lot.

I get rows upon rows of output like

Application Insights Telemetry: {"ver":1,"name":"Microsoft.ApplicationInsights.PerformanceCounter","time":"2015-04-23T11:38:03.1252550+01:00","iKey":"758c18d5-055e-48a8-bbcf-9c3301402b2c","tags":{"ai.internal.sdkVersion":"0.13.2.132","ai.application.ver":"Unknown","ai.device.type":"PC","ai.device.id":"Pat-PC","ai.device.oemName":"Dell Inc.","ai.device.model":"Dell XPS430                  ","ai.device.network":"6","ai.device.language":"en-GB","ai.device.machineName":"Pat-PC","ai.device.os":"Windows NT 6.1.7601.65536"},"data":{"type":"Microsoft.ApplicationInsights.PerformanceCounterData","item":{"categoryName":"Processor","counterName":"% Processor Time","instanceName":"_Total","value":35.9710731506348,"ver":1}}}

This kinda makes it impossible for me to actually use the Debug output for my debug statements. How can I silence Application Insights, or configure Visual Studio to just not show those statements?

like image 898
RamblerToning Avatar asked Apr 23 '15 10:04

RamblerToning


People also ask

How do I turn off app insights?

To turn off Application Insights, remove the module from the System. WebServer/Modules section of Web. config. If you want to remove it altogether, though, you should uninstall the Application Insight NuGet packages, and delete ApplicationInsights.

How do I uninstall Azure application insights?

The only way to do that is to delete the entire Application Insights service configuration through the portal. And currently Application Insights has 7 days retention policy, so all data will be deleted automatically in 7 days.

What is ApplicationInsights config?

By adjusting the configuration file, you can enable or disable Telemetry Modules and initializers, and set parameters for some of them. The configuration file is named ApplicationInsights. config or ApplicationInsights. xml , depending on the type of your application.


2 Answers

To simply turn off these messages, with no other side effects:

TelemetryDebugWriter.IsTracingDisabled = true;
like image 87
Iain Avatar answered Sep 30 '22 17:09

Iain


Hans Passant is right. DeveloperMode is what triggers AI to write events in DebugOutput. Note though that it also forces AI to send data immediately. So if we set it to false data will be batched and sent out once a minute.

like image 40
Anastasia Black Avatar answered Sep 30 '22 17:09

Anastasia Black