Bilješka
Pristup ovoj stranici zahtijeva provjeru vjerodostojnosti. Možete pokušati da se prijavite ili promijenite direktorije.
Pristup ovoj stranici zahtijeva provjeru vjerodostojnosti. Možete pokušati promijeniti direktorije.
Application Insights Profiler for .NET captures traces that show which lines of code take the most time to run while your application handles real production traffic. As a Service Fabric developer, you use these traces to pinpoint the performance bottlenecks that slow your application in production, without reproducing the problem in a test environment.
Azure Diagnostics includes the Profiler. To collect traces from an Azure Service Fabric cluster, you install the Azure Diagnostics extension by using an Azure Resource Manager template (ARM template).
In this guide, you learn how to:
- Add the Application Insights Profiler for .NET property to your ARM template.
- Deploy your Service Fabric cluster with the Application Insights Profiler for .NET connection string.
- Enable Application Insights on your Service Fabric application.
- Redeploy your Service Fabric cluster to enable the .NET Profiler.
Prerequisites
The Profiler supports .NET Framework and .NET applications.
- Verify you're using .NET Framework 4.6.2 or later.
- Confirm that the deployed OS is
Windows Server 2012 R2or later.
Create a deployment template
In your Service Fabric managed cluster, go to where you implemented the ARM template.
Locate the
WadCfgtags in the Azure Diagnostics extension in the deployment template file.Add the following
SinksConfigsection as a child element ofWadCfg. Replace theApplicationInsightsProfilerproperty value with your own Application Insights connection string:"settings": { "WadCfg": { "SinksConfig": { "Sink": [ { "name": "MyApplicationInsightsProfilerSinkVMSS", "ApplicationInsightsProfiler": "YOUR_APPLICATION_INSIGHTS_CONNECTION_STRING" } ] } } }For information about how to add the Diagnostics extension to your deployment template, see Use monitoring and diagnostics with a Windows VM.
Deploy your Service Fabric cluster
After you update the WadCfg configuration with your Application Insights connection string, deploy your Service Fabric cluster.
Application Insights Profiler for .NET is installed and enabled automatically when you install the Azure Diagnostics extension on the cluster.
Enable Application Insights on your Service Fabric application
For the .NET Profiler to collect profiles for your requests, your Service Fabric application must track operations with Application Insights. Choose the option that matches your application type:
- For stateless APIs: See Write code to track requests with Application Insights Profiler.
- For tracking custom operations in other kinds of apps: See Monitor .NET and Node.js applications.
After you enable Application Insights, redeploy your application.
Generate traffic and view the .NET Profiler traces
- Launch an availability test to generate traffic to your application.
- Wait 10 to 15 minutes for the traces to reach the Application Insights instance.
- View the Profiler traces by using the Application Insights instance in the Azure portal.