You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-monitor/app/asp-net-dependencies.md
+42-42Lines changed: 42 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ ms.reviewer: casocha
10
10
11
11
# Dependency tracking in Application Insights
12
12
13
-
A *dependency* is a component that's called by your application. It's typically a service called by using HTTP, a database, or a file system. [Application Insights](./app-insights-overview.md) measures the duration of dependency calls, whether it's failing or not, along with information like the name of the dependency. You can investigate specific dependency calls and correlate them to requests and exceptions.
13
+
A *dependency* is a component that's called by your application. It's typically a service called by using HTTP, a database, or a file system. [Application Insights](./app-insights-overview.md) measures the duration of dependency calls and whether it's failing or not, along with information like the name of the dependency. You can investigate specific dependency calls and correlate them to requests and exceptions.
14
14
15
15
## Automatically tracked dependencies
16
16
@@ -45,7 +45,7 @@ For .NET Core console apps, `TelemetryConfiguration.Active` is obsolete. See the
45
45
46
46
Dependencies are automatically collected by using one of the following techniques:
47
47
48
-
* Using byte code instrumentation around select methods. Use `InstrumentationEngine` either from `StatusMonitor` or an Azure Web App extension.
48
+
* Using byte code instrumentation around select methods. Use `InstrumentationEngine` either from `StatusMonitor` or an Azure App Service Web Apps extension.
49
49
*`EventSource` callbacks.
50
50
*`DiagnosticSource` callbacks in the latest .NET or .NET Core SDKs.
51
51
@@ -101,15 +101,15 @@ For ASP.NET Core applications, It's now required to opt in to SQL Text collectio
For ASP.NET applications, the full SQL query text is collected with the help of byte code instrumentation, which requires using the instrumentation engine or by using the [Microsoft.Data.SqlClient](https://www.nuget.org/packages/Microsoft.Data.SqlClient) NuGet package instead of the System.Data.SqlClient library. Platform-specific steps to enable full SQL Query collection are described here:
104
+
For ASP.NET applications, the full SQL query text is collected with the help of byte code instrumentation, which requires using the instrumentation engine or by using the [Microsoft.Data.SqlClient](https://www.nuget.org/packages/Microsoft.Data.SqlClient) NuGet package instead of the System.Data.SqlClient library. Platform-specific steps to enable full SQL Query collection are described in the following table.
105
105
106
106
| Platform | Steps needed to get full SQL query |
107
107
| --- | --- |
108
-
|Azure Web App |In your web app control panel, [open the Application Insights pane](../../azure-monitor/app/azure-web-apps.md) and enable SQL Commands under .NET. |
109
-
| IIS Server (Azure VM, on-premises, and so on) | Either use the [Microsoft.Data.SqlClient](https://www.nuget.org/packages/Microsoft.Data.SqlClient) NuGet package or use the Status Monitor PowerShell Module to [install the instrumentation engine](../../azure-monitor/app/status-monitor-v2-api-reference.md#enable-instrumentationengine) and restart IIS. |
110
-
| Azure Cloud Service| Add a [startup task to install StatusMonitor](../../azure-monitor/app/azure-web-apps-net-core.md). <br> Your app should be onboarded to the ApplicationInsights SDK at build time by installing NuGet packages for [ASP.NET](./asp-net.md) or [ASP.NET Core applications](./asp-net-core.md). |
108
+
| Web Apps in Azure App Service|In your web app control panel, [open the Application Insights pane](../../azure-monitor/app/azure-web-apps.md) and enable SQL Commands under .NET. |
109
+
| IIS Server (Azure Virtual Machines, on-premises, and so on) | Either use the [Microsoft.Data.SqlClient](https://www.nuget.org/packages/Microsoft.Data.SqlClient) NuGet package or use the Status Monitor PowerShell Module to [install the instrumentation engine](../../azure-monitor/app/status-monitor-v2-api-reference.md#enable-instrumentationengine) and restart IIS. |
110
+
| Azure Cloud Services| Add a [startup task to install StatusMonitor](../../azure-monitor/app/azure-web-apps-net-core.md). <br> Your app should be onboarded to the ApplicationInsights SDK at build time by installing NuGet packages for [ASP.NET](./asp-net.md) or [ASP.NET Core applications](./asp-net-core.md). |
111
111
| IIS Express | Use the [Microsoft.Data.SqlClient](https://www.nuget.org/packages/Microsoft.Data.SqlClient) NuGet package.
112
-
| Azure Web Jobs | Use the [Microsoft.Data.SqlClient](https://www.nuget.org/packages/Microsoft.Data.SqlClient) NuGet package.
112
+
| WebJobs in Azure App Service| Use the [Microsoft.Data.SqlClient](https://www.nuget.org/packages/Microsoft.Data.SqlClient) NuGet package.
113
113
114
114
In addition to the preceding platform-specific steps, you *must also explicitly opt in to enable SQL command collection* by modifying the `applicationInsights.config` file with the following code:
115
115
@@ -120,7 +120,7 @@ In addition to the preceding platform-specific steps, you *must also explicitly
120
120
</Add>
121
121
```
122
122
123
-
In the preceding cases, the proper way of validating that the instrumentation engine is correctly installed is by validating that the SDK version of collected `DependencyTelemetry` is `rddp`. `rdddsd` or `rddf` indicates dependencies are collected via `DiagnosticSource` or `EventSource` callbacks, so the full SQL query won't be captured.
123
+
In the preceding cases, the proper way of validating that the instrumentation engine is correctly installed is by validating that the SDK version of collected `DependencyTelemetry` is `rddp`. Use of `rdddsd` or `rddf` indicates dependencies are collected via `DiagnosticSource` or `EventSource` callbacks, so the full SQL query won't be captured.
124
124
125
125
## Where to find dependency data
126
126
@@ -136,75 +136,75 @@ Each request event is associated with the dependency calls, exceptions, and othe
136
136
137
137
### Tracing from requests to dependencies
138
138
139
-
Open the **Performance** tab and go to the **Dependencies** tab at the top next to operations.
139
+
Select the **Performance** tab on the left and select the **Dependencies** tab at the top.
140
140
141
-
Select a **Dependency Name** under overall. After you select a dependency, a graph of that dependency's distribution of durations will show up on the right.
141
+
Select a **Dependency Name** under **Overall**. After you select a dependency, a graph of that dependency's distribution of durations appears on the right.
142
142
143
-

143
+

144
144
145
-
Select the **Samples** button at the bottom right and then on a sample to see the end-to-end transaction details.
145
+
Select the **Samples** button at the bottom right. Then select a sample to see the end-to-end transaction details.
146
146
147
147

148
148
149
149
### Profile your live site
150
150
151
-
No idea where the time goes? The [Application Insights profiler](../../azure-monitor/app/profiler.md) traces HTTP calls to your live site and shows you the functions in your code that took the longest time.
151
+
The [Application Insights profiler](../../azure-monitor/app/profiler.md) traces HTTP calls to your live site and shows you the functions in your code that took the longest time.
152
152
153
153
## Failed requests
154
154
155
155
Failed requests might also be associated with failed calls to dependencies.
156
156
157
-
We can go to the **Failures** tab on the left and then select on the **dependencies** tab at the top.
157
+
Select the **Failures** tab on the left and then select the **Dependencies** tab at the top.
158
158
159
159

160
160
161
-
Here you'll be able to see the failed dependency count. To get more details about a failed occurrence trying selecting a dependency name in the bottom table. Select the **Dependencies** button at the bottom right to get the end-to-end transaction details.
161
+
Here you'll see the failed dependency count. To get more information about a failed occurrence, select a **Dependency Name** in the bottom table. Select the **Dependencies** button at the bottom right to see the end-to-end transaction details.
162
162
163
163
## Logs (Analytics)
164
164
165
165
You can track dependencies in the [Kusto query language](/azure/kusto/query/). Here are some examples.
166
166
167
167
* Find any failed dependency calls:
168
-
169
-
```Kusto
170
-
171
-
dependencies | where success != "True" | take 10
172
-
```
168
+
169
+
```Kusto
170
+
171
+
dependencies | where success != "True" | take 10
172
+
```
173
173
174
174
* Find AJAX calls:
175
175
176
-
```Kusto
177
-
178
-
dependencies | where client_Type == "Browser" | take 10
179
-
```
176
+
``` Kusto
177
+
178
+
dependencies | where client_Type == "Browser" | take 10
179
+
```
180
180
181
181
* Find dependency calls associated with requests:
182
-
183
-
```Kusto
184
-
185
-
dependencies
186
-
| where timestamp > ago(1d) and client_Type != "Browser"
187
-
| join (requests | where timestamp > ago(1d))
188
-
on operation_Id
189
-
```
182
+
183
+
``` Kusto
184
+
185
+
dependencies
186
+
| where timestamp > ago(1d) and client_Type != "Browser"
187
+
| join (requests | where timestamp > ago(1d))
188
+
on operation_Id
189
+
```
190
190
191
191
* Find AJAX calls associated with page views:
192
-
193
-
```Kusto
194
-
195
-
dependencies
196
-
| where timestamp > ago(1d) and client_Type == "Browser"
197
-
| join (browserTimings | where timestamp > ago(1d))
198
-
on operation_Id
199
-
```
192
+
193
+
``` Kusto
194
+
195
+
dependencies
196
+
| where timestamp > ago(1d) and client_Type == "Browser"
197
+
| join (browserTimings | where timestamp > ago(1d))
198
+
on operation_Id
199
+
```
200
200
201
201
## Frequently asked questions
202
202
203
203
This section provides answers to common questions.
204
204
205
-
### How does automatic dependency collector report failed calls to dependencies?
205
+
### How does the automatic dependency collector report failed calls to dependencies?
206
206
207
-
*Failed dependency calls will have the `success` field set to False. The module `DependencyTrackingTelemetryModule` doesn't report `ExceptionTelemetry`. The full data model for dependency is described [Dependency telemetry: Application Insights data model](data-model-dependency-telemetry.md).
207
+
Failed dependency calls will have the `success` field set to False. The module `DependencyTrackingTelemetryModule` doesn't report `ExceptionTelemetry`. The full data model for dependency is described [Dependency telemetry: Application Insights data model](data-model-dependency-telemetry.md).
208
208
209
209
### How do I calculate ingestion latency for my dependency telemetry?
0 commit comments