Monitoring Sitecore performance counters in Application Insights (Azure)

Most Sitecore administrators and developers are probably very well aware of the power of performance counters when it comes to trouble shooting issues. But it is not well known that performance counters can actually be visualized in your Azure dashboard using Application Insights.

For this blog post I assume that you are familiar with the process to install performance counters on a server. Also, I would like to point out that it is not recommended for performance reasons to have the counters enabled all the time. They can be a great tool in resolving issues and that’s when it might help to have some graphs in the Azure portal.

In order to enable the counters for AI you can simply add them in the ApplicationInsights.config file under the Counters node:

It is worthwhile mentioning though that if you update the Application Insights version using the Nuget package manager, these changes will be overridden. As an alternative approach the performance counters can be registered with Application Insights via code which is my preferred approach:

Once the change is deployed onto the server(s) and the application is up and running the new performance counters should come through on the portal under the Application Insights Metrics section:

The data captured in Application Insights can then be further queried and shaped using Analytics that comes as part of AI or it can be exported into Power BI or other third party tools.

Here is a list of available counters that Sitecore 8 ships out of the box:

Sitecore 8.0 Performance Counters

What’s next?

There is more! The Sitecore performance counters are just the beginning. Using the standard .NET libraries it is very easy to create custom performance counters and hook them up the same way giving DevOps some very useful insights into the application during runtime.