Health Check Endpoints

Health Check Endpoints

Implements health check endpoints for liveness, readiness and dependency monitoring, with examples in Express, Flask and Spring Boot for Kubernetes and load balancers.

Skill files6 files

references/

scripts/

templates/

SKILL.md98 lines
1
---
2
name: health-check-endpoints
3
description: >
4
Implement comprehensive health check endpoints for liveness, readiness, and
5
dependency monitoring. Use when deploying to Kubernetes, implementing load
6
balancer health checks, or monitoring service availability.
7
---
8
9
# Health Check Endpoints
10
11
## Table of Contents
12
13
- [Overview](#overview)
14
- [When to Use](#when-to-use)
15
- [Quick Start](#quick-start)
16
- [Reference Guides](#reference-guides)
17
- [Best Practices](#best-practices)
18
19
## Overview
20
21
Implement health check endpoints to monitor service health, dependencies, and readiness for traffic.
22
23
## When to Use
24
25
- Kubernetes liveness and readiness probes
26
- Load balancer health checks
27
- Service discovery and registration
28
- Monitoring and alerting systems
29
- Circuit breaker decisions
30
- Auto-scaling triggers
31
- Deployment verification
32
33
## Quick Start
34
35
Minimal working example:
36
37
```typescript
38
import express from "express";
39
import { Pool } from "pg";
40
import Redis from "ioredis";
41
42
interface HealthStatus {
43
status: "healthy" | "degraded" | "unhealthy";
44
timestamp: string;
45
uptime: number;
46
checks: Record<string, CheckResult>;
47
version?: string;
48
environment?: string;
49
}
50
51
interface CheckResult {
52
status: "pass" | "fail" | "warn";
53
time: number;
54
output?: string;
55
error?: string;
56
}
57
58
class HealthCheckService {
59
private startTime = Date.now();
60
private version = process.env.APP_VERSION || "1.0.0";
61
private environment = process.env.NODE_ENV || "development";
62
63
// ... (see reference guides for full implementation)
64
```
65
66
## Reference Guides
67
68
Detailed implementations in the `references/` directory:
69
70
| Guide | Contents |
71
|---|---|
72
| [Express.js Health Checks](references/expressjs-health-checks.md) | Express.js Health Checks |
73
| [Spring Boot Actuator-Style (Java)](references/spring-boot-actuator-style-java.md) | Spring Boot Actuator-Style (Java) |
74
| [Python Flask Health Checks](references/python-flask-health-checks.md) | Python Flask Health Checks |
75
76
## Best Practices
77
78
### ✅ DO
79
80
- Implement separate liveness and readiness probes
81
- Keep liveness probes lightweight
82
- Check critical dependencies in readiness
83
- Return appropriate HTTP status codes
84
- Include response time metrics
85
- Set reasonable timeouts
86
- Cache health check results briefly
87
- Include version and environment info
88
- Monitor health check failures
89
90
### ❌ DON'T
91
92
- Make liveness probes check dependencies
93
- Return 200 for failed health checks
94
- Take too long to respond
95
- Skip important dependency checks
96
- Expose sensitive information
97
- Ignore health check failures
98

© AJ Geddes · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…