Implement health check endpoints to monitor service health, dependencies, and readiness for traffic.
When to Use
Kubernetes liveness and readiness probes
Load balancer health checks
Service discovery and registration
Monitoring and alerting systems
Circuit breaker decisions
Auto-scaling triggers
Deployment verification
Quick Start
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)
Reference Guides
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
Best Practices
✅ DO
Implement separate liveness and readiness probes
Keep liveness probes lightweight
Check critical dependencies in readiness
Return appropriate HTTP status codes
Include response time metrics
Set reasonable timeouts
Cache health check results briefly
Include version and environment info
Monitor health check failures
❌ DON'T
Make liveness probes check dependencies
Return 200 for failed health checks
Take too long to respond
Skip important dependency checks
Expose sensitive information
Ignore health check failures
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: aj-geddes-useful-ai-prompts-health-check-endpoints3description: Health Check Endpoints4---56# Health Check Endpoints78## Table of Contents910- [Overview](#overview)11- [When to Use](#when-to-use)12- [Quick Start](#quick-start)13- [Reference Guides](#reference-guides)14- [Best Practices](#best-practices)1516## Overview1718Implement health check endpoints to monitor service health, dependencies, and readiness for traffic.1920## When to Use2122- Kubernetes liveness and readiness probes23- Load balancer health checks24- Service discovery and registration25- Monitoring and alerting systems26- Circuit breaker decisions27- Auto-scaling triggers28- Deployment verification2930## Quick Start3132Minimal working example:3334```typescript35import express from "express";36import { Pool } from "pg";37import Redis from "ioredis";3839interface HealthStatus {40 status: "healthy" | "degraded" | "unhealthy";41 timestamp: string;42 uptime: number;43 checks: Record<string, CheckResult>;44 version?: string;45 environment?: string;46}4748interface CheckResult {49 status: "pass" | "fail" | "warn";50 time: number;51 output?: string;52 error?: string;53}5455class HealthCheckService {56 private startTime = Date.now();57 private version = process.env.APP_VERSION || "1.0.0";58 private environment = process.env.NODE_ENV || "development";5960// ... (see reference guides for full implementation)61```6263## Reference Guides6465Detailed implementations in the `references/` directory:6667| Guide | Contents |68|---|---|69| [Express.js Health Checks](references/expressjs-health-checks.md) | Express.js Health Checks |70| [Spring Boot Actuator-Style (Java)](references/spring-boot-actuator-style-java.md) | Spring Boot Actuator-Style (Java) |71| [Python Flask Health Checks](references/python-flask-health-checks.md) | Python Flask Health Checks |7273## Best Practices7475### ✅ DO7677- Implement separate liveness and readiness probes78- Keep liveness probes lightweight79- Check critical dependencies in readiness80- Return appropriate HTTP status codes81- Include response time metrics82- Set reasonable timeouts83- Cache health check results briefly84- Include version and environment info85- Monitor health check failures8687### ❌ DON'T8889- Make liveness probes check dependencies90- Return 200 for failed health checks91- Take too long to respond92- Skip important dependency checks93- Expose sensitive information94- Ignore health check failures9596---97> Converted and distributed by [TomeVault](https://tomevault.io/claim/aj-geddes) — claim your Tome and manage your conversions.98<!-- tomevault:4.0:skill_md:2026-04-11 -->
Run npx skillmds@latest add tomevault-io/aj-geddes-useful-ai-prompts-health-check-endpoints in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Health Check Endpoints It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
tomevault-io (@tomevault-io) published this skill. Their other Agent Skills are listed on their SkillMD profile.