Using microsoft application insights to implement a build, measure, learn loop

Post on 28-Jul-2015

633 views 0 download

Transcript of Using microsoft application insights to implement a build, measure, learn loop

Using Microsoft Application

Insights to Implement a

Build, Measure, Learn Loop

About me: Marcel de Vriesmdevries@xpirit.com

@marcelv

http://fluentbytes.comXpirit

Also regional director

Agenda

• Context for application insights & continuous delivery

• Application Insights– Availability– Performance– Usage– Diagnostics

• Conclusion

Daily Forces and the Road to Continuous X

Development teams work using

agile methodologies

Minimal Viable Product• Build a minimal feature and measure it’s

usage

• Add metrics to learn if it’s usefulto invest further

• Are our assertions correct?

– Set up experiments to learn

– Use telemetry data to validate assumptions

Optimized processes

Deliver MVP’s so we can learn what customer really needs

Keep machines and infra as stable as possible

Continuous Delivery

Continuous

Build

Continuous

Test

Continuous

Deploy

Continuous Learning

Continuous delivery cycle

9

?

“9 out of 10 times, we are flying blind”

Getting visibility

?Is my application available?

Is my application performing?

Is my application succeeding?

What happened when things failed?

Application Insights

Performance UsageAvailability Diagnostics

Questions lead to telemetry design

What user actionsare meaningful to yourapp’s business goals?

What telemetry datawill accurately track

those actions and answeryour business questions?

Note: this is different from logging used during development

Events express telemetry design

• High-level, human readable verbs– Typical apps track about 30 statically-named events

• Give actionable insight into user behavior:– Example: Log what content is tapped, not the taps

• Properties/attributes for events provide second-tier data for charting and analytics– Example: A “resized view” event has attributes for the new

size– Best practice: “bucket” numerical attributes into ranges

Typical Events

• App start, exit, suspend, resume

• Registration, log in, log off

• Settings changes

• Content sharing: Share charm, share to Facebook/Twitter

• In-app purchases or conversion from trial to paid app

• Error (recoverable), exception (non-recoverable)

• Media/Content apps: view, save, favorite, commented

• Commerce apps: item viewed, category viewed, search, filter, barcode scan, wish list add, item rated, add to cart, begin/complete/abandon checkout, find store, call number

• Social apps: friend invited, invitation accepted

Adding telemetry & analytics

Typical flow with an SDK

Create account @provider portal

Providerbackend

See results onprovider dashboard

DEMOGetting Started with Application Insights

Performance

• Client performance

• Server performance

• Performance counters

– You can add your owncounters via config

Diagnostics

• App insigths diagnostics help you figure out what happened around a particular issue

• Find the events in the app insights portal

• Drill down in to events surrounding the issue

DEMOAdding performance and diagnostics

• Page views

• Events

– You can filter, search andgroup your data with properties

Adding Custom Data

// Set up some properties: var properties = new Dictionary <string, string> {{"game", currentGame.Name}, {"difficulty", currentGame.Difficulty}}; var metrics = new Dictionary <string, double> {{"Score", currentGame.Score},

{"Opponents", currentGame.OpponentCount}};// Send the event:telemetry.TrackEvent("WinGame", properties, metrics);

Adding Custom Data

appInsights.trackPageView("tab1");

telemetry.TrackPageView("GameReviewPage");

// At the start of a page view: appInsights.startTrackPage(“PageName");// At the completion of a page view:

appInsights.stopTrackPage(“PageName","http://fabrikam.com/page", properties, measurements);

JavaScript:

C#

JavaScript:

DEMOAdd custom events using SDK’s

Availability

• Check the availability of your website

• Simple: Single URL

• Complex: Upload a web test that represents actual usage of your site

Synthetic monitors

Use of Web Test

• Set up a set of web tests to test performance of your public facing app– Soap Services via Proxy & Unit test– Web Pages

• Create Load test with mix of tests representing application usage

• Run in the cloud, by connecting to your VSO account in team explorer– Flip the switch & Run

DEMOSet up Multistep Synthetic monitor

Application Insights

MVP

Build

Measure

Learn!

Optimize on building the right thing right

Summary

• Add Application Diagnostics, Usage, Performance and Availability metrics to your application

• Data is send to your Visual Studio Online Account• Monitoring agent for Perf & Diagnostics• Instrument your application for Usage info

– Add custom C# or JavaScript to send the data

• App insights can be used in load test scenario’s to get performance info– And get more complex availability monitoring data with web tests

Further reading & Help

Xpirit Magazine in your TechDaysbag

http://fluentbytes.com

@marcelv

mdevries@Xpirit.com