Standard performance counters in Application Insights generate too much volume. How can I disable them and only report my own counters + some standard ones (but not all), or just reduce sample frequency?
Select the server in server manager. Scroll down to the PERFORMANCE section. Right-click the server name, and there you find 'Stop Performance Counters'.
The Application Insights SDK and instrumentation is designed to be extremely lightweight and have minimal impact on the performance of your application.
Windows Performance Counters provide a high-level abstraction layer that provides a consistent interface for collecting various kinds of system data such as CPU, memory, and disk usage. System administrators often use performance counters to monitor systems for performance or behavior problems.
Adding this answer for asp.netcore users. modify your startup.cs as shown. You have two options. First completely disables the perf counters.
public void ConfigureServices(IServiceCollection services)
{
var serviceDescriptor = services.FirstOrDefault(descriptor => descriptor.ImplementationType == typeof(PerformanceCollectorModule));
services.Remove(serviceDescriptor);
}
or second removes individual counters and you can add your own if you want later.
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
var modules = app.ApplicationServices.GetServices<ITelemetryModule>();
var perfModule = modules.OfType<PerformanceCollectorModule>().First();
perfModule.DefaultCounters.Clear();
}
In my case adding counters to Counters didn't affected the default counters so both sets mine and default was reported. Fortunately the collector is open source and there is a clear clue what you need to do in order remove them. Just define an empty DefaultCounters
like this:
<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.PerformanceCollectorModule, Microsoft.AI.PerfCounterCollector">
<DefaultCounters/>
<Counters>
<Add PerformanceCounter="YOUR COUNTER"/>
</Counters>
</Add>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With