Profile production applications in Azure with Application Insights Profiler

Diagnosing performance issues can be difficult, especially when your application is running on a production environment in the cloud. The cloud is dynamic. Machines come and go, and user input and other conditions are constantly changing. There's also potential for high scale. Slow responses in your application could be caused by infrastructure, framework, or application code handling the request in the pipeline.

With Application Insights Profiler, you can capture and view performance traces for your application in all these dynamic situations. The process occurs automatically at scale and doesn't negatively affect your users. Profiler captures the following information so that you can easily identify performance issues while your app is running in Azure:

  • Identifies the median, fastest, and slowest response times for each web request made by your customers.
  • Helps you identify the "hot" code path spending the most time handling a particular web request.

Enable the Profiler on all your Azure applications to catch issues early and prevent your customers from being widely affected. When you enable Profiler, it gathers data with these triggers:

  • Sampling trigger: Starts Profiler randomly about once an hour for two minutes.
  • CPU trigger: Starts Profiler when the CPU usage percentage is over 80 percent.
  • Memory trigger: Starts Profiler when memory usage is above 80 percent.

Each of these triggers can be configured, enabled, or disabled on the Configure Profiler page.

Overhead and sampling algorithm

Profiler randomly runs two minutes per hour on each virtual machine hosting the application with Profiler enabled for capturing traces. When Profiler is running, it adds from 5 percent to 15 percent CPU overhead to the server.

Supported in Profiler

Profiler works with .NET applications deployed on the following Azure services. View specific instructions for enabling Profiler for each service type in the following links.

Compute platform .NET (>= 4.6) .NET Core Java
Azure App Service Yes Yes No
Azure Virtual Machines and Virtual Machine Scale Sets for Windows Yes Yes No
Azure Virtual Machines and Virtual Machine Scale Sets for Linux No Yes No
Azure Cloud Services Yes Yes N/A
Azure Container Instances for Windows No Yes No
Azure Container Instances for Linux No Yes No
Kubernetes No Yes No
Azure Functions Yes Yes No
Azure Spring Cloud N/A No No
Azure Service Fabric Yes Yes No

If you've enabled Profiler but aren't seeing traces, see the Troubleshooting guide.

Limitations

  • Data retention: The default data retention period is five days.
  • Profiling web apps:
    • Although you can use Profiler at no extra cost, your web app must be hosted in the basic tier of the Web Apps feature of Azure App Service, at minimum.
    • You can attach only one profiler to each web app.

Next steps

Learn how to enable Profiler on your Azure service: