Health Checks
Health Checks
Laravel Health ships with 11 built-in checks. Each implements the HealthCheck contract and returns a CheckResult with status ok, warning, critical, or unknown.
Available Checks
| Check | Class | What it does |
|---|---|---|
| Database | DatabaseCheck |
Verifies database connectivity via PDO |
| Cache | CacheCheck |
Write/read/delete test key |
| Queue | QueueCheck |
Reports queue size |
| Storage | StorageCheck |
Write/delete test file on disk |
| Redis | RedisCheck |
Sends PING to Redis |
| Environment | EnvironmentCheck |
Verifies required env vars exist |
| Schedule | ScheduleCheck |
Checks scheduler heartbeat freshness |
| CPU | CpuCheck |
Load average normalized per core |
| Memory | MemoryCheck |
System memory usage (cgroup aware) |
| Disk Space | DiskSpaceCheck |
Mount point usage percentage |
Choosing Checks per Endpoint
Not every check belongs on every probe. The wrong check on the wrong probe can cause cascading failures — see Kubernetes Probes: Cascading Failures for the full explanation.
Liveness — only checks that detect a stuck process. A restart should fix the problem. In most applications, DatabaseCheck alone is correct.
Readiness — all dependencies the app needs to serve a request. When a check fails here, the pod stops receiving traffic but stays alive, recovering automatically when the dependency returns.
Startup — one-time validation at boot (e.g. EnvironmentCheck). Does not run after the pod is ready.
'checks' => [
'liveness' => [
DatabaseCheck::class,
],
'readiness' => [
DatabaseCheck::class,
CacheCheck::class,
QueueCheck::class,
StorageCheck::class,
],
'startup' => [
EnvironmentCheck::class,
],
],
Related Documentation
- Kubernetes Probes — probe design strategy and cascading failure prevention
- Configuration
- Custom Checks
- Endpoints