แก้ไข

แชร์ผ่าน


Failures and performance views

Application Insights collects telemetry from your application to help diagnosing failures and investigating slow transactions. It includes two essential tools:

  • The Failures experience, which tracks errors, exceptions, and faults, offering clear insights for fast problem-solving and enhanced stability.

  • The Performance experience, which quickly identifies and helps resolve application bottlenecks by displaying response times and operation counts.

Together, these tools ensure the ongoing health and efficiency of web applications. You can use them to pinpoint issues or enhancements that would have the most impact on users.

To get to the Failures view in Application Insights, select either the Failed requests graph on the Overview pane, or Failures under the Investigate category in the resource menu.

Screenshot showing how to reach the 'Failures' view in Application Insights.

You can also get to the failures view from the Application Map by selecting a resource, then Investigate failures from the triage section.

Overview

The Failures view shows a list of all failed operations collected for your application with the option to drill into each one. It lets you view their frequency and the number of users affected, to help you focus your efforts on the issues with the highest impact.

Screenshot showing the 'Failures' view in Application Insights.

Investigate

To investigate the root cause of an error or exception, you can drill into the problematic operation for a detailed end-to-end transaction details view that includes dependencies and exception details.

  1. Select an operation to view the Top 3 response codes, Top 3 exception types, and Top 3 failed dependencies for that operation.

  2. Under Drill into, select the button with the number of filtered results to view a list of sample operations.

  3. Select a sample operation to open the End-to-end transaction details view.

    Screenshot showing the 'Failures' view with the 'Drill into' button highlighted.

    Note

    The Suggested samples have related telemetry from all components, even if sampling was in effect in any of them.

End-to-end transaction details

The End-to-end transaction details view shows a Gantt chart of the transaction, which lists all events with their duration and response code. Selecting a specific event reveals its properties, including additional information like the underlying command or call stack.

Screenshot showing the 'End-to-end transaction details' view.

Debug Snapshot

To see code-level debug information of an exception:

  1. Select the exception in the Gantt chart, then Open debug snapshot.

    Screenshot showing the 'End-to-end transaction details' view with the 'Open debug snapshot' button highlighted.

  2. Snapshot Debugger shows the call stack and allows you to inspect variables at each call stack frame. By selecting a method, you can view the values of all local variables at the time of the request.

  3. Afterwards, you can debug the source code by downloading the snapshot and opening it in Visual Studio.

    Screenshot showing Snapshot Debugger with the 'Download Snapshot' button highlighted.

Create a work item

If you connect Application Insights to a tracking system such as Azure DevOps or GitHub, you can create a work item directly from Application Insights.

  1. Select Create work item and create a new template or pick an existing one.

    Screenshot showing the 'End-to-end transaction details' view with the 'Create work item' button highlighted.

  2. The New Work Item pane opens with details about the exception already populated. You can add more information before you save it.

Use analytics data

All data collected by Application Insights is stored in Log Analytics, which provides a rich query language to analyze the requests that generated the exception you're investigating.

Tip

Simple mode in Log Analytics offers an intuitive point-and-click interface for analyzing and visualizing log data.

  1. On either the performance or failures view, select View in Logs in the top navigation bar and pick a query from the dropdown menu.

    Screenshot of the top action bar with the 'View in logs' button highlighted.

  2. This takes you to the Logs view, where you can further modify the query or select a different one from the sidebar.

    Screenshot showing the 'Logs' view.

Profiler traces

The .NET Profiler helps get further with code-level diagnostics by showing the actual code that ran for the operation and the time required for each step. Some operations might not have a trace because the Profiler runs periodically. Over time, more operations should have traces.

  1. To start .NET Profiler, select an operation on the Performance view, then go to Profiler traces.

    Screenshot of the 'Performance' view with the 'Profiler traces' button highlighted.

    Alternatively, you can do so on the end-to-end transaction details view.

    Screenshot showing the 'End-to-end transaction details' view with the 'Profiler traces' button highlighted.

  2. The trace shows the individual events for each operation so that you can diagnose the root cause for the duration of the overall operation. Select one of the top examples that has the longest duration.

  3. Select the link in the Performance Tip (in this example, CPU time) for documentation on interpreting the event.

  4. For further analysis, select Download Trace to download the trace. You can view this data by using PerfView.

    Screenshot showing .NET Profiler.

    Note

    Hot path is selected by default. It highlights the specific path of events that contribute to the issue you're investigating, indicated by the flame icon next the event name.

Analyze client-side performance and failures

If you instrument your web pages with Application Insights, you can gain visibility into page views, browser operations, and dependencies. Collecting this browser data requires adding a script to your web pages.

  1. After you add the script, you can access page views and their associated performance metrics by selecting the Browser toggle on the Performance or Failures view.

    Screenshot highlighting the 'Server / Browser' toggle below the top action bar.

    This view provides a visual summary of various telemetries of your application from the perspective of the browser.

  2. For browser operations, the end-to-end transaction details view shows Page View Properties of the client requesting the page, including the type of browser and its location. This information can assist in determining whether there are performance issues related to particular types of clients.

    Screenshot showing the 'End-to-end transaction details' view with the 'Page View Properties' section highlighted.

Note

Like the data collected for server performance, Application Insights makes all client data available for deep analysis by using logs.

Next steps

  • Learn more about using Application Map to spot performance bottlenecks and failure hotspots across all components of your application.
  • Learn more about using the Availability view to set up recurring tests to monitor availability and responsiveness for your application.