360 likes | 374 Views
Microsoft Ignite NZ. 25-28 October 2016 SKYCITY, Auckland. Insights into App Insights - putting the awesome back into analytics. Soon Wong, Technical Specialist Team Lead Provoke Solutions https://www.linkedin.com/in/soon-wong-0937a933. M386. Get involved!. http://bit.ly/ignite2016demo.
E N D
Microsoft Ignite NZ 25-28 October 2016 SKYCITY, Auckland
Insights into App Insights - putting the awesome back into analytics Soon Wong, Technical Specialist Team Lead Provoke Solutions https://www.linkedin.com/in/soon-wong-0937a933 M386
Get involved! http://bit.ly/ignite2016demo
Overview Intro TLDR Application Insights Bolting it on – code demo Making sense of it all – azure demo Question time
Don’t be a dinosaur. Application Insights will add awesomeness to your analytics.
Application Insights Telemetry collection • Diagnostic traces • Exceptions • Custom telemetry • Javascript too! Analytics Proactive alerts • Availability • Proactive diagnostics • Dashboarding • Interactive drill down • Power BI • Metric rules
The hierarchy Typical Azure Web app stack ASP.NET MVC web application, hosted in Azure ASP.NET WebAPI web application, hosted in Azure Azure SQL Storage Logging frameworks Log4Net for ASP.NET backend Does anyone log Javascript?
Useful tips Change your Instrumentation Key Don’t leave it hard coded in ApplicationInsights.config // C# (global.asax.cs) Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration.Active.InstrumentationKey = ConfigurationManager.AppSettings["AppInsightsInstrumentationKey"]; // Javascript (_layout.cshtml) varappInsights = window.appInsights || function (config) { function r(config) { t[config] = function () { vari = arguments … … … … }({ instrumentationKey: window.yournamespace.appInsightsInstrumentationKey });
Useful tips Define your user Javascript Unless your users demand anonymity // Javascript: Initialise tracking client appInsights.setAuthenticatedUserContext("johndoe.ignitenz2016"); appInsights.trackPageView();
Useful tips Use Logging tools that you know and trust Don’t write your own… if you don’t have to. NLog: https://www.nuget.org/packages/Microsoft.ApplicationInsights.NLogTarget Log4Net: https://www.nuget.org/packages/Microsoft.ApplicationInsights.Log4NetAppender/ Elmah: https://www.nuget.org/packages/Elmah.ApplicationInsights/
Useful tips Go full custom if needed If you want control, go and bespoke it • // C# • // Set up some metadata • var properties = new Dictionary <string, string> { • {"environment", "UAT"}, • {"server", "ignitenz2016.azurewebsites.net"} • }; • var metrics = new Dictionary <string, double> { • {"QuestionsAnswered", 5}, • {"QuestionsPassed", 4} • }; • // Send • private TelemetryClient client = new TelemetryClient(); • client.TrackEvent("BespokeEvent", properties, metrics);
Added awesomeness Dashboarding Don’t forget to share it!
Added awesomeness Investigate Interactive drill downs
Added awesomeness Investigate Can’t find the cause? Maybe there’s a trend?
Added awesomeness Power BI it Can’t find a graph? Make it.
Added awesomeness Proactive detection Stay informed
Added awesomeness Proactive detection Stay informed
Gotcha! Watch out for that spam Be sure to configure rules in Azure
Gotcha! When 5 million is not enough Application Insights will stop recording any telemetry until the calendar month rolls over Your application will continue to run, just without logging enabled
Gotcha! When 7 days of raw data is not enough Application Insights will discard telemetry after 7 days, but will retain the respective data metrics Use Continuous Export to pipe telemetry to a separate data store (e.g. Azure SQL)
Don’t be a dinosaur. Use Application Insights today to add awesomeness to your analytics
Additional resources and references Application Insights documentation https://azure.microsoft.com/en-us/documentation/services/application-insights/ https://azure.microsoft.com/en-us/documentation/articles/app-insights-overview/ Soon Wong – Me! https://www.linkedin.com/in/soon-wong-0937a933