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/eventcounters.md
+22-23Lines changed: 22 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,17 +15,17 @@ ms.author: cithomas
15
15
---
16
16
# EventCounters introduction
17
17
18
-
`EventCounter` is .NET/.NET Core mechanism to publish and consume counters or statistics. [This](https://github.com/dotnet/corefx/blob/master/src/System.Diagnostics.Tracing/documentation/EventCounterTutorial.md) document gives an overview of `EventCounters` and examples on how to publish and consume them. EventCounters are supported in all OS Platforms, and can be thought of as a cross-platform equivalent for the [PerformanceCounters](https://docs.microsoft.com/dotnet/api/system.diagnostics.performancecounter)which is only supported in Windows systems.
18
+
`EventCounter` is .NET/.NET Core mechanism to publish and consume counters or statistics. [This](https://github.com/dotnet/corefx/blob/master/src/System.Diagnostics.Tracing/documentation/EventCounterTutorial.md) document gives an overview of `EventCounters` and examples on how to publish and consume them. EventCounters are supported in all OS Platforms - Windows, Linux and MacOS. It can be thought of as a cross-platform equivalent for the [PerformanceCounters](https://docs.microsoft.com/dotnet/api/system.diagnostics.performancecounter)that is only supported in Windows systems.
19
19
20
-
While users can publish any custom `EventCounters` to meet their needs, the .NET Core 3.0 ecosystem publishes a set of these counters out-of-the-box. The document will walk through the steps required to collect and view `EventCounters` (system defined or user defined) in Azure Application Insights.
20
+
While users can publish any custom `EventCounters` to meet their needs, the .NET Core 3.0 runtime publishes a set of these counters by default. The document will walk through the steps required to collect and view `EventCounters` (system defined or user defined) in Azure Application Insights.
21
21
22
-
# Using Application Insights to collect EventCounters
22
+
##Using Application Insights to collect EventCounters
23
23
24
-
Application Insights supports collecting `EventCounters` with its `EventCounterCollectionModule`, which is part of the newly released nuget package [Microsoft.ApplicationInsights.EventCounterCollector](https://www.nuget.org/packages/Microsoft.ApplicationInsights.EventCounterCollector). `EventCounterCollectionModule` is automatically enabled when using either [AspNetCore](asp-net-core.md) or [WorkerService](worker-service.md) instructions. `EventCounterCollectionModule` collects counters with a non-configurable collection frequency of 60 seconds.
24
+
Application Insights supports collecting `EventCounters` with its `EventCounterCollectionModule`, which is part of the newly released nuget package [Microsoft.ApplicationInsights.EventCounterCollector](https://www.nuget.org/packages/Microsoft.ApplicationInsights.EventCounterCollector). `EventCounterCollectionModule` is automatically enabled when using either [AspNetCore](asp-net-core.md) or [WorkerService](worker-service.md) instructions. `EventCounterCollectionModule` collects counters with a non-configurable collection frequency of 60 seconds. There are no special permissions required to collect EventCounters.
25
25
26
26
## Default counters collected
27
27
28
-
For apps running in .NET Core 3.0 or higher, the following lists the default set of counters collected automatically by the SDK. These counters can be queried either in Metrics Explorer or using Analytics query. The name of the counters will be of the form "Category|Counter".
28
+
For apps running in .NET Core 3.0, the following set of counters are collected automatically by the SDK. The name of the counters will be of the form "Category|Counter".
29
29
30
30
|Category | Counter|
31
31
|---------------|-------|
@@ -57,32 +57,31 @@ Note: Counters of category Microsoft.AspNetCore.Hosting are only added in Asp.Ne
57
57
58
58
## Customizing counters to be collected
59
59
60
-
The following shows how to add/remove counters. This would be done in `ConfigureServices` of your application after application insights telemetry collection is enabled using either `AddApplicationInsightsTelemetry()` or `AddApplicationInsightsWorkerService()`. Following is an example code from an Asp.Net Core application. For other type of applications, refer to [this](worker-service.md#configuring-or-removing-default-telemetrymodules) document.
60
+
The following example shows how to add/remove counters. This customization would be done in `ConfigureServices` of your application after application insights telemetry collection is enabled using either `AddApplicationInsightsTelemetry()` or `AddApplicationInsightsWorkerService()`. Following is an example code from an Asp.Net Core application. For other type of applications, refer to [this](worker-service.md#configuring-or-removing-default-telemetrymodules) document.
@@ -94,7 +93,7 @@ The following shows how to add/remove counters. This would be done in `Configure
94
93
95
94
## Event counters in Metric Explorer
96
95
97
-
To view EventCounter metrics in [Metric Explorer](https://docs.microsoft.com/azure/azure-monitor/platform/metrics-charts), select Application Insights resource, and chose Log-based metrics as metric namespace. Then EventCounter metrics gets displayed under PerformanceCounter category.
96
+
To view EventCounter metrics in [Metric Explorer](https://docs.microsoft.com/azure/azure-monitor/platform/metrics-charts), select Application Insights resource, and chose Log-based metrics as metric namespace. Then EventCounter metrics get displayed under PerformanceCounter category.
98
97
99
98

100
99
@@ -105,12 +104,12 @@ You can also search and display event counter reports in [Analytics](../../azure
105
104
For example, run the following query to see what counters are collected and available to query:
106
105
107
106
```Kusto
108
-
performanceCounters | summarize count(), avg(value) by name
107
+
performanceCounters | summarize avg(value) by name
109
108
```
110
109
111
110

112
111
113
-
To get a chart of a specific counter (eg:) over the recent period:
112
+
To get a chart of a specific counter (for example: `ThreadPool Completed Work Item Count`) over the recent period, run the following query.
114
113
115
114
```Kusto
116
115
performanceCounters
@@ -122,7 +121,7 @@ performanceCounters
122
121
123
122

124
123
125
-
Like other telemetry, **performanceCounters** also has a column `cloud_RoleInstance` that indicates the identity of the host server instance on which your app is running. The above query shows the counter value per instance, and hence can be used to compare performance of different server instances.
124
+
Like other telemetry, **performanceCounters** also has a column `cloud_RoleInstance` that indicates the identity of the host server instance on which your app is running. The above query shows the counter value per instance, and can be used to compare performance of different server instances.
126
125
127
126
## Alerts
128
127
Like other metrics, you can [set an alert](../../azure-monitor/app/alerts.md) to warn you if an event counter goes outside a limit you specify. Open the Alerts pane and click Add Alert.
Copy file name to clipboardExpand all lines: articles/azure-monitor/app/worker-service.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -531,7 +531,7 @@ Use this sample if you are using a Console Application written in either .NET Co
531
531
Use this sample if you are in Asp.Net Core 2.1/2.2, and creating background tasks as per official guidance [here](https://docs.microsoft.com/aspnet/core/fundamentals/host/hosted-services?view=aspnetcore-2.2)
Use this sample if you have a .NET Core 3.0 Worker Service application as per official guidance [here](https://docs.microsoft.com/aspnet/core/fundamentals/host/hosted-services?view=aspnetcore-3.0&tabs=visual-studio#worker-service-template)
534
+
Use this sample if you have a .NET Core 3.0 Worker Service application as per official guidance [here](https://docs.microsoft.com/aspnet/core/fundamentals/host/hosted-services?view=aspnetcore-3.0&tabs=visual-studio#worker-service-template)
0 commit comments