Websites can be complicated, and a very small mistake can take the whole site down. But there are two different kinds of errors, coding errors and deployment errors; coding errors should be picked up by compiling and debugging, while deployment errors should be picked up by the Health Check page.
Whenever there is a deployment problem, instead of fixing it straight away, we find out what the cause of the problem is and create a Health Check test to prevent it from happening again. So next time, when the site is down or re-deployed to a new server, we can simply run the Health Check page and fix all red crosses then the site should be back online.
.NET Core has the ability to add a health check to your application and can be configured for a variety of real-time monitoring scenarios:
See more at Health checks in ASP.NET Core.
If you need to add a UI to the health check system - we recommend checking out spNetCore.Diagnostics.HealthChecks Public.
It includes NuGet packages that make it easy to test the health of the lots of different endpoints, and you can push the health check results to different logging platforms e.g. Application Insights, DataDog, etc
It also includes UI (which is themable) and the UI supports automatic discovery of k8s services exposing pods that have health checks endpoints. This means you can benefit from it and avoid registering all the endpoints you want to check and let the UI discover them using the k8s API.
Best of all they have a Release Gate available on the DevOps market place for the release pipelines.
Figure: Sample Health Checks page
Figure: Sample Health of an endpoint being viewed in a timeline, so I can see when a resource was last healthy
Figure: Microsoft Service Health - admin.microsoft.com/servicestatus
Figure: Google Workspace Status Dashboard - www.google.com/appsstatus/dashboard
Figure: Apple System Status - www.apple.com/au/support/systemstatus
Figure: MailChimp status - status.mailchimp.com
See Do you have a Health Check page to test your website dependencies?
Figure: Check everything with care