Today I decided to spend some time fooling around with application insights. This feature in Azure (currently in preview) has the promise to give developers a large capability for adding telemetry data in order to detect issues, solve problems, and get an overall feel for how the application is being used.
There are two steps to add Application Insights to your project. Firstly (if it is an existing project) you have to right click on the web project (not the solution) and click on "Add Application Insights". Once this is done, it will add an ApplicationInsights.config to your project. You can read more about how to enable this capability for your app here
The config file looks something like the following:
The most important part of this file is the instrumentation key. When you enable this feature, you walk through a wizard that helps you select the subscription and Application Insights instance (or create a new one) that you want to use. If you ever need to change this key, you can do so by right-clicking on the config file and selecting update.
That takes care of adding basic capabilities server side. If you want to capture client side telemetry, you need to add a piece of javascript to all your pages.
Here are some of my thoughts so far:
1) I wonder about the overall security of this
The instrumentation key that uniquely identifies your account is present in the javascript that is sent to clients. With this, you can definitely create bad data that is passed from client to the Application Insights. Full disclosure is that I was able to do this with Google Analytics as well, so this problem isn't unique to this implementation. What I wonder is if you could do something malicious server side. I seem to remember reading that Visual Studio will only send up telemetry information if the account you use to sign in with has permission to do so. I wonder if this extends to where the application is deployed, etc. This is something that I want to try out, but haven't had time to do so.
2) Man on man, where is the documentation?
As usual, this product is an evolution from an older product named the same and providing the same functionality. There is no clear understanding of with documentation is valid for what? Is there some cross? Or is all the old documentation OLD and the new, new? I understand that this feature is still in preview, but it seems lacking for any real examples.
3) Dev, test, stage, what??
As mentioned earlier, the instrumentation key is what is used to identity the Application Insights instance that receives the telemetry. This key is the same for all environments you deploy to. While you can change this in code, I am struggling to find the "right" or "ideal" way to do this. One piece of documentation that I did find seem to suggest that you could change various properties in the telemetry context. One of them was a key for AppVersion.
As you can see from the screenshot above, I set both the Environment and the AppVersion property. I went into diagnostic search, clicked on filter, and tried to filter by the AppVersion that I had set. Here is what I see.
Sooo, nada. There are other properties I can filter on, such as url host, that might give me what I want, but it still isn't perfect. If you notice from the code above, I also set the "Environment" property. That one DOES come up in search, but no where else that I can filter by and maybe create a pre-canned report.
Maybe I am just missing the point, or how to do this properly. It still leaves a bunch to be desired.
4) Hello Dashboards... not!
Truth be told, I was excited to see how I could slice and dice this data. At this point, I'm not impressed. Maybe it is just that the experience provided by the portal is not to my liking. It probably works for a bunch of other people.
As far as I can tell, there is no way to customize the top level dashboard. You can click on elements in there, and once you are at either the Metrics Search or the Diagnostics search, you can "add charts" but this doesn't seem to be what I'm looking for.
I like to see the data raw, and consistently that capability seems to be taken away and replaced by a clunky workflow of opening panels and closing them.
There doesn't seem to be an easy way to export this data. Furthermore, other properties are hidden by the ... that when you click on opens yet another panel. Just take a look at how exceptions are displayed.
It's super hard to read and debug and the panel switching frankly makes me dizzy.
5) Key data pieces missing for the website I have deployed
One area of the Application Insights metrics seems to have performance monitoring metrics such as processor time and available memory. I'm hoping in the future we can add to this (it seems like from the forums some people have figured this out, but I'm not one of them). Furthermore, it doesn't seem to report anything for my website. I'm on a shared plan, so maybe that has something to do with it. I want to experiment more with this to actually get useful data.
In conclusion, I think this capability is going to be great, but right now it leaves something to be desired. I'm not ruling out that it might just be my current knowledge of how it works, but some official published documentation would be a great start to increasing my understanding. If only....