Post

Alert on stalled PostgreSQL readiness probes and retire Octelium target

Alert on stalled PostgreSQL readiness probes and retire Octelium target

This push updates Grafana PostgreSQL alerting to detect stalled readiness probes over time, drops the retired Octelium target, and adds an offline CI test for the provisioned alert expression. I made the change because a single missed scrape should not be the only signal that a database is unhealthy.

Probe-stalled alert expression in Grafana provisioning

I changed the PostgreSQL availability alert in clusters/homelab/apps/grafana/values.yaml from point-in-time absent() checks to absent_over_time(...[2m]) so the rule fires when successful readiness probes stop appearing for two minutes instead of only on a single missed scrape. I also switched the numeric comparison to == bool 0 and bumped alerting-provisioning-version from 22 to 23. The alert now watches affine-postgres-0, media-postgres-local-0, and n8n-postgres-0 across the affine, media, and automation namespaces.

Octelium PostgreSQL removal from alert scope

I removed octelium-storage and octelium-postgres-0 from the PromQL namespace and pod matchers because the Octelium workload is retired. This keeps the alert scoped to active PostgreSQL instances and avoids evaluating a target that no longer emits probes.

Offline CI test for the alert rule

I added scripts/ci/grafana-postgres-alert-check.py, an offline test that loads the Grafana values file with yq, runs the provisioned PromQL expression against synthetic probe series, and checks the alert condition over a three-minute evaluation window. The test targets affine, automation, and media, treats octelium-storage as retired, and is invoked from scripts/ci/offline-checks.sh. This is a test addition, not evidence that the alert has passed against live cluster metrics.

Deployment status and transfer to platform teams

The change is merged code and has not yet been deployed or runtime verified. The next check is to run scripts/ci/offline-checks.sh, confirm the new Python test passes, then apply the provisioning version bump so the updated alert rule ships to Grafana. A platform team can reuse this pattern by pairing any provisioned PromQL alert with an offline CI test that replays the expression against captured series before deployment.

This post is licensed under CC BY 4.0 by the author.