Health Endpoint
ELI5 — The Vibe Check
A health endpoint is a simple URL (usually /health or /healthz) that returns 'I'm alive and everything's fine' or 'something's broken.' Load balancers and Kubernetes check this constantly to know if your server is healthy. It's your app's heartbeat monitor.
Real Talk
A health endpoint is an HTTP endpoint that reports the application's operational status. Basic health checks return 200 OK if the process is running. Deep health checks verify dependencies (database, cache, external services). Used by load balancers, orchestrators, and monitoring systems for automated health verification and traffic routing decisions.
Show Me The Code
app.get('/health', async (req, res) => {
try {
await db.query('SELECT 1');
await redis.ping();
res.json({ status: 'healthy', uptime: process.uptime() });
} catch (err) {
res.status(503).json({ status: 'unhealthy', error: err.message });
}
});
When You'll Hear This
"The load balancer checks /health every 10 seconds and removes unhealthy instances." / "Add database and Redis checks to the health endpoint, not just a 200 OK."
Related Terms
Liveness Probe
A liveness probe is Kubernetes repeatedly poking your app and asking 'are you still alive?
Load Balancer
A load balancer is like a traffic cop for servers.
Monitoring
Monitoring is keeping a constant eye on your app while it runs — tracking whether it's up, how fast it responds, how many errors it throws, and how much me...
Readiness Probe
A readiness probe tells Kubernetes 'I'm ready to receive traffic.