Skip to content

[Infrastructure] Implement health check endpoints with dependency status reporting #178

Description

@Penielka

Description

Add /health (liveness) and /health/ready (readiness) endpoints that report the status of all dependencies: database connectivity, Redis connectivity, Stellar RPC reachability, IPFS node status, and disk space. These are critical for Kubernetes/container orchestration and load balancer health checks.

Definition of Done

  • GET /health returns 200 if process is alive (liveness probe)
  • GET /health/ready returns 200 only if all dependencies are healthy (readiness probe)
  • Dependency checks: PostgreSQL, Redis, Stellar RPC, IPFS node
  • Each dependency check has configurable timeout (default 5s)
  • Response includes per-dependency status: { "database": "up", "redis": "up", ... }
  • Cache dependency check results for 10 seconds to avoid thundering herd
  • Endpoints excluded from rate limiting and request logging
  • Docker HEALTHCHECK instruction added to Dockerfiles

Acceptance Criteria

  1. curl /health returns 200 with {"status": "ok"}
  2. curl /health/ready returns 200 when all deps are up, 503 when any dep is down
  3. Response body shows per-dependency status for debugging
  4. Kubernetes/docker-compose uses these for health checks

Files to Modify

  • New file: backend/src/routes/health.ts — health check routes
  • backend/src/index.ts — register health routes
  • backend/src/config/redis.ts — add ping method
  • backend/Dockerfile — add HEALTHCHECK instruction
  • frontend/Dockerfile — add HEALTHCHECK instruction
  • docker-compose.yml — add healthcheck configs
  • backend/src/docs/openapi.ts — document health endpoints

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions