Health Check Endpoints
Monitor application health status.
Endpointโ
GET /api/health
No authentication required. Returns application health status.
Responseโ
{
"status": "ok",
"info": {
"database": { "status": "up" },
"redis": { "status": "up" },
"memory": { "status": "up", "rss": "256MB" }
},
"error": {},
"details": {
"database": { "status": "up" },
"redis": { "status": "up" }
}
}
Health Indicatorsโ
| Indicator | Checks | Critical |
|---|---|---|
| Database | PostgreSQL connection alive | Yes |
| Redis | Redis connection alive | Yes |
| Memory | RSS below threshold | No |
| Disk | Disk space available | No |
Status Codesโ
| HTTP Code | Status | Description |
|---|---|---|
| 200 | Healthy | All indicators up |
| 503 | Unhealthy | One or more indicators down |
Usage in Dockerโ
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
Usage in Kubernetesโ
livenessProbe:
httpGet:
path: /api/health
port: 3000
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
httpGet:
path: /api/health
port: 3000
initialDelaySeconds: 5
periodSeconds: 5
Related Pagesโ
- Prometheus Metrics โ metrics monitoring
- Production Deployment โ deployment