Reputation: 5471
I'm working on a web application which is sending thousands of requests with application insights.
Where is Application Insights turned on and off from?
Upvotes: 12
Views: 16115
Reputation: 402
I know I'm late here. But may be this will help someone else who comes across this thread.
I applied this solution this for my project which is in ASP.NET MVC Core.
Note that this disables Application Insights logging for all environments (Development, Production, Staging etc.)
Follow the instruction in attached image. It's easier to understand.
Upvotes: 1
Reputation: 7412
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.config.
Upvotes: 2
Reputation: 279
Is this question about how to turn off the Application Insights or turn off the Application Insights Telemetry? Cause the above two answers are both about how to turn off the telemetry.
Actually application insights on azure portal communicate with your web application via in the applicationinsights.config. If you want to disable it, just set the key value empty.
Upvotes: 3
Reputation: 108
The short answer is that in order to mute Application Insights telemetry, you need to set the DisableTelemetry flag to false.
However, you need to make sure that you're setting the flag on the correct TelemetryConfiguration instance. So if you're using a TelemetryConfiguration other than TelemetryConfiguration.Active, you need to set the flag on that instance. It is also possible that PerformanceCollectorModule telemetry module is using a TelemetryConfiguration instance which is different from the one your TelemetryClient uses.
Let's clarify a couple of things before we move any further:
Do you only see Microsoft.ApplicationInsights.PerformanceCounter-related items in the Output window or do you also see other items?
How are you configuring Application Insights? Do you use ApplicationInsights.config file? Do you create your own TelemetryConfiguration instances and TelemetryClient instances? A code snippet demonstrating your initialization process would help a lot.
Upvotes: 3
Reputation: 621
Where is exactly turned on I don't know, but I guess that you are looking for a way to feature toggle application insights, and to do so in your Application_Start you could do:
TelemetryConfiguration.Active.DisableTelemetry = true;
Doing this you'll stop sending telemetry info.
I hope this help, if it doesn't please let us know what you tried so I could have a better understanding of your question.
For more information you can check their documentation here. The section about Custom Initializers is also quite interesting and maybe will help you as well.
Upvotes: 14