deep-dive to application insights

Post on 15-Apr-2017

555 Views

Category:

Software

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Application Insights Deep Dive

Gunnars PeipmansASP.NET/IIS MVP

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

Introduction to apps telemetry

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

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

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

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

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

Pricing tiers

* check for discounts and promo offerings

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

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

Demos

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

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

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

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

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

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

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

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

• Needs custom code

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

Adding continuous export

Exported files on Azure Blob Storage

Contents of telemetry file

Getting telemetry data to Power BI

Application Insights Blob Storage Stream

Analytis Power BI

Stream analytics

Read data from input sources Aggregate data Save data to

output sources

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)

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

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

Thanks, techies

top related