Health checks report Healthy, Degraded, or Unhealthy status. Basic config deems app healthy if endpoint responds. Implement IHealthCheck for custom checks returning HealthCheckResult. Register checks with AddHealthChecks and map endpoints with MapHealthChecks. Tags filter health checks by category. RequireAuthorization secures endpoints from unauthorized access. Predicate option runs subset of checks. ResponseWriter customizes output like JSON. SQL Server checks run SELECT 1 query. DbContext checks test EF Core database connectivity. Liveness probes check process aliveness without dependencies. Readiness probes block traffic until startup completes. Publishers push health status periodically. Kubernetes uses separate liveness and readiness probes. Management ports restrict checks to specific hosts. Docker HEALTHCHECK directive probes endpoints.
Comments
Be the first to comment!