.Net Core + Health Checks
ASP.NET Core offers Health Checks Middleware and libraries for reporting the health of app infrastructure components.
Health checks can make your life easier, image that you do not have access to the application or the host of your application. That way, you can check the availability of the app.
You can report the health of any type ASP.net application from a MVC, front end application to a back end application.
Their are two type of health checks
- liveness health check simple type of health checks only tells you if your application is running
- readiness health checks, usually performs a more extensive and time-consuming set of checks to determine if all of the app’s subsystems and resources are available.
How to see the health of each service?
You need to create an HTTP endpoint and register that endpoint in your startup.cs. The response of that HTTP endpoint will give you, the health check status. HTTP Status code is mapped from health check code.
HTTP Status Code vs Health check code
Healthy -> 200 OK
Degraded -> 200 OK