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-core.md
+62-5Lines changed: 62 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -166,9 +166,66 @@ If `IConfiguration` has loaded configuration from multiple providers, then `serv
166
166
167
167
Run your application and make requests to it. Telemetry should now flow to Application Insights. The Application Insights SDK automatically collects incoming web requests to your application, along with the following telemetry.
168
168
169
-
### Live Metrics
169
+
### Live metrics
170
170
171
-
[Live Metrics](./live-stream.md) can be used to quickly verify if Application Insights monitoring is configured correctly. It might take a few minutes for telemetry to appear in the portal and analytics, but Live Metrics shows CPU usage of the running process in near real time. It can also show other telemetry like requests, dependencies, and traces.
171
+
[Live metrics](./live-stream.md) can be used to quickly verify if application monitoring with Application Insights is configured correctly. Telemetry can take a few minutes to appear in the Azure portal, but the live metrics pane shows CPU usage of the running process in near real time. It can also show other telemetry like requests, dependencies, and traces.
172
+
173
+
#### Enable live metrics by using code for any .NET application
174
+
175
+
> [!NOTE]
176
+
> Live metrics are enabled by default when you onboard it by using the recommended instructions for .NET applications.
177
+
178
+
To manually configure live metrics:
179
+
180
+
1. Install the NuGet package [Microsoft.ApplicationInsights.PerfCounterCollector](https://www.nuget.org/packages/Microsoft.ApplicationInsights.PerfCounterCollector).
181
+
1. The following sample console app code shows setting up live metrics:
182
+
183
+
```csharp
184
+
using Microsoft.ApplicationInsights;
185
+
using Microsoft.ApplicationInsights.Extensibility;
186
+
using Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.QuickPulse;
The preceding sample is for a console app, but the same code can be used in any .NET applications. If any other telemetry modules are enabled to autocollect telemetry, it's important to ensure that the same configuration used for initializing those modules is used for the live metrics module.
172
229
173
230
### ILogger logs
174
231
@@ -250,7 +307,7 @@ var aiOptions = new Microsoft.ApplicationInsights.AspNetCore.Extensions.Applicat
250
307
// Disables adaptive sampling.
251
308
aiOptions.EnableAdaptiveSampling=false;
252
309
253
-
// Disables QuickPulse (Live Metrics stream).
310
+
// Disables live metrics (also known as QuickPulse).
@@ -452,7 +509,7 @@ By default, the following automatic-collection modules are enabled. These module
452
509
*`RequestTrackingTelemetryModule`: Collects RequestTelemetry from incoming web requests.
453
510
*`DependencyTrackingTelemetryModule`: Collects [DependencyTelemetry](./asp-net-dependencies.md) from outgoing HTTP calls and SQL calls.
454
511
*`PerformanceCollectorModule`: Collects Windows PerformanceCounters.
455
-
*`QuickPulseTelemetryModule`: Collects telemetry to show in the Live Metrics portal.
512
+
*`QuickPulseTelemetryModule`: Collects telemetry to show in the live metrics pane.
456
513
*`AppServicesHeartbeatTelemetryModule`: Collects heartbeats (which are sent as custom metrics), about the App Service environment where the application is hosted.
457
514
*`AzureInstanceMetadataTelemetryModule`: Collects heartbeats (which are sent as custom metrics), about the Azure VM environment where the application is hosted.
458
515
*`EventCounterCollectionModule`: Collects [EventCounters](eventcounters.md). This module is a new feature and is available in SDK version 2.8.0 and later.
Copy file name to clipboardExpand all lines: articles/azure-monitor/app/asp-net.md
+72Lines changed: 72 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -361,6 +361,78 @@ Although it's possible to manually add the JavaScript (Web) SDK Loader Script to
361
361
362
362
For the template-based ASP.NET MVC app from this article, the file that you need to edit is *_Layout.cshtml*. You can find it under **Views** > **Shared**. To add client-side monitoring, open *_Layout.cshtml* and follow the [JavaScript (Web) SDK Loader Script-based setup instructions](./javascript-sdk.md?tabs=javascriptwebsdkloaderscript#get-started) from the article about client-side JavaScript SDK configuration.
363
363
364
+
## Live metrics
365
+
366
+
[Live metrics](./live-stream.md) can be used to quickly verify if application monitoring with Application Insights is configured correctly. Telemetry can take a few minutes to appear in the Azure portal, but the live metrics pane shows CPU usage of the running process in near real time. It can also show other telemetry like requests, dependencies, and traces.
367
+
368
+
### Enable live metrics by using code for any .NET application
369
+
370
+
> [!NOTE]
371
+
> Live metrics are enabled by default when you onboard it by using the recommended instructions for .NET applications.
372
+
373
+
To manually configure live metrics:
374
+
375
+
1. Install the NuGet package [Microsoft.ApplicationInsights.PerfCounterCollector](https://www.nuget.org/packages/Microsoft.ApplicationInsights.PerfCounterCollector).
376
+
1. The following sample console app code shows setting up live metrics:
377
+
378
+
```csharp
379
+
using Microsoft.ApplicationInsights;
380
+
using Microsoft.ApplicationInsights.Extensibility;
381
+
using Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.QuickPulse;
The preceding sample is for a console app, but the same code can be used in any .NET applications. If any other telemetry modules are enabled to autocollect telemetry, it's important to ensure that the same configuration used for initializing those modules is used for the live metrics module.
435
+
364
436
## Frequently asked questions
365
437
366
438
This section provides answers to common questions.
0 commit comments