Skip to content

feat(db): add connection pool configuration and metrics - #1813

Merged
github-actions[bot] merged 1 commit into
Smartdevs17:mainfrom
favvy0217:fix/issue-1797-connection-pool-config
Oct 17, 2026
Merged

github-actions[bot] merged 1 commit into
Smartdevs17:mainfrom
favvy0217:fix/issue-1797-connection-pool-config

Conversation

@favvy0217

Copy link
Copy Markdown
Contributor

Summary

Resolves #1797

Exposes pool configuration with sane defaults and adds a metrics collector that samples pool health counters for monitoring and alerting.

Changes

  • Add PoolTuningOptions to DatabaseConfig: min connections, max client uses, query wait warning threshold, metrics enable/interval/alert threshold
  • Create PoolMetricsCollector class with periodic sampling, edge-triggered alerts, and health summary
  • Add max property to Pool interface for metrics derivation
  • Export PoolMetricsCollector and types from connectionPool module
  • Document all pool env vars in .env.example
  • 16 new test cases (12 for pool metrics + 4 for config)

Acceptance Criteria

  • Configurable — all pool sizing via env vars with documented defaults
  • Metrics exposed — PoolMetricsCollector produces structured snapshots
  • Tested — 16 new test cases

…1797)

Expose pool configuration with sane defaults and add a metrics collector
that samples pool health counters (total, idle, waiting, active, utilization)
for monitoring and alerting.

Changes:
- Add PoolTuningOptions to DatabaseConfig: min connections, max client uses,
  query wait warning threshold, metrics enable/interval/alert threshold
- Create PoolMetricsCollector class with periodic sampling, edge-triggered
  alerts on utilization threshold crossing, and health summary endpoint data
- Add max property to Pool interface for metrics derivation
- Export PoolMetricsCollector and types from connectionPool module
- Document all pool env vars in .env.example
- Add comprehensive tests for pool metrics (12 test cases) and pool tuning
  config (4 test cases)

Acceptance criteria:
- [x] Configurable — all pool sizing via env vars with documented defaults
- [x] Metrics exposed — PoolMetricsCollector produces structured snapshots
      with utilization, saturation, and health summary
- [x] Tested — 16 new test cases covering metrics collection, alerting,
      and configuration loading
@drips-wave

drips-wave Bot commented Oct 17, 2026

Copy link
Copy Markdown

@favvy0217 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@github-actions
github-actions Bot merged commit 85eb42b into Smartdevs17:main Oct 17, 2026
13 of 30 checks passed
@favvy0217
favvy0217 deployed to security-review October 17, 2026 10:50 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
security-review — 00f00e7d Deployed Oct 17, 2026 by favvy0217 via Security Dashboard #1363
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add database connection pooling configuration

2 participants