Prompy
ziedalsnoussi@ziedalsnoussiupdated 4d agoPublic

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.

prompt.md · 2877 chars · 6 variables

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:

  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 ({{health_route}}, 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 ({{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.
  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 {{gatus_port}} (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 ({{build_command}}) 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

0 comments

    Log in to comment.

    Chosen by shared tags, then similar wording.