Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Deep-Dive to Application Insights

1,009 views

Published on

This presentation is row of demos that introduce how to use Application Insights, how it works and how to build your own application telemetry on top of it. Two surprise demos show audience some case studies how to use Application Insights to plan hosting of global web site and how to support sales and logistics departments in real-time.

Published in: Software
  • Be the first to comment

  • Be the first to like this

Deep-Dive to Application Insights

  1. 1. Application Insights Deep Dive Gunnars Peipmans ASP.NET/IIS MVP
  2. 2. Agenda • Introduction to applications telemetry • Introduction to Application Insights • Demos, demos, demos
  3. 3. Introduction to apps telemetry
  4. 4. 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
  5. 5. 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
  6. 6. 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
  7. 7. Application Insights
  8. 8. 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
  9. 9. Supported applications • Web applications • Mobile and tablet apps • Desktop programs • Middleware services • Single page applications • Platform independent
  10. 10. Pricing tiers * check for discounts and promo offerings
  11. 11. Limitations • Service is currently going through upgrade • Not very real-time yet • Sometimes long delays • No server metrics on CoreCLR
  12. 12. 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
  13. 13. Demos
  14. 14. Client-side telemetry • Configure your application to use Application Insights • Add Application Insights middleware to startup • Call HTML extension method on layout page
  15. 15. Server-side telemetry • Requests and exceptions monitoring comes out-of-box • Code is needed for: • Dependency tracking • Metrics tracking • Events tracking
  16. 16. 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
  17. 17. 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
  18. 18. 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
  19. 19. Site availability • Define web tests to ping • Visual Studio web tests are also supported • Ping from different countries • Get alerts to e-mail
  20. 20. Alerts • Define conditions on metrics • Set problem interval • Set e-mail address
  21. 21. Custom events • Define your own events • Supported metadata: • Textual properties • Numerical properties • Needs custom code
  22. 22. Continuous export • Supported with Standard ja Premium editions of service • Sends telemetry data to Azure Blob Storage • Files in JSON format
  23. 23. Adding continuous export
  24. 24. Exported files on Azure Blob Storage
  25. 25. Contents of telemetry file
  26. 26. Getting telemetry data to Power BI Application Insights Blob Storage Stream Analytis Power BI
  27. 27. Stream analytics Read data from input sources Aggregate data Save data to output sources
  28. 28. Our analytic query SELECT 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)
  29. 29. Power BI • (Soon to be) very powerful online reporting environment • Supports different data sources • Quickly build reports and dashboards • Share your work with colleagues
  30. 30. 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
  31. 31. Thanks, techies 

×