Search code examples
azure-application-insightscost-management

Why am I seeing a large spike in Data ingestion from performance counter data?


From looking at my Cost Management reports for Application Insights, I've noticed a large spike in data ingestion related to Performance Counters.

Cost Management Reporting

Link to larger image

However, I'm not seeing any significant correlation in the number of requests spiking for the same period.

Request Metrics Report

Link to larger image

What can I do to understand the root cause of this issue?

Additional Information

After some debugging, I was able to get to the bottom of this.

The usage spiked on Sep 7 and Sep 8 and then tapered off on the 9th and 10th.

The change that I made on the 6th Sept was to upgrade Microsoft.ApplicationInsights.AspNetCore from version 2.6.1 to version 2.7.1. Version 2.7.1 has ILogger integration baked in.

So, what I believe happened is that, after deploying the upgraded version of Microsoft.ApplicationInsights.AspNetCore, I may have had the Logging verbosity turned up too high for the performance counter telemetry data and subsequently changed it a couple of days later when I noticed it.

I hope this helps someone else who may run into this issue!


Solution

  • There is now a cleaner way to achieve the disabling of the PerformanceCounterModule (and other modules which cause excessive/unneeded logging);

    services.AddApplicationInsightsTelemetry(options =>
    {
        options.EnablePerformanceCounterCollectionModule = false;
        options.InstrumentationKey = configuration["ApplicationInsights:InstrumentationKey"];
    });