Data! Data! Data! I can’t make bricks without clay!
Sir Arthur Conan Doyle

I like gathering data of all kind. Financial, personal and technical one. But gathering data just for the sake of doing it makes no sense. We need to analyse it. There are tools for all kind of data gathering and post-processing but I always like to take a peek what’s new and shiny (though it doesn’t mean I rush to using it in production).

AppInsights

A few weeks ago I’ve watched a NDC talk about Application Insights. I wasn’t aware that there’s a new tool for data gathering & analysis so I’ve decided to give it a try. Let’s see what can we do with it.

Installation & Usage

Since it’s a Microsoft tool you get it even if you don’t want to :). The option to install AppInsights is checked by default when you create ASP.NET project. So you can opt-out if like AppInsightsbut you start with it. After you connect to your MSDN account

Screen Shot 2016-09-05 at 21.38.52

you can select to which Application Insights resource the data will be send to. The packages are added from NuGet as all the othere dependencies these days. All the necessary option you can also find in the project context menu:

Screen Shot 2016-09-05 at 21.48.00

We know how to add the necessary dependencies to our project. What next then? Just start gathering data. And actually that’s true – it’s ready to collect all the data. You don’t have to do much more to be fully data-aware. You can even browse the dat directly in Visual Studio during the debug session. Neat!

Screen Shot 2016-09-05 at 21.55.20

If you check ‘Telemetry Readiness’ progress you can enable more data to be gathered.

Screen Shot 2016-09-05 at 21.56.22

Visual Studio gives you nice ‘Enable-this’ buttons to drive you by hand to full data-awarness 🙂 If you are not the wizard kind of type, you can do the same (and probably even more) by editing ApplicationInsights.config and/or web.config.

It’s not any trickier if you have a working project. Start with selecting ‘Add Application Insights Telemetry…’ from the context menu.

Screen Shot 2016-09-07 at 06.38.45
Then follow a white rabbit…ekhm wizard. When it’s done – you have already enabled telemetry in your project. Just one thing – o monitor JS requests – you need to add a simple script, one like you add for Google Analytics into your template page or somewhere where it would get executed on every page.

Screen Shot 2016-09-07 at 06.38.45

Monitoring

Of course if you monitor your production environment you will not check the data from VS. For that you can go to Azure Web Portal and check it there.

Screen Shot 2016-09-05 at 22.16.31

Just select Application Insights from ‘More services’ menu or star it to have it available on the sidebar. After you select your application – all the data will be visible on nice charts.

Screen Shot 2016-09-05 at 22.17.07

There’s a lot of options to browse through in the Azure Web – nice for every data nerd like me. To help you remember about your gathered telemetry, each week you get a nice email (you can opt-out) with the summary. You can check all the important info from there – if there’s not enough you can always go and browse through via Azure Web Portal.

Screen Shot 2016-09-05 at 21.44.03

So to answer the question from the title? Do you need it? If you don’t gather any data about your website – yes, you need it. If you already have an alternative solution then just keep using it. Just consider Application Insights in your next project.

There’s also a tutorial from MS how to start using it – you can find it here.
Happy data gathering!