Martin
Martin

Reputation: 597

Application Insights - No data for 'process cpu'

I'm in the process of setting up app insights for a WCF project. The problem I'm having is I can't seem to get it to report on the process cpu, available memory etc. The charts just say no data.

I've got

<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.PerformanceCollectorModule, Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector">

Included in my applicationinsights.config file as I saw in another post that this is required, but this doesn't seem to sorted it.

Does anyone know if I need to add anything else to my project to get this too work? I assumed that this information would be collected by default.

Upvotes: 10

Views: 5149

Answers (3)

felickz
felickz

Reputation: 4461

The ONLY way i could get Application Insights to collect performanceCounters from an IIS hosted .NET Framework application in Azure or my Local Machine was to install the Microsoft.Azure.Diagnostics.ApplicationMonitoringWindows agent.

the only indication that i have found that this MIGHT Be required is this little tidbit of information in AIS troubleshooting docs:

No performance data

Performance data (CPU, IO rate, and so on) is available for Java web services, Windows desktop apps, IIS web apps and services if you install Application Insights Agent, and Azure Cloud Services. you'll find it under Settings, Servers.

Following ASP.NET App Insights sample line for line ... I saw no perf counters collected

I feel this module has some incompatabilities running inside IIS

Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.PerformanceCollectorModule, Microsoft.AI.PerfCounterCollector

The ONLY time this appears to work is if I host my application in a windows service as an .exe ... at this point I finally see perfCounters via the SDK without an agent installed.

Application Insights - Log Analytics PerfCounters kusto query

and shows up in Performance blade / Roles tab Application Insights Performance Blade - CPU

Upvotes: 0

AmyG
AmyG

Reputation: 351

I came across with very similar issue. Getting all other data on application insights, but no servers data such as average process CPU, available memory, process IO rate etc.

I found out that on the servers, my application running under application pool does not have sufficient permission to collect performance data.(You can check about this in Application Insights Status Monitor Preview, usually if you have permission issues, there will be a warning message about it)

Make these two steps:

  1. In IIS Manager, select your application pool, open Advanced Settings, and under Process Model note the identity.
  2. In Computer management control panel, add this identity to the Performance Monitor Users group.

Once the application pool have sufficient permission to collect performance data. All the data of servers are showing on insights.

https://azure.microsoft.com/en-us/documentation/articles/app-insights-monitor-performance-live-website-now/

Upvotes: 16

Anastasia Black
Anastasia Black

Reputation: 1900

Because you say that you added performance counters module manually to configuration file I assume that you did not use Web SDK nuget package that is supposed to add this module there automatically. If so you need to configure it in code rather than creating a configuration file. You need to create this module in code and also set instrumentation key.

TelemetryConfiguration.Active.InstrumentationKey = "Foo";
this.perfCounterCollectorModule = new PerformanceCollectorModule();

More here.

Upvotes: 2

Related Questions