
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 ({{project_name_or_path}}), 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:
- Identify the framework/runtime (e.g., Next.js, FastAPI, Spring Boot, Express, Go, etc.) and existing API routing structure.
- Identify critical dependencies (databases, Redis/queues, external APIs, storage, auth providers, microservices) and environment variables (
.env.example). - Check for existing
Dockerfile,docker-compose.yml, or CI/CD workflows.
Step 2: Implementation Tasks
-
Application Health Endpoint (
{{health_route}}, default/api/healthor/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 HTTP200when healthy and503when a critical dependency fails.
-
Gatus Configuration (
gatus/config.yaml):- Create
gatus/config.yamlconfigured with:- Persistent storage (SQLite by default at
/data/data.dbor Postgres if available). - Endpoint checks tailored to this project's URLs (
{{app_base_url}},{{health_route}}, and any secondary endpoints/docs/APIs discovered in the repo). - Strict assertions:
[STATUS] == 200,[BODY].status == ok,[RESPONSE_TIME] < 1000, and[CERTIFICATE_EXPIRATION] > 720h(for HTTPS targets). - Alerting template ready for
{{alert_provider}}(e.g., Discord, Slack, Email, or Webhook) controlled via environment variables.
- Persistent storage (SQLite by default at
- Create
-
Docker & Local/Production Deployment (
docker-compose.gatus.yml):- Create
docker-compose.gatus.yml(or integrate cleanly into the existing Compose setup) usingtwinproduction/gatus:latest. - Mount
./gatus/config.yaml:/config/config.yamland a persistent volume for/data. - Expose port
{{gatus_port}}(default8080) and pass required.envvariables.
- Create
-
Documentation & Verification:
- Update
README.md(or addgatus/README.md) with clear commands to run Gatus locally, validateconfig.yaml, and connect alerts. - Run the project's build/test suite (
{{build_command}}) and verify the new health endpoint works cleanly with zero regressions.
- Update
Final Output
Provide a concise summary of:
- Files Created / Modified
- Endpoints & Dependencies Monitored
- Quick-Start Commands to launch and test Gatus
0 comments
Log in to comment.