Graduate Program KB

Application Insights

  • Extension of Azure Monitor and provides Application Performance Monitoring features
  • Allows you to understand how an app is performing and reactively review app execution data to determine cause of incident
  • Describe app activities and health, collect and store application trace logging data
  • Features:
    • Live metrics: Observe activity from your deployed app in real time
    • Availability: Known as Synthetic Transaction Monitoring, probe your apps external endpoints to test availability and responsiveness
    • GitHub or Azure DevOps integration: Create GitHub / Azure DevOps work items in context of Application Insights data
    • Usage: Show popular features amongst users
    • Smart detection: Automatic failure and anomaly detection through proactive telemetry analysis
    • Application map: A high level top-down view of the app architecture
    • Distributed tracing: Search and visualise an end-to-end flow of a given execution or transaction
  • What it monitors:
    • Request rates, response times and failure rates: Find popular pages at certain times of day and location of users
    • Dependency rates, response times and failure rates: Find whether external services are slowing you down
    • Exceptions: Analyse aggregated statistics
    • Page views and load performance: Reported by users' browsers
    • AJAX calls: Rates, response times and failure rates from web pages
    • User and session counts
    • Performance counters: CPU, memory and network usage from Windows or Linux machines
    • Host diagnostics: Docker or Azure
    • Diagnostic trace logs: Correlate trace events with requests from your app
    • Custom events and metrics: Produced in client or server code to track business events such as items sold or games won

Log-based Metrics

  • Log-based metrics are translated into Kusto queries from stored events
    • More dimensions, superior option for data analysis and ad-hoc diagnostics
  • Standard metrics are stored as pre-aggregated time series
    • Better performance at query time, useful for dashboarding and real-time alerting

Instrument an App for Monitoring

  • Two methods for enabling an app to capture telemetry:
    • Automatic instrumentation: Enabled through configuration with touching the app's code, easiest way to enable Azure Monitor Application Insights
    • Manual instrumentation: Coding against the Application Insights or OpenTelemetry API, will need to manage updates to the packages
  • Enabling via Application Insights SDK
    • Only need the SDK when requiring custom events/metrics, control over flow of telemetry or auto-instrumentation is not available
    • Instrumentation monitors app and directs telemetry data to an Application Insights resource by using a unique token
  • Can also enable via OpenTelemetry, which is a combination of the OpenCensus and OpenTracing projects

Availability Test

  • Can set recurring tests to monitor availability and responsiveness after deploying your app
  • Can create up to 100 tests per Application Insights resource
    • Standard test: Checks website availability via single request
    • Custom TrackAvailability test: Use the TrackAvailability() method to send results to Application Insights if you create a custom app to run availability tests
    • URL ping test: Create test through portal to validate endpoint responsiveness and measure its performance

Troubleshooting Performance Using Application Map

  • Helps sport performance bottlenecks or failure hotspots across all components of your distributed application
  • Each node on the map represents an app component or its dependencies, it has a health key performance indicator and alerts status
  • Components:
    • Different from observed external dependencies (SQL, Event Hubs, etc.) which your team might not have access to code or telemetry
    • Run on any number of server/role/container instances
    • Separate Application Insights instrumentation key