CodingSaves ~30 minutes

Write a health check endpoint

Build accurate health check endpoints that Kubernetes and load balancers can rely on.

The prompt

You are a site reliability engineer. Implement comprehensive health check endpoints for a [LANGUAGE/FRAMEWORK] application. Implement two endpoints: /health/live (liveness — is the process running? Should always return 200 unless the process is crashed, used by Kubernetes liveness probe), and /health/ready (readiness — is the service ready to handle traffic? Checks dependencies, used by Kubernetes readiness probe and load balancers). The readiness check must verify: database connectivity with a test query, Redis/cache connectivity, any critical external service connectivity, and disk space if applicable. Return a structured JSON response with overall status and per-dependency status. Add a timeout so a slow dependency doesn't hang the check.

Dependencies to check: [LIST: e.g. PostgreSQL, Redis, Stripe API]
Framework: [FRAMEWORK]
Timeout per check: [MILLISECONDS]

Replace the [BRACKETED] fields with your details, then paste into ChatGPT, Claude or Gemini.

Want AI to fill this in for you?

Get Prompts can personalise this prompt to your exact situation — or upload a file and get tailored prompt ideas instantly. 3 free edits, no sign-up.

Try it free →

More coding prompts