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

32

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

Page 1: Using microsoft application insights to implement a build, measure, learn loop
Page 2: Using microsoft application insights to implement a build, measure, learn loop

Using Microsoft Application

Insights to Implement a

Build, Measure, Learn Loop

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

About me: Marcel de [email protected]

@marcelv

http://fluentbytes.comXpirit

Also regional director

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

Agenda

• Context for application insights & continuous delivery

• Application Insights– Availability– Performance– Usage– Diagnostics

• Conclusion

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

Daily Forces and the Road to Continuous X

Development teams work using

agile methodologies

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

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

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

Optimized processes

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

Keep machines and infra as stable as possible

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

Continuous Delivery

Continuous

Build

Continuous

Test

Continuous

Deploy

Continuous Learning

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

Continuous delivery cycle

9

?

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

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

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

Getting visibility

?Is my application available?

Is my application performing?

Is my application succeeding?

What happened when things failed?

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

Application Insights

Performance UsageAvailability Diagnostics

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

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

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

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

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

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

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

Adding telemetry & analytics

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

Typical flow with an SDK

Create account @provider portal

Providerbackend

See results onprovider dashboard

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

DEMOGetting Started with Application Insights

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

Performance

• Client performance

• Server performance

• Performance counters

– You can add your owncounters via config

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

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

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

DEMOAdding performance and diagnostics

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

• 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);

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

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:

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

DEMOAdd custom events using SDK’s

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

Availability

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

• Check the availability of your website

• Simple: Single URL

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

Synthetic monitors

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

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

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

DEMOSet up Multistep Synthetic monitor

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

Application Insights

MVP

Build

Measure

Learn!

Optimize on building the right thing right

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

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

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

Further reading & Help

Xpirit Magazine in your TechDaysbag

http://fluentbytes.com

@marcelv

[email protected]