pgbouncer_exporter icon indicating copy to clipboard operation
pgbouncer_exporter copied to clipboard

pb metric collection

Open imatpro opened this issue 7 years ago • 4 comments

Hi, thanks for this exporter

after compile, i launch this : ./pgbouncer_exporter -pgBouncer.connectionString "postgres://prometheus:XXXXXX@localhost:6432/pgbouncer?sslmode=disable"

INFO[0000] Starting scrape source="collector.go:285" INFO[0000] Starting pgbouncer exporter version: (version=, branch=, revision=) source="pgbouncer_exporter.go:49" INFO[0006] Starting scrape source="collector.go:285"

But, on the metric page, i have this :

An error has occurred during metrics collection:

80 error(s) occurred:

  • collected metric pgbouncer_pools_cl_active label:<name:"database" value:"symfony" > gauge:<value:0 > was collected before with the same name and label values

could you help me please?

imatpro avatar Jun 30 '17 11:06 imatpro

I am also having the same problem. After running the exporter like so:

$ ./pgbouncer_exporter -pgBouncer.connectionString="postgres://xxxxx:xxxxx@localhost:6432/pgbouncer?sslmode=disable"
INFO[0000] Starting scrape                               source="collector.go:285"
INFO[0000] Starting pgbouncer exporter version:  (version=0.0.3, branch=master, revision=742aaec15aa7408e5e5467b1e1e56c812bbeea34)  source="pgbouncer_exporter.go:49"

I then try and access the metrics and get the following:

$ curl localhost:9127/metrics
An error has occurred during metrics collection:

8 error(s) occurred:
* collected metric pgbouncer_pools_cl_active label:<name:"database" value:"xxxxx" > gauge:<value:1 >  was collected before with the same name and label values
* collected metric pgbouncer_pools_cl_waiting label:<name:"database" value:"xxxxx" > gauge:<value:0 >  was collected before with the same name and label values
* collected metric pgbouncer_pools_sv_active label:<name:"database" value:"xxxxx" > gauge:<value:1 >  was collected before with the same name and label values
* collected metric pgbouncer_pools_sv_idle label:<name:"database" value:"xxxxx" > gauge:<value:0 >  was collected before with the same name and label values
* collected metric pgbouncer_pools_sv_used label:<name:"database" value:"xxxxx" > gauge:<value:0 >  was collected before with the same name and label values

Any help on the matter would be greatly appreciated. Thanks!

sdanbury avatar Oct 20 '17 10:10 sdanbury

I use this now : http://git.cbaines.net/prometheus-pgbouncer-exporter/ and it's work :)

imatpro avatar Oct 20 '17 12:10 imatpro

I'm also running into this issue when I try to hit the /metrics endpoint.

miles- avatar Dec 21 '17 18:12 miles-

The cause here is that the code incorrectly assumes that there will only ever be a single user for a given db. So, for example, if you have a sentry web-write and web-read user for the same DB, the pool metrics fails because the code breaks cardinality via not exposing user. Same issue exists for pool_mode, although that's a fairly esoteric config.

ferringb avatar Feb 23 '18 20:02 ferringb