Skip to content

SHOW POOLS fails to scrape if multiple databases with different users are present #7

@stanhu

Description

@stanhu

I have multiple database with different users:

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         |       363 |          0 |         1 |       4 |       0 |         0 |        0 |       0 | transaction
 gitlabhq_production         | gitlab_geo_fdw |        20 |          0 |         2 |       6 |       9 |         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)

This results in:

INFO[0036] Starting scrape                               source="collector.go:282"
An error has occurred during metrics collection:

40 error(s) occurred:
* collected metric pgbouncer_pools_client_active_connections label:<name:"database" value:"gitlabhq_production" > gauge:<value:434 >  was collected before with the same name and label values

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions