-
Notifications
You must be signed in to change notification settings - Fork 19
Closed
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave programbackendgood first issueGood for newcomersGood for newcomers
Description
Description:
Implement a HealthModule that exposes comprehensive health check and readiness endpoints so that infrastructure tools (load balancers, Kubernetes probes, uptime monitors) can verify system status.
Requirements:
- Install
@nestjs/terminus - Create a
HealthControllerwith:GET /api/health— liveness probe (returns200 OKwith{ status: "ok" }if the process is running)GET /api/health/ready— readiness probe that checks:- PostgreSQL connectivity (via TypeORM
DataSource) - Disk space (warn if less than 500MB free)
- PostgreSQL connectivity (via TypeORM
GET /api/health/detailed— full status including DB response time, disk usage, Node.js memory usage (process.memoryUsage()), and uptime
- Create a
SystemMetricsServicewith:getMemoryUsage()— returns{ heapUsed, heapTotal, rss }in MBgetUptime()— returns process uptime in secondsgetDiskUsage()— checks free space on the upload directory
- The readiness endpoint must return
503if any critical check fails
Acceptance Criteria:
GET /api/healthalways returns200(pure liveness — never fails)GET /api/health/readyreturns503when the DB is unreachable- Unit tests mock the DB check and disk check
- Swagger docs on all three endpoints
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave programbackendgood first issueGood for newcomersGood for newcomers