1

I have a Azure web.app (s3) that has a memory leak. To investigate I like to add more PerformanceCounter to application insight.

But I can't make it work.

Here is my ApplicationInsights.config that I added. (https://stebet.net/monitor-your-net-garbage-collector-using-application-insights/)

<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.PerformanceCollectorModule, Microsoft.AI.PerfCounterCollector">
    <Counters>
      <Add PerformanceCounter="\.NET CLR Memory(??APP_CLR_PROC??)\# Bytes in all Heaps" ReportAs="Bytes in all Heaps" />
    </Counters>
  </Add>

I add my new counter to ApplicationInsights.config and deploy to azure web.app. In Portal I see no data and find error.

AI: Performance counter is not available in the web app supported list. Counter is \Process(??APP_WIN32_PROC??)\Bytes in all Heaps.

Please help me understand what is the problem.

Thanks, Henrik

Janley Zhang
  • 1,567
  • 7
  • 11
Henrik
  • 243
  • 1
  • 3
  • 12
  • You could refer to the two articles, [1](https://social.msdn.microsoft.com/Forums/en-US/4568d1a1-47f7-485e-8447-622429868452/ai-performance-counter-is-not-available-in-the-web-app-supported-list?forum=ApplicationInsights) and [2](https://learn.microsoft.com/en-us/azure/application-insights/app-insights-performance-counters#add-counters). – Joy Wang Mar 22 '18 at 03:05
  • Thanks. You are correct. They help me to understand how to setup. But the problem remains that I get error in Azure and I dont know why. – Henrik Mar 22 '18 at 08:15

1 Answers1

1

Please help me understand what is the problem.

We could get the answer from System performance counters in Application Insights.

Performance counters aren't available for Azure Web Apps.

Application Insights can show these performance counters if your application is running under IIS on an on-premises host or virtual machine to which you have administrative access.But you can send Azure Diagnostics to Application Insights.

But we could use Application Insight API to get data, we need to create a Apikey. We also could get demo code from the document. I did a demo before, for more detail information you could refer to another SO thread.

Tom Sun - MSFT
  • 24,161
  • 3
  • 30
  • 47