deep-dive to application insights

31
Application Insights Deep Dive Gunnars Peipmans ASP.NET/IIS MVP

Upload: gunnar-peipman

Post on 15-Apr-2017

555 views

Category:

Software


1 download

TRANSCRIPT

Page 1: Deep-Dive to Application Insights

Application Insights Deep Dive

Gunnars PeipmansASP.NET/IIS MVP

Page 2: Deep-Dive to Application Insights

Agenda• Introduction to applications telemetry• Introduction to Application Insights• Demos, demos, demos

Page 3: Deep-Dive to Application Insights

Introduction to apps telemetry

Page 4: Deep-Dive to Application Insights

Why application monitoring?Find out:- what’s going on inside your application service- how your application is performing- how your application is used- what errors users face- events that need your reaction

Page 5: Deep-Dive to Application Insights

Is it better than log files?• Building good logging system is challenging task• Most of logging frameworks doesn’t provide analyzable logs• Access to logs may be difficult• Logs are not perfect fit for all telemetry

Page 6: Deep-Dive to Application Insights

Who is consuming telemetry data?• Developers: find bugs and performance bottle necks• Testers: discover areas thet need more testing• UX designers: find out how users are using applications• Administrators: get ready for load growth• Support: find problematic areas and be ready to support users • Business: see how sales and business operations are going

Page 7: Deep-Dive to Application Insights

Application Insights

Page 8: Deep-Dive to Application Insights

Application Insights features• Deep overview of application’s health• Usage, performance, errors analytics• Performance monitoring of external services• Custom events• Alerting• Reporting• Export data to other systems

Page 9: Deep-Dive to Application Insights

Supported applications• Web applications• Mobile and tablet apps• Desktop programs• Middleware services• Single page applications• Platform independent

Page 10: Deep-Dive to Application Insights

Pricing tiers

* check for discounts and promo offerings

Page 11: Deep-Dive to Application Insights

Limitations• Service is currently going through upgrade• Not very real-time yet• Sometimes long delays• No server metrics on CoreCLR

Page 12: Deep-Dive to Application Insights

Getting started• Create Azure account• Create Applications Insight service or let Visual Studio do it• Create web application in Visual Studio• Let Visual Studio set up Application Insights for application• Run your applicarion

Page 13: Deep-Dive to Application Insights

Demos

Page 14: Deep-Dive to Application Insights

Client-side telemetry• Configure your application to use Application Insights• Add Application Insights middleware to startup• Call HTML extension method on layout page

Page 15: Deep-Dive to Application Insights

Server-side telemetry• Requests and exceptions monitoring comes out-of-box• Code is needed for:• Dependency tracking• Metrics tracking• Events tracking

Page 16: Deep-Dive to Application Insights

TelemetryClient class• Main class used to communicate with

Application Insights service• On ASP.NET 5 use this class through

dependency injection• Send all tracking data to service using this class• Internally optimizes sending of requests to

lessen network traffic

Page 17: Deep-Dive to Application Insights

Tracking exceptions• Exceptions are also known as failed requests• Advanced error reports on Application Insights• Information includes stack traces• You can add custom data with exceptions• On CoreCLR we need some additional code for exception tracking

Page 18: Deep-Dive to Application Insights

Dependency tracking• Dependecies are calls to external systems and services• Some dependencies are tracked automatically• For external service errors we usually need additional code• We can also monitor dependencies performance

Page 19: Deep-Dive to Application Insights

Site availability• Define web tests to ping • Visual Studio web tests are also supported• Ping from different countries• Get alerts to e-mail

Page 20: Deep-Dive to Application Insights

Alerts• Define conditions on metrics• Set problem interval• Set e-mail address

Page 21: Deep-Dive to Application Insights

Custom events• Define your own events • Supported metadata:• Textual properties• Numerical properties

• Needs custom code

Page 22: Deep-Dive to Application Insights

Continuous export• Supported with Standard ja Premium editions of service• Sends telemetry data to Azure Blob Storage• Files in JSON format

Page 23: Deep-Dive to Application Insights

Adding continuous export

Page 24: Deep-Dive to Application Insights

Exported files on Azure Blob Storage

Page 25: Deep-Dive to Application Insights

Contents of telemetry file

Page 26: Deep-Dive to Application Insights

Getting telemetry data to Power BI

Application Insights Blob Storage Stream

Analytis Power BI

Page 27: Deep-Dive to Application Insights

Stream analytics

Read data from input sources Aggregate data Save data to

output sources

Page 28: Deep-Dive to Application Insights

Our analytic querySELECT GetRecordPropertyValue(GetArrayElement(context.custom.dimensions, 0), 'Product') as Product, GetRecordPropertyValue(GetArrayElement(context.custom.dimensions, 1), 'Manufacturer') as Manufacturer, GetRecordPropertyValue(GetArrayElement(context.custom.dimensions, 2), 'Location') as Location, GetRecordPropertyValue(GetArrayElement(context.custom.dimensions, 3), 'Country') as Country, SUM(GetRecordPropertyValue(GetRecordPropertyValue(GetArrayElement(context.custom.metrics, 0), 'Amount'), 'value')) as Amount, SUM(GetRecordPropertyValue(GetRecordPropertyValue(GetArrayElement(context.custom.metrics, 1), 'Total'), 'value')) as Total INTO [powerbi] FROM [beerstoreblob] A GROUP BY GetRecordPropertyValue(GetArrayElement(context.custom.dimensions, 0), 'Product'), GetRecordPropertyValue(GetArrayElement(context.custom.dimensions, 1), 'Manufacturer'), GetRecordPropertyValue(GetArrayElement(context.custom.dimensions, 2), 'Location'), GetRecordPropertyValue(GetArrayElement(context.custom.dimensions, 3), 'Country'), TumblingWindow(second, 10)

Page 29: Deep-Dive to Application Insights

Power BI• (Soon to be) very powerful online reporting environment• Supports different data sources• Quickly build reports and dashboards• Share your work with colleagues

Page 30: Deep-Dive to Application Insights

Wrapping up• Application Insights is easy to use telemetry service• Gives you a lot of useful information about your applications• Easy to set up and use• Works on every platform • Supports custom telemetry • Custom reporting• Share data to other systems

Page 31: Deep-Dive to Application Insights

Thanks, techies