Implement comprehensive health check endpoints for liveness, readiness, and dependency monitoring. Use when deploying to Kubernetes, implementing load balancer health checks, or monitoring service availability.
Implement health check endpoints to monitor service health, dependencies, and readiness for traffic.
Minimal working example:
import express from "express";
import { Pool } from "pg";
import Redis from "ioredis";
interface HealthStatus {
status: "healthy" | "degraded" | "unhealthy";
timestamp: string;
uptime: number;
checks: Record<string, CheckResult>;
version?: string;
environment?: string;
}
interface CheckResult {
status: "pass" | "fail" | "warn";
time: number;
output?: string;
error?: string;
}
class HealthCheckService {
private startTime = Date.now();
private version = process.env.APP_VERSION || "1.0.0";
private environment = process.env.NODE_ENV || "development";
// ... (see reference guides for full implementation)
Detailed implementations in the references/ directory:
| Guide | Contents | |---|---| | Express.js Health Checks | Express.js Health Checks | | Spring Boot Actuator-Style (Java) | Spring Boot Actuator-Style (Java) | | Python Flask Health Checks | Python Flask Health Checks |
Copy a source-pinned command for your client. You run it yourself.
Destination: .claude/skills/health-check-endpoints · pinned to the source commit
git clone https://github.com/aj-geddes/useful-ai-prompts.git
cd useful-ai-prompts
git checkout 3f5182cfd739fc113f4af5244a1cf342ad7f7911
mkdir -p ".claude/skills/health-check-endpoints"
cp -r "skills/health-check-endpoints" ".claude/skills/health-check-endpoints"Review the source before running. This copies files into your project; it is not a one-click install and does not verify runtime safety.
Scanner static-checks@0.1.0 · commit 3f5182cfd739. Static checks cannot prove runtime safety – review the source and the exact diff before installing. How checks work.
References credentials, tokens or secret files that a skill should not need.
Evidence: [redacted]· fingerprint e9cbb0224c4a3d23