
The problem is that they aren’t really in use anywhere and there doesn’t seem to be much tooling in place to use them.Ī simple Google search for EventCounters doesn’t even bring up much at all. Instead, a new type of counters called EventCounters are the future.ĮventCounters are cross-platform and work on top of EventSource and Event tracing for Windows (ETW). Microsoft has so far said that performance counters are not coming to the Core CLR. The future solution from Microsoft is EventCounters Retrace just does all of that with the one line of code. They require creating them, reporting data to them, and then configuring your application monitoring system to monitor them. This is a much simpler solution than using Windows performance counters. Your metrics will now show up within Retrace and you can compare the metric across servers, setup alerts, etc. (“Logs Processor”, “Incoming App Log Count”, 1) Here is an example of how to report a custom metric to Retrace: With just a couple lines of code, you can implement several different types of custom application metrics for your application. Our product Retrace has excellent support for custom metrics. If you want to use performance counters for your own custom application metrics, you can instead use a 3rd-party library for recording your metrics. Luckily, there are alternative solutions for your own custom metrics!Īlternative to performance counters for custom metrics within your application NET Core, you also can’t use them for your own custom metrics. Unfortunately, if you can’t use performance counters with. NET framework provides, you can also make your own custom performance counters. w00t!īeyond the built-in metrics that the. For my test, you can now see my test app “ContentDashboard” as having performance counters in Windows perfmon below. NET Framework and the kestrel web server. I made the change, published it, and ran my test application, ContentDashboard.exe from Visual Studio. Change the “TargetFramework” to net471 so it uses the full.


NET Core on Windows and have access to performance counters, you can do so by switching your ASP.NET Core web application from targeting netcoreapp20 to net471.įind your csproj file in Windows Explorer and edit it with a text editor.

Switch your ASP.NET Core project from Core CLR to the full framework. If you need support for performance counters, deploying your application to Linux or macOS is not an option. Since Linux or macOS do not have performance counters because they are very much a Windows thing, there is no support for them in apps that target netcoreapp, which is the Core CLR. The new Core CLR does not support them since they are not cross-platform. NET CLR supports them and makes extensive usage of them. All you need to do is change your application to target the full. NET Core is actually quite easy, if you plan on deploying to Windows.
