Skip to content

#1042 Implement database connection health monitoring with alerting #569

Description

@vic-Gray

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    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