Skip to content

Commit a2744e1

Browse files
Merge pull request #207384 from hhunter-ms/hh-1945416
[Profiler] Track requests freshness pass
2 parents 38b2b78 + b3d6958 commit a2744e1

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

articles/azure-monitor/profiler/profiler-trackrequests.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ title: Write code to track requests with Azure Application Insights | Microsoft
33
description: Write code to track requests with Application Insights so you can get profiles for your requests.
44
ms.topic: conceptual
55
ms.custom: devx-track-csharp
6-
ms.date: 08/06/2018
7-
ms.reviewer: jogrima
6+
ms.date: 08/09/2022
7+
ms.reviewer: charles.weininger
88
---
99

1010
# Write code to track requests with Application Insights
1111

12-
To view profiles for your application on the Performance page, Azure Application Insights needs to track requests for your application. Application Insights can automatically track requests for applications that are built on already-instrumented frameworks. Two examples are ASP.NET and ASP.NET Core.
12+
Azure Application Insights needs to track requests for your application in order to provide profiles for your application on the Performance page in the Azure portal.
1313

14-
For other applications, such as Azure Cloud Services worker roles and Service Fabric stateless APIs, you need to write code to tell Application Insights where your requests begin and end. After you've written this code, requests telemetry is sent to Application Insights. You can view the telemetry on the Performance page, and profiles are collected for those requests.
14+
For applications built on already-instrumented frameworks (like ASP.NET and ASP.NET Core)S, Application Insights can automatically track requests.
1515

16-
[!INCLUDE [azure-monitor-log-analytics-rebrand](../../../includes/azure-monitor-instrumentation-key-deprecation.md)]
16+
But for other applications (like Azure Cloud Services worker roles and Service Fabric stateless APIs), you need to track requests with code that tells Application Insights where your requests begin and end. Requests telemetry is then sent to Application Insights, which you can view on the Performance page. Profiles are collected for those requests.
1717

18-
To manually track requests, do the following:
18+
To manually track requests:
1919

2020
1. Early in the application lifetime, add the following code:
2121

@@ -25,6 +25,7 @@ To manually track requests, do the following:
2525
// Replace with your own Application Insights instrumentation key.
2626
TelemetryConfiguration.Active.InstrumentationKey = "00000000-0000-0000-0000-000000000000";
2727
```
28+
2829
For more information about this global instrumentation key configuration, see [Use Service Fabric with Application Insights](https://github.com/Azure-Samples/service-fabric-dotnet-getting-started/blob/dev/appinsights/ApplicationInsights.md).
2930

3031
1. For any piece of code that you want to instrument, add a `StartOperation<RequestTelemetry>` **using** statement around it, as shown in the following example:
@@ -41,7 +42,7 @@ To manually track requests, do the following:
4142
}
4243
```
4344

44-
Calling `StartOperation<RequestTelemetry>` within another `StartOperation<RequestTelemetry>` scope isn't supported. You can use `StartOperation<DependencyTelemetry>` in the nested scope instead. For example:
45+
Calling `StartOperation<RequestTelemetry>` within another `StartOperation<RequestTelemetry>` scope isn't supported. You can use `StartOperation<DependencyTelemetry>` in the nested scope instead. For example:
4546

4647
```csharp
4748
using (var getDetailsOperation = client.StartOperation<RequestTelemetry>("GetProductDetails"))
@@ -81,3 +82,9 @@ To manually track requests, do the following:
8182
}
8283
}
8384
```
85+
86+
[!INCLUDE [azure-monitor-log-analytics-rebrand](../../../includes/azure-monitor-instrumentation-key-deprecation.md)]
87+
88+
## Next steps
89+
90+
Troubleshoot the [Application Insights Profiler](./profiler-troubleshooting.md).

0 commit comments

Comments
 (0)