Skip to content

feat(stats): add banned gauge to pool metrics - #1443

Open
ChrisJr404 wants to merge 1 commit into
pgdogdev:mainfrom
ChrisJr404:stats-banned-metric
Open

feat(stats): add banned gauge to pool metrics#1443
ChrisJr404 wants to merge 1 commit into
pgdogdev:mainfrom
ChrisJr404:stats-banned-metric

Conversation

@ChrisJr404

Copy link
Copy Markdown

Closes #1424. Adds a banned gauge to the per-pool OpenMetrics output so you can alert on a database being banned instead of inferring it from the socket counts, which don't reliably drop to zero for every kind of failure.

It reuses the same ban state that SHOW BANS reports (switched the metrics loop to pools_with_roles_and_bans), emitting one measurement per pool with the usual database/user/host/shard/role labels: 1 when the pool is banned, 0 when it's available. Added a render test next to the existing pool metric tests.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@levkk levkk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! Happy to merge if you sign the CLA.

@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

Metric to indicate the banned status of a database

3 participants