deep-dive to application insights
TRANSCRIPT
![Page 1: Deep-Dive to Application Insights](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/1.jpg)
Application Insights Deep Dive
Gunnars PeipmansASP.NET/IIS MVP
![Page 2: Deep-Dive to Application Insights](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/2.jpg)
Agenda• Introduction to applications telemetry• Introduction to Application Insights• Demos, demos, demos
![Page 3: Deep-Dive to Application Insights](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/3.jpg)
Introduction to apps telemetry
![Page 4: Deep-Dive to Application Insights](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/4.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/5.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/6.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/7.jpg)
Application Insights
![Page 8: Deep-Dive to Application Insights](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/8.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/9.jpg)
Supported applications• Web applications• Mobile and tablet apps• Desktop programs• Middleware services• Single page applications• Platform independent
![Page 10: Deep-Dive to Application Insights](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/10.jpg)
Pricing tiers
* check for discounts and promo offerings
![Page 11: Deep-Dive to Application Insights](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/11.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/12.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/13.jpg)
Demos
![Page 14: Deep-Dive to Application Insights](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/14.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/15.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/16.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/17.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/18.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/19.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/20.jpg)
Alerts• Define conditions on metrics• Set problem interval• Set e-mail address
![Page 21: Deep-Dive to Application Insights](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/21.jpg)
Custom events• Define your own events • Supported metadata:• Textual properties• Numerical properties
• Needs custom code
![Page 22: Deep-Dive to Application Insights](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/22.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/23.jpg)
Adding continuous export
![Page 24: Deep-Dive to Application Insights](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/24.jpg)
Exported files on Azure Blob Storage
![Page 25: Deep-Dive to Application Insights](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/25.jpg)
Contents of telemetry file
![Page 26: Deep-Dive to Application Insights](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/26.jpg)
Getting telemetry data to Power BI
Application Insights Blob Storage Stream
Analytis Power BI
![Page 27: Deep-Dive to Application Insights](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/27.jpg)
Stream analytics
Read data from input sources Aggregate data Save data to
output sources
![Page 28: Deep-Dive to Application Insights](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/28.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/29.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/30.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022070602/5879737d1a28ab37368b6c35/html5/thumbnails/31.jpg)
Thanks, techies