Skip to content

feat(selfhost): add Postgres observability dashboards - #2115

Merged
JSONbored merged 1 commit into
mainfrom
codex/postgres-observability-2011
Jul 1, 2026
Merged

feat(selfhost): add Postgres observability dashboards#2115
JSONbored merged 1 commit into
mainfrom
codex/postgres-observability-2011

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

Part of #2011. This adds the Postgres observability slice for self-host operators: exporter wiring, Prometheus scrape jobs, Grafana panels, alerts, backup freshness metrics, and operations docs.

What changed

  • Added a Postgres exporter sidecar for Postgres-backed self-host deployments.
  • Added a read-only backup freshness exporter for the retained backup volume.
  • Added Prometheus scrape jobs for Postgres internals and backup freshness.
  • Added Grafana panels for connection count/state, lock waits, slow transactions, deadlocks, database/table growth, dead tuples, autovacuum activity, and backup age/file counts.
  • Added Prometheus alerts for connection pressure, lock waits, slow transactions, deadlocks, rapid DB growth, dead tuple pressure, missing backups, and stale backups.
  • Updated self-host operations docs with the Postgres observability commands and routine checks.

Why

After the SQLite-to-Postgres cutover work, operators need first-class visibility into whether Postgres is healthy or becoming the next queue bottleneck. This makes the default self-host observability stack show the database pressure signals directly instead of requiring manual container inspection.

Validation

  • npx vitest run test/unit/selfhost-backup-metrics-script.test.ts test/unit/selfhost-observability-config.test.ts test/unit/selfhost-grafana-dashboard.test.ts
  • npx vitest run test/unit/selfhost-backup-metrics-script.test.ts test/unit/selfhost-observability-config.test.ts test/unit/selfhost-grafana-dashboard.test.ts test/unit/codecov-policy.test.ts
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run typecheck
  • docker compose --profile postgres --profile observability --profile backup config
  • npm run test:ci
  • npm audit --audit-level=moderate

Notes

The Postgres exporter is scoped to the Postgres profiles, so SQLite-only observability installs do not start it against a missing database. Backup freshness metrics are opt-in with the backup profile.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gittensory-ui 5ed3d54 Commit Preview URL

Branch Preview URL
Jul 01 2026, 09:17 AM

@JSONbored JSONbored self-assigned this Jul 1, 2026
@JSONbored JSONbored linked an issue Jul 1, 2026 that may be closed by this pull request
4 tasks
@JSONbored
JSONbored merged commit ee30ff2 into main Jul 1, 2026
11 checks passed
@JSONbored
JSONbored deleted the codex/postgres-observability-2011 branch July 1, 2026 09:23
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jul 1, 2026
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.71%. Comparing base (704cebc) to head (5ed3d54).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2115   +/-   ##
=======================================
  Coverage   95.71%   95.71%           
=======================================
  Files         222      222           
  Lines       24620    24620           
  Branches     8936     8936           
=======================================
  Hits        23565    23565           
  Misses        432      432           
  Partials      623      623           
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

Postgres reliability/scale hardening (post-cutover)

1 participant