Configure Application Insights Profiler

To open the Azure Application Insights Profiler settings pane, select Performance from the left menu within your Application Insights page.

Link to open performance blade

View profiler traces across your Azure resources via two methods:

Profiler button

Select the Profiler button from the top menu.

Screenshot of the Profiler button from the Performance blade

By operation

  1. Select an operation from the Operation name list ("Overall" is highlighted by default).

  2. Select the Profiler traces button.

    Select operation and Profiler traces to view all profiler traces

  3. Select one of the requests from the list to the left.

  4. Select Configure Profiler.

    Overall selection and clicking Profiler traces to view all profiler traces

Once within the Profiler, you can configure and view the Profiler. The Application Insights Profiler page has these features:

Profiler page features and settings

Feature Description
Profile Now Starts profiling sessions for all apps that are linked to this instance of Application Insights.
Triggers Allows you to configure triggers that cause the profiler to run.
Recent profiling sessions Displays information about past profiling sessions, which you can sort using the filters at the top of the page.

Profile Now

Select Profile Now to start a profiling session on demand. When you click this link, all profiler agents that are sending data to this Application Insights instance will start to capture a profile. After 5 to 10 minutes, the profile session will show in the list below.

To manually trigger a profiler session, you'll need, at minimum, write access on your role for the Application Insights component. In most cases, you get write access automatically. If you're having issues, you'll need the "Application Insights Component Contributor" subscription scope role added. See more about role access control with Azure Monitoring.

Trigger Settings

Select the Triggers button on the menu bar to open the CPU, Memory, and Sampling trigger settings pane.

CPU or Memory triggers

You can set up a trigger to start profiling when the percentage of CPU or Memory use hits the level you set.

Screenshot of trigger settings pane for C P U and Memory triggers

Setting Description
On / Off Button On: profiler can be started by this trigger; Off: profiler won't be started by this trigger.
Memory threshold When this percentage of memory is in use, the profiler will be started.
Duration Sets the length of time the profiler will run when triggered.
Cooldown Sets the length of time the profiler will wait before checking for the memory or CPU usage again after it's triggered.

Sampling trigger

Unlike CPU or memory triggers, the Sampling trigger isn't triggered by an event. Instead, it's triggered randomly to get a truly random sample of your application's performance. You can:

  • Turn this trigger off to disable random sampling.
  • Set how often profiling will occur and the duration of the profiling session.

Screenshot of trigger settings pane for Sampling trigger

Setting Description
On / Off Button On: profiler can be started by this trigger; Off: profiler won't be started by this trigger.
Sample rate The rate at which the profiler can occur.
  • The Normal setting collects data 5% of the time, which is about 2 minutes per hour.
  • The High setting profiles 50% of the time.
  • The Maximum setting profiles 75% of the time.

Normal is recommended for production environments.
Duration Sets the length of time the profiler will run when triggered.

Recent Profiling Sessions

This section of the Profiler page displays recent profiling session information. A profiling session represents the time taken by the profiler agent while profiling one of the machines hosting your application. Open the profiles from a session by clicking on one of the rows. For each session, we show:

Setting Description
Triggered by How the session was started, either by a trigger, Profile Now, or default sampling.
App Name Name of the application that was profiled.
Machine Instance Name of the machine the profiler agent ran on.
Timestamp Time when the profile was captured.
Tracee Number of traces that were attached to individual requests.
CPU % Percentage of CPU that was being used while the profiler was running.
Memory % Percentage of memory that was being used while the profiler was running.

Next steps

Enable Profiler and view traces