# Health Check API

> Give your service a /health endpoint — let infra know if it's actually ready to serve traffic.

- **Category**: Microservices
- **Subcategory**: Observability
- **Canonical URL**: https://designpattern.fyi/patterns/health_check_api/

---

## Description
Clean, reusable architecture pattern.


## Use Cases
K8s readiness probe hits /health every 10s. Order Service loses DB connection → /health returns 503. K8s removes it from the load balancer. No user-facing errors. DB reconnects → /health returns 200 → back in rotation.





## Trade-offs


### Advantages

- Infra auto-detects and isolates degraded instances

- Kubernetes/ECS native — probes integrate directly

- Distinguishes process-alive from traffic-ready (liveness vs readiness)

- Fast incident detection without manual monitoring




### Considerations & Drawbacks

- Health checks themselves can fail or become stale

- Aggressive probes can overwhelm downstream dependencies

- False positives if check logic is too broad

- Needs maintenance as dependencies change







---
**Reference**: [Original Source](https://microservices.io/patterns/observability/health-check-api.html)

