You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: pooler stats metrics disappear when PgBouncer adds a SHOW STATS column #11365
The pooler stops exporting every cnpg_pgbouncer_stats_* metric and logs this on each scrape:
Error while executing SHOW STATS ... sql: expected 25 destination arguments in Scan, not 23
collectShowStats picks the scan layout from the number of columns (< 16, == 17, default 23). PgBouncer keeps adding columns — total_client_login_count and avg_client_login_count are the newest pair — so a build past the known counts falls into the default branch and the scan fails. It already happened once with 1.24 (#6566) and will happen again on the next column.
Pool metrics keep working, so the pooler looks healthy while its throughput and wait-time series are gone.
To reproduce: run a Pooler on a PgBouncer that reports 25 SHOW STATS columns and read /metrics on port 9127 — only cnpg_pgbouncer_pools_* are there.
Fix in #11366: bind the scan destinations to the column names from rows.Columns() and skip names the collector does not know.
Separately, ShowStatsMetrics.Reset resets TotalClientParseCount and TotalServerParseCount twice and never resets AvgClientParseCount and AvgServerParseCount, so a database that disappears keeps its last averages.
Activity
fix(pgbouncer): bind `SHOW STATS` columns by name (#11366)
fix(pgbouncer): bind `SHOW STATS` columns by name (#11366)
fix(pgbouncer): bind `SHOW STATS` columns by name (#11366)
fix(pgbouncer): bind `SHOW STATS` columns by name (#11366)