How to setup Application Insights for WordPress sites

Hello friends!

I just wrapped up connecting my blog over here which is a WordPress site to Application Insights on Microsoft Azure. I thought I’d share with you how it’s done.

First, a brief into about Application Insights for those who don’t know what it is. In short, Visual Studio Application Insights (previously Application Insights) is a cloud-based service from Microsoft Azure that allows you to analyze performance and usage of your web apps hosted on Azure or on your own IIS or J2EE servers. Some of the features are:

  • Detect and diagnose issues, monitor load and discover usage patterns
  • Easily diagnose exceptions and web app performance issues
  • Perform root cause analysis with ad-hoc queries and full-text search
  • Integrate with DevOps processes using Visual Studio Team Services
  • Monitor web apps hosted on Azure, other cloud services, or on-premises servers

It’s very easy to set it up, you install a small instrumentation package in your application, and set up an Application Insights resource in the Microsoft Azure portal. The instrumentation monitors your app and sends telemetry data to the portal. The portal shows you statistical charts and provides powerful search tools to help you diagnose any problems.

From the Plugin Directory at WordPress.org you will find the Application Insights plugin.

This Plugin basically integrates a WordPress site with Microsoft Application Insights. The plugin uses the Application Insights PHP SDK to send site data to Azure. The installation part is straightforward in the following 3 steps:

  1. Upload all files to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. On your WordPress site, go to Settings -> Application Insights and enter the Instrumentation Key you received from http://portal.azure.com (Application Insights -> [App Insights Name] – Properties)
  4. Start monitoring the stats in the Azure portal!

Application Insights gathers a huge amount of interesting statistics and data, some of which is similar to what tools like Google Analytics provide and some are even more granular and helpful to web developers. The features of the service also include Performance and availability testing and a favorite of mine called Application Map which is a visual layout of the dependency relationships of your application components. Each component shows KPIs such as load, performance, failures, and alerts, to help you discover any component causing a performance issue or failure.

Happy monitoring 🙂

 

Posted in Microsoft Azure