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/live-stream.md
+40-39Lines changed: 40 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,20 @@
1
1
---
2
-
title: Diagnose with Live Metrics Stream - Azure Application Insights
2
+
title: Diagnose with Live Metrics - Application Insights - Azure Monitor
3
3
description: Monitor your web app in real time with custom metrics, and diagnose issues with a live feed of failures, traces, and events.
4
4
ms.topic: conceptual
5
5
ms.date: 05/31/2022
6
6
ms.reviewer: sdash
7
7
ms.devlang: csharp
8
8
---
9
9
10
-
# Live Metrics Stream: Monitor & Diagnose with 1-second latency
10
+
# Live Metrics: Monitor & Diagnose with 1-second latency
11
11
12
-
Monitor your live, in-production web application by using Live Metrics Stream (also known as QuickPulse) from [Application Insights](./app-insights-overview.md). Select and filter metrics and performance counters to watch in real time, without any disturbance to your service. Inspect stack traces from sample failed requests and exceptions. Together with [Profiler](./profiler.md) and [Snapshot debugger](./snapshot-debugger.md), Live Metrics Stream provides a powerful and non-invasive diagnostic tool for your live web site.
12
+
Monitor your live, in-production web application by using Live Metrics (also known as QuickPulse) from [Application Insights](./app-insights-overview.md). Select and filter metrics and performance counters to watch in real time, without any disturbance to your service. Inspect stack traces from sample failed requests and exceptions. Together with [Profiler](./profiler.md) and [Snapshot debugger](./snapshot-debugger.md), Live Metrics provides a powerful and non-invasive diagnostic tool for your live website.
13
13
14
14
> [!NOTE]
15
-
> Live Metrics only supports TLS 1.2. For more information refer to [Troubleshooting](#troubleshooting).
15
+
> Live Metrics only supports TLS 1.2. For more information, refer to [Troubleshooting](#troubleshooting).
16
16
17
-
With Live Metrics Stream, you can:
17
+
With Live Metrics, you can:
18
18
19
19
* Validate a fix while it's released, by watching performance and failure counts.
20
20
* Watch the effect of test loads, and diagnose issues live.
@@ -29,31 +29,33 @@ With Live Metrics Stream, you can:
29
29
Live Metrics are currently supported for ASP.NET, ASP.NET Core, Azure Functions, Java, and Node.js apps.
30
30
31
31
> [!NOTE]
32
-
> The number of monitored server instances displayed by Live Metrics Stream may be lower than the actual number of instances allocated for the application. This is because many modern web servers will unload applications that do not receive requests over a period of time in order to conserve resources. Since Live Metrics Stream only counts servers that are currently running the application, servers that have already unloaded the process will not be included in that total.
32
+
> The number of monitored server instances displayed by Live Metrics may be lower than the actual number of instances allocated for the application. This is because many modern web servers will unload applications that do not receive requests over a period of time in order to conserve resources. Since Live Metrics only counts servers that are currently running the application, servers that have already unloaded the process will not be included in that total.
33
33
34
34
## Get started
35
35
36
36
1. Follow language specific guidelines to enable Live Metrics.
37
37
*[ASP.NET](./asp-net.md) - Live Metrics is enabled by default.
38
-
*[ASP.NET Core](./asp-net-core.md)- Live Metrics is enabled by default.
39
-
*[.NET/.NET Core Console/Worker](./worker-service.md)- Live Metrics is enabled by default.
40
-
*[.NET Applications - Enable using code](#enable-livemetrics-using-code-for-any-net-application).
38
+
*[ASP.NET Core](./asp-net-core.md)- Live Metrics is enabled by default.
39
+
*[.NET/.NET Core Console/Worker](./worker-service.md)- Live Metrics is enabled by default.
40
+
*[.NET Applications - Enable using code](#enable-live-metrics-using-code-for-any-net-application).
41
41
*[Java](./java-in-process-agent.md) - Live Metrics is enabled by default.
42
42
*[Node.js](./nodejs.md#live-metrics)
43
43
44
-
2. In the [Azure portal](https://portal.azure.com), open the Application Insights resource for your app, and then open Live Stream.
44
+
2. In the [Azure portal](https://portal.azure.com), open the Application Insights resource for your app, then open Live Stream.
45
45
46
46
3.[Secure the control channel](#secure-the-control-channel) if you might use sensitive data such as customer names in your filters.
47
47
48
48
> [!IMPORTANT]
49
-
> Monitoring ASP.NET Core [LTS](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) applications require Application Insights version 2.8.0 or above. To enable Application Insights ensure it is both activated in the Azure Portal and that the Application Insights NuGet package is included. Without the NuGet package some telemetry is sent to Application Insights but that telemetry will not show in the Live Metrics Stream.
49
+
> Monitoring ASP.NET Core [LTS](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) applications require Application Insights version 2.8.0 or above. To enable Application Insights ensure it is both activated in the Azure Portal and that the Application Insights NuGet package is included. Without the NuGet package some telemetry is sent to Application Insights but that telemetry will not show in Live Metrics.
### Enable LiveMetrics using code for any .NET application
53
+
### Enable Live Metrics using code for any .NET application
54
54
55
-
Even though LiveMetrics is enabled by default when onboarding using recommended instructions for .NET Applications, the following shows how to set up Live Metrics
56
-
manually.
55
+
> [!NOTE]
56
+
> Live Metrics is enabled by default when onboarding using the recommended instructions for .NET Applications.
57
+
58
+
How to manually set up Live Metrics:
57
59
58
60
1. Install the NuGet package [Microsoft.ApplicationInsights.PerfCounterCollector](https://www.nuget.org/packages/Microsoft.ApplicationInsights.PerfCounterCollector)
59
61
2. The following sample console app code shows setting up Live Metrics.
While the above sample is for a console app, the same code can be used in any .NET applications. If any other TelemetryModules are enabled which auto-collects telemetry, it's important to ensure the same configuration used for initializing those modules is used for Live Metrics module as well.
118
120
119
-
## How does Live Metrics Stream differ from Metrics Explorer and Analytics?
121
+
## How does Live Metrics differ from Metrics Explorer and Analytics?
120
122
121
123
||Live Stream | Metrics Explorer and Analytics |
122
124
|---|---|---|
@@ -141,7 +143,7 @@ You can monitor a value different from Count. The options depend on the type of
141
143
142
144
In addition to Application Insights telemetry, you can also monitor any Windows performance counter by selecting that from the stream options, and providing the name of the performance counter.
143
145
144
-
Live metrics are aggregated at two points: locally on each server, and then across all servers. You can change the default at either by selecting other options in the respective drop-downs.
146
+
Live Metrics are aggregated at two points: locally on each server, and then across all servers. You can change the default at either by selecting other options in the respective drop-downs.
145
147
146
148
## Sample Telemetry: Custom Live Diagnostic Events
147
149
By default, the live feed of events shows samples of failed requests and dependency calls, exceptions, events, and traces. Select the filter icon to see the applied criteria at any point in time.
@@ -161,25 +163,32 @@ See the details of an item in the live feed by clicking it. You can pause the fe
161
163
162
164
## Filter by server instance
163
165
164
-
If you want to monitor a particular server role instance, you can filter by server. To filter select the server name under *Servers*.
166
+
If you want to monitor a particular server role instance, you can filter by server. To filter, select the server name under *Servers*.
165
167
166
168

167
169
168
170
## Secure the control channel
169
171
170
-
> [!NOTE]
171
-
> Currently, you can only set up an authenticated channel using manual instrumentation (SDK) and cannot authenticate servers using Azure service integration (or auto instrumentation).
172
+
Live Metrics custom filters allow you to control which of your application's telemetry is streamed to the Live Metrics view in Azure portal. The filters criteria is sent to the apps that are instrumented with the Application Insights SDK. The filter value could potentially contain sensitive information such as CustomerID. To keep this value secured and prevent potential disclosure to unauthorized applications, you have two options:
172
173
173
-
The custom filters criteria you specify in Live Metrics portal are sent back to the Live Metrics component in the Application Insights SDK. The filters could potentially contain sensitive information such as customerIDs. You can make the channel secure with a secret API key in addition to the instrumentation key.
174
+
- Recommended: Secure Live Metrics channel using [Azure AD authentication](./azure-ad-authentication.md#configuring-and-enabling-azure-ad-based-authentication)
175
+
- Legacy (no longer recommended): Set up an authenticated channel by configuring a secret API key as explained below
176
+
177
+
It is possible to try custom filters without having to set up an authenticated channel. Simply click on any of the filter icons and authorize the connected servers. Notice that if you choose this option, you will have to authorize the connected servers once every new session or when a new server comes online.
178
+
179
+
> [!WARNING]
180
+
> We strongly discourage the use of unsecured channels and will disable this option 6 months after you start using it. The “Authorize connected servers” dialog displays the date (highlighted below) after which this option will be disabled.

178
187

179
188
180
189
### Add API key to Configuration
181
190
182
-
### ASP.NET
191
+
####ASP.NET
183
192
184
193
In the applicationinsights.config file, add the AuthenticationApiKey to the QuickPulseTelemetryModule:
185
194
@@ -189,7 +198,7 @@ In the applicationinsights.config file, add the AuthenticationApiKey to the Quic
189
198
</Add>
190
199
```
191
200
192
-
### ASP.NET Core
201
+
####ASP.NET Core
193
202
194
203
For [ASP.NET Core](./asp-net-core.md) applications, follow the instructions below.
195
204
@@ -213,7 +222,7 @@ public void ConfigureServices(IServiceCollection services)
213
222
214
223
More information on configuring ASP.NET Core applications can be found in our guidance on [configuring telemetry modules in ASP.NET Core](./asp-net-core.md#configuring-or-removing-default-telemetrymodules).
215
224
216
-
### WorkerService
225
+
####WorkerService
217
226
218
227
For [WorkerService](./worker-service.md) applications, follow the instructions below.
219
228
@@ -231,20 +240,12 @@ Next, add the following line before the call `services.AddApplicationInsightsTel
231
240
232
241
More information on configuring WorkerService applications can be found in our guidance on [configuring telemetry modules in WorkerServices](./worker-service.md#configuring-or-removing-default-telemetrymodules).
233
242
234
-
### Azure Function Apps
243
+
####Azure Function Apps
235
244
236
245
For Azure Function Apps (v2), securing the channel with an API key can be accomplished with an environment variable.
237
246
238
247
Create an API key from within your Application Insights resource and go to **Settings > Configuration** for your Function App. Select **New application setting** and enter a name of `APPINSIGHTS_QUICKPULSEAUTHAPIKEY` and a value that corresponds to your API key.
239
248
240
-
Securing the control channel is not necessary if you recognize and trust all the connected servers. This option is made available so that you can try custom filters without having to set up an authenticated channel. If you choose this option you will have to authorize the connected servers once every new session or when a new server comes online. We strongly discourage the use of unsecured channels and will disable this option 6 months after you start using it. To use custom filters without a secure channel simply click on any of the filter icons and authorize the connected servers. The “Authorize connected servers” dialog displays the date (highlighted below) after which this option will be disabled.
> We strongly recommend that you set up the authenticated channel before entering potentially sensitive information like CustomerID in the filter criteria.
246
-
>
247
-
248
249
## Supported features table
249
250
250
251
| Language | Basic Metrics | Performance metrics | Custom filtering | Sample telemetry | CPU split by process |
@@ -261,14 +262,14 @@ Basic metrics include request, dependency, and exception rate. Performance metri
261
262
\* PerfCounters support varies slightly across versions of .NET Core that do not target the .NET Framework:
262
263
263
264
- PerfCounters metrics are supported when running in Azure App Service for Windows. (AspNetCore SDK Version 2.4.1 or higher)
264
-
- PerfCounters are supported when app is running in ANY Windows machines (VM or Cloud Service or On-prem etc.) (AspNetCore SDK Version 2.7.1 or higher), but for apps targeting .NET Core [LTS](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) or higher.
265
+
- PerfCounters are supported when app is running in ANY Windows machines (VM or Cloud Service or on-premises etc.) (AspNetCore SDK Version 2.7.1 or higher), but for apps targeting .NET Core [LTS](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) or higher.
265
266
- PerfCounters are supported when app is running ANYWHERE (Linux, Windows, app service for Linux, containers, etc.) in the latest versions, but only for apps targeting .NET Core [LTS](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) or higher.
266
267
267
268
## Troubleshooting
268
269
269
-
Live Metrics Stream uses different IP addresses than other Application Insights telemetry. Make sure [those IP addresses](./ip-addresses.md) are open in your firewall. Also check the [outgoing ports for Live Metrics Stream](./ip-addresses.md#outgoing-ports) are open in the firewall of your servers.
270
+
Live Metrics uses different IP addresses than other Application Insights telemetry. Make sure [those IP addresses](./ip-addresses.md) are open in your firewall. Also check the [outgoing ports for Live Metrics](./ip-addresses.md#outgoing-ports) are open in the firewall of your servers.
270
271
271
-
As described in the [Azure TLS 1.2 migration announcement](https://azure.microsoft.com/updates/azuretls12/), Live Metrics now only supports TLS 1.2. If you are using an older version of TLS, Live Metrics will not display any data. For applications based on .NET Framework 4.5.1 refer to [How to enable Transport Layer Security (TLS) 1.2 on clients - Configuration Manager](/mem/configmgr/core/plan-design/security/enable-tls-1-2-client#bkmk_net) to support newer TLS version.
272
+
As described in the [Azure TLS 1.2 migration announcement](https://azure.microsoft.com/updates/azuretls12/), Live Metrics now only supports TLS 1.2. If you are using an older version of TLS, Live Metrics will not display any data. For applications based on .NET Framework 4.5.1, refer to [How to enable Transport Layer Security (TLS) 1.2 on clients - Configuration Manager](/mem/configmgr/core/plan-design/security/enable-tls-1-2-client#bkmk_net) to support newer TLS version.
272
273
273
274
> [!WARNING]
274
275
> Currently, authenticated channel only supports manual SDK instrumentation. The authenticated channel cannot be configured with auto-instrumentation (used to be known as "codeless attach").
@@ -278,8 +279,8 @@ As described in the [Azure TLS 1.2 migration announcement](https://azure.microso
278
279
1. Verify you are using the latest version of the NuGet package [Microsoft.ApplicationInsights.PerfCounterCollector](https://www.nuget.org/packages/Microsoft.ApplicationInsights.PerfCounterCollector)
279
280
2. Edit the `ApplicationInsights.config` file
280
281
* Verify that the connection string points to the Application Insights resource you are using
281
-
* Locate the `QuickPulseTelemetryModule` configuration option; if it is not there add it
282
-
* Locate the `QuickPulseTelemetryProcessor` configuration option; if it is not there add it
282
+
* Locate the `QuickPulseTelemetryModule` configuration option; if it is not there, add it
283
+
* Locate the `QuickPulseTelemetryProcessor` configuration option; if it is not there, add it
0 commit comments