In my last blog post, I talked about installing the Visual Studio Application Insights monitoring agent.
That’s all very nice. But you don’t actually gain much by just installing the agent. You need to tell it what to monitor. This post describes how to do that.
If you have web applications running in IIS, and you want to monitor their performance, you are pretty much all set by simply installing the monitoring agent, and adding a single config file to your project. The config file ApplicationInsights.config lets the monitoring agent know that you want this web application monitored, and it allows you to configure some settings about what you want monitored.
The actual contents of the config file and its format is documented on MSDN in the article Customizing Application Insights in ApplicationInsights.config. The documentation is not great; remember that Application Insights is still in preview.
You can get the Visual Studio Application Insights portal to generate a config file for you. You should do that, and then customize it if you need. You need to create a new application for Application Insights anyway, and during that process you can download the config file.
Simply add it to your web application folder on the server, restart the “Microsoft Monitoring Agent” service, and it will be picked up and monitoring will begin.
Note that it may take 5-15 minutes before data shows up. You can use the “Streaming Data” feature of Application Insights to verify the connection. With that, you can see almost real time when the application starts etc. For example from my development machine:
Streaming Data is enabled or disabled in ApplicationInsights.config with the <SendToRawStream> configuration element:
<SendToRawStream>true</SendToRawStream>
You should not have it enabled in your production environment. Actually, the default ApplicationInsights.config has two configuration profiles, one for Release build code and one for Debug build. The Debug build profile is called “Development”. SendToRawStream is only enabled that configuration profile.
At this point, you might ask: What is all this about? Why should I do all this work installing an agent on my production servers and adding cryptic configuration files to my project?
Part 3 of this series covers what you get.
Update
Part three in the series is now up. It describes what you get when monitoring your web application with Application Insights.