Area: backend · Effort: S
What: Monitor database connection pool utilisation and alert when the pool is near exhaustion before it causes request failures.
Why: A saturated connection pool causes all requests to queue and eventually time out. Early warnings give operators time to scale before users are impacted.
Acceptance Criteria:
- Pool utilisation (used/max) is exported as a Prometheus gauge
- An alert fires when utilisation exceeds 80% for more than 60 seconds
- Pool stats are included in the
/health endpoint response
- Connection wait time is tracked as a histogram
Hints:
backend/src/database/database-monitor.service.ts
- TypeORM's DataSource exposes pool stats via the underlying
pg driver
- Alert via the existing notification service, not just PagerDuty
Area: backend · Effort: S
What: Monitor database connection pool utilisation and alert when the pool is near exhaustion before it causes request failures.
Why: A saturated connection pool causes all requests to queue and eventually time out. Early warnings give operators time to scale before users are impacted.
Acceptance Criteria:
/healthendpoint responseHints:
backend/src/database/database-monitor.service.tspgdriver