One of my previous posts was about open source application performance management, and why we even consider open source. If we were to give an open source monitoring solution a shot for an ASP.NET Core application, what options are available? One option is an open source project I’ve been working on, App Metrics. It targets .NET Standard which of course makes it a cross platform solution, provides various extensions allowing metrics to be captured in process and persisted to several TSDBs, as well as providing application health checks.
Health checks are useful to not only test the internal health of your application but also it’s external dependencies such as confirming that a third party api is available or confirming the connectivity to a database for example. App Metrics provides such health checks and exposes a health endpoint whereby results can be viewed and monitored. Health checks in App Metrics are small tests which return either a healthy, degraded or unhealthy result. Health checks are executed when the health endpoint is requested via ASP.NET Core Middleware.
Here we’ll look at configuring App Metrics to provide health checks in an ASP.NET Core MVC application.
For those serious about their applications, monitoring performance & health is crucial. So what monitoring options do we have? Well, there are many commercial Application Performance Management (APM) tools out there, to name a few, New Relic, Azure Application Insights, Datadog, Prometheus and App Dynamics. These are all awesome products with some great features. But, there are also many great, and free, open source solutions available to us which are just as feature rich.
Why would we bother setting up a custom monitoring solution? Well, in some cases it may not be worth the short-term effort, but in cases where cost, flexibility, vendor lock-in holds you back, longer term retention on data is required, want more control over how data is sampled, not sure up-front what option is going to suit your system(s) best, or don’t want to make an up-front paid commitment, an open source solution can really shine.