docs: record postgres health store modes

This commit is contained in:
Siavash Sameni
2026-06-01 14:00:16 +04:00
parent 7b5dbb2683
commit 5352a78e96
3 changed files with 39 additions and 7 deletions

View File

@@ -14,14 +14,14 @@ What's instrumented today and what to watch. Today's stack is intentionally lean
Two paths are registered (both are public, rate-limited, not auth-gated):
- `GET /health` — simple ping used by Docker healthchecks. Returns `200 { success, message, timestamp, environment, version }`. Does **not** probe MongoDB or Redis.
- `GET /api/health` — deep health check added in commit `44579d6` (backend v2.6.49). Calls `runHealthChecks` from `backend/src/services/health/healthCheckService.ts`. Probes MongoDB, Postgres, Redis, Request Network registry data, and Request Network API reachability. Returns `503` only when `report.status === 'down'`. As of backend `2.8.9`, Postgres is a hard dependency only when at least one `*_STORE=postgres` flag is enabled; otherwise an unconfigured Postgres check is reported as skipped.
- `GET /api/health` — deep health check added in commit `44579d6` (backend v2.6.49). Calls `runHealthChecks` from `backend/src/services/health/healthCheckService.ts`. Probes MongoDB, Postgres, Redis, Request Network registry data, and Request Network API reachability. Returns `503` only when `report.status === 'down'`. As of backend `2.8.11`, Postgres is a hard dependency only when at least one `*_STORE=postgres` flag is enabled; otherwise an unconfigured Postgres check is reported as skipped. The Postgres check also reports active store modes so monitoring can distinguish "PG is reachable" from "this runtime is actually using PG-backed stores".
`GET /api/health` response shape (from `healthCheckService`):
```json
{
"status": "ok",
"version": "2.6.xx",
"timestamp": "...",
"version": "2.8.11",
"uptimeSec": 662,
"checks": {
"db": { "ok": true, "latencyMs": 4 },
"postgres": {
@@ -29,6 +29,25 @@ Two paths are registered (both are public, rate-limited, not auth-gated):
"latencyMs": 5,
"configured": true,
"required": true,
"storeModes": {
"auth": "postgres",
"config": "postgres",
"address": "postgres",
"category": "postgres",
"levelConfig": "postgres",
"shopSettings": "postgres",
"review": "postgres"
},
"enabledStores": [
"auth",
"config",
"address",
"category",
"levelConfig",
"shopSettings",
"review"
],
"enabledStoreCount": 7,
"database": "amanat_dev",
"user": "amanat"
},