pgbouncer in GPRD has an invalid user in SHOW POOLS
While testing the pgbouncer exporter against GPRD, I noticed it was failing hard here:
column name is user, data is ˇˇˇˇC
panic: label value "\xff\xff\xff\xffC" is not valid UTF-8
goroutine 19 [running]:
github.com/prometheus/client_golang/prometheus.MustNewConstMetric(0xc420147500, 0x2, 0x0, 0xc420180340, 0x2, 0x2, 0x0, 0x0)
/home/stanhu/go/src/github.com/prometheus/client_golang/prometheus/value.go:98 +0xb0
main.queryNamespaceMapping(0xc42012c600, 0xc420110c80, 0x8f7bd9, 0x5, 0xc42011eed0, 0x0, 0x0, 0x0, 0x0, 0x0)
/home/stanhu/go/src/github.com/larseen/pgbouncer_exporter/collector.go:146 +0xa51
main.queryNamespaceMappings(0xc42012c600, 0xc420110c80, 0xc42011eba0, 0xc420116e60)
/home/stanhu/go/src/github.com/larseen/pgbouncer_exporter/collector.go:229 +0x213
main.(*Exporter).scrape(0xc42015c900, 0xc42012c600)
/home/stanhu/go/src/github.com/larseen/pgbouncer_exporter/collector.go:295 +0x18c
main.(*Exporter).Collect(0xc42015c900, 0xc42012c600)
/home/stanhu/go/src/github.com/larseen/pgbouncer_exporter/collector.go:276 +0x3c
main.(*Exporter).Describe(0xc42015c900, 0xc42012c5a0)
/home/stanhu/go/src/github.com/larseen/pgbouncer_exporter/collector.go:269 +0xb0
github.com/prometheus/client_golang/prometheus.(*Registry).Register.func1(0xb09b80, 0xc42015c900, 0xc42012c5a0)
/home/stanhu/go/src/github.com/prometheus/client_golang/prometheus/registry.go:250 +0x3b
created by github.com/prometheus/client_golang/prometheus.(*Registry).Register
If you look at SHOW POOLS
, you see the C
under gitlabhq_production_sidekiq
. I haven't checked production yet, but I wonder where this garbage comes from:
root@pgbouncer-01-db-gprd.c.gitlab-production.internal:/tmp# sudo -u gitlab-psql /opt/gitlab/embedded/bin/psql -h /tmp -p 6432 -U pgbouncer -d pgbouncer
psql (9.6.5, server 1.7.2/bouncer)
Type "help" for help.
pgbouncer=# show pools;
database | user | cl_active | cl_waiting | sv_active | sv_idle | sv_used | sv_tested | sv_login | maxwait | pool_mode
-----------------------------+----------------+-----------+------------+-----------+---------+---------+-----------+----------+---------+-------------
gitlabhq_production | chatops | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | transaction
gitlabhq_production | gitlab | 274 | 0 | 0 | 4 | 1 | 0 | 0 | 0 | transaction
gitlabhq_production | gitlab_geo_fdw | 21 | 0 | 7 | 6 | 4 | 0 | 0 | 0 | transaction
gitlabhq_production | pgbouncer | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | transaction
gitlabhq_production_sidekiq | gitlab | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | transaction
gitlabhq_production_sidekiq | pgbouncer | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | transaction
gitlabhq_production_sidekiq | C | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | transaction
pgbouncer | pgbouncer | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | statement
(8 rows)