
Gatus Health & Uptime Monitoring Implementer (Any Project)
Use with Claude Code / Cursor CLI to inspect any project's stack, implement a /health endpoint, generate Gatus Docker + config.yaml monitoring, and verify the build.
You are a Senior DevOps & Full-Stack Engineer. Objective Inspect the current repository ({{projectnameorpath}}), understand its tech stack, services, database connections, and deployment architecture, and implement Gatus (open-source, self-hosted health & uptime monitoring) tailored specifically to this project. --- Step 1: Codebase Discovery (Execute First) Before writing any code or config files: 1. Identify the framework/runtime (e.g., Next.js, FastAPI, Spring Boot, Express, Go, etc.) and existing API routing structure. 2. Identify critical dependencies (databases, Redis/queues, external APIs, storage, auth providers, microservices) and environment variables (.env.example). 3. Check for existing Dockerfile, docker-compose.yml, or CI/CD workflows. --- Step 2: Implementation Tasks 1. Application Health Endpoint ({{healthroute}}, default /api/health or /health): - Implement a lightweight health check endpoint matching the project's exact framework conventions. - Verify connectivity to critical dependencies (e.g., DB ping, essential external service check) without exposing sensitive secrets. - Return structured JSON ({ status: "ok" | "degraded" | "down", timestamp, checks: {...} }) with HTTP 200 when healthy and 503 when a critical dependency fails. 2. Gatus Configuration (gatus/config.yaml): - Create gatus/config.yaml configured with: - Persistent storage (SQLite by default at /data/data.db or Postgres if available). - Endpoint checks tailored to this project's URLs ({{appbaseurl}}, {{healthroute}}, and any secondary endpoints/docs/APIs discovered in the repo). - Strict assertions: [STATUS] == 200, [BODY].status == ok, [RESPONSETIME] < 1000, and [CERTIFICATEEXPIRATION] > 720h (for HTTPS targets). - Alerting template ready for {{alertprovider}} (e.g., Discord, Slack, Email, or Webhook) controlled via environment variables. 3. Docker & Local/Production Deployment (docker-compose.gatus.yml): - Create docker-compose.gatus.yml (or integrate cleanly into the existing Compose setup) using twinproduction/gatus:latest. - Mount ./gatus/config.yaml:/config/config.yaml and a persistent volume for /data. - Expose port {{gatusport}} (default 8080) and pass required .env variables. 4. Documentation & Verification: - Update README.md (or add gatus/README.md) with clear commands to run Gatus locally, validate config.yaml, and connect alerts. - Run the project's build/test suite ({{buildcommand}}) and verify the new health endpoint works cleanly with zero regressions. --- Final Output Provide a concise summary of: - Files Created / Modified - Endpoints & Dependencies Monitored - Quick-Start Commands to launch and test Gatus♥ 10 replies