Health Check Endpoints
Basic Health Check
The basic health check endpoint provides a simple status indicator:- Load balancer health checks
- Kubernetes liveness probes
- Basic uptime monitoring
Extended Health Check
The extended health check provides detailed information about all system dependencies:Configuration
Health Check Services
Health checks are configured in the API service startup. The implementation is insrc/SharedWeb/Health/HealthCheckServiceExtensions.cs and src/Api/Utilities/ServiceCollectionExtensions.cs:77.
Default Checks:
-
Identity Service Check
- Verifies the Identity service OpenID configuration endpoint
- URL:
{IdentityUri}/.well-known/openid-configuration
-
SQL Server Check
- Validates database connectivity
- Uses the configured connection string from
globalSettings.SqlServer.ConnectionString
Self-Hosted Deployments
To enable health checks in self-hosted environments, you’ll need to modify the startup configuration insrc/Api/Startup.cs:196.
Rate Limiting
The/alive endpoint (if configured) has rate limiting applied:
Monitoring Integration
Kubernetes
Configure liveness and readiness probes:Docker Swarm
Add a health check to your service definition:Load Balancers
NGINX
HAProxy
Health Check Response Format
The health check response writer is implemented insrc/SharedWeb/Health/HealthCheckServiceExtensions.cs:22.
Status Values:
Healthy- Service is operating normallyDegraded- Service is operational but with issuesUnhealthy- Service is not operational
Troubleshooting
Health Check Fails Immediately
Symptom:/healthz returns 503 or times out
Possible Causes:
- Identity service is unreachable
- Database connection is unavailable
- Service hasn’t finished starting up
Intermittent Health Check Failures
Symptom: Health checks occasionally fail even when service appears healthy Common Causes:- Network timeouts between services
- Database connection pool exhaustion
- Identity service under load
- Increase health check timeout values
- Review database connection pool settings in
appsettings.json - Check Identity service resource allocation
Best Practices
Use Different Endpoints
Use
/healthz for liveness probes and /healthz/extended for readiness probes to get appropriate granularity.Set Appropriate Timeouts
Configure health check timeouts longer than your monitoring interval to avoid false positives.
Monitor Trends
Track health check response times to identify performance degradation before failures occur.
Alert on Patterns
Alert on multiple consecutive failures rather than single failures to reduce noise.