AddHealthChecks
The ASP.NET Core calls that register health checks (AddHealthChecks) and expose them at an endpoint (MapHealthChecks).
In more detail
The checks themselves are small classes or lambdas that report Healthy, Degraded or Unhealthy. Map separate routes for liveness and readiness, and use tags to choose which checks each runs.
Example
app.MapHealthChecks("/health/ready");Related terms
- health check — A regular automated test of whether a program or service is working, such as a request to its health endpoint or a command run inside its container.
- liveness probe — A health check that answers only whether a process is alive enough to keep running; if it keeps failing, the orchestrator, such as Kubernetes, restarts it.
- readiness probe — A check that decides whether a pod should receive traffic right now; failing it removes the pod from its Service without restarting it.
Taught in
- Health Checks — Modern .NET Core, C# & Enterprise Microservices