Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does this work? #60

Open
zilti opened this issue Oct 14, 2021 · 4 comments
Open

How does this work? #60

zilti opened this issue Oct 14, 2021 · 4 comments

Comments

@zilti
Copy link

zilti commented Oct 14, 2021

How do I set up this exporter? What is the connection string supposed to be? I tried the example, but all I get is level=error ts=2021-10-14T10:29:24.248Z caller=collector.go:129 msg="error setting up DB connection" err="error pinging pgbouncer: \"pq: not allowed\"".

@salmanbawazeer
Copy link

@zilti Have you found the way to get it working..?

@bdoublet91
Copy link

bdoublet91 commented Nov 22, 2022

Use latest version and it works. Just set up pgbouncer.ini with

admin_users = pgbouncer

This enable the user pgbouncer to connect to pgbouncer database and execute queries.

And now execute pgbouncer_exporter on same server

./pgbouncer_exporter --pgBouncer.connectionString="postgres://pgbouncer:***@localhost:6432/pgbouncer?sslmode=disable" --pgBouncer.pid-file="/var/run/pgbouncer/pgbouncer.pid" --web.listen-address=":9128"

ts=2022-11-21T23:58:34.853Z caller=collector.go:406 level=info msg="Starting scrape"
ts=2022-11-21T23:58:34.855Z caller=pgbouncer_exporter.go:78 level=info msg="Starting pgbouncer_exporter" version="(version=0.5.1, branch=master, revision=a60dff64e88ba0f94743749b97528cc8cc906364)"
ts=2022-11-21T23:58:34.855Z caller=pgbouncer_exporter.go:79 level=info msg="Build context" build_context="(go=go1.18.8, user=***, date=20221121-23:51:54)"
ts=2022-11-21T23:58:34.855Z caller=pgbouncer_exporter.go:96 level=info msg="Listening on" address=:9128
ts=2022-11-21T23:58:43.651Z caller=collector.go:406 level=info msg="Starting scrape"

@mohag
Copy link

mohag commented Oct 26, 2023

Use latest version and it works. Just set up pgbouncer.ini with

admin_users = pgbouncer

It seems that the slightly more secure stats_users = pgbouncer also works.

@pradeepkia
Copy link

Hi Team,

Can someone help me here ? Getting the same error even after using latest version and I am trying to connect with the admin users only.

pgbouncer_exporter, version 0.8.0 (branch: HEAD, revision: af944f6)
build user: root@35e99bbef5e7
build date: 20240403-11:36:49
go version: go1.22.1
platform: linux/amd64
tags: unknown

When I try below command still getting the error.

Command - /opt/pgbouncer_exporter/pgbouncer_exporter --pgBouncer.connectionString="postgres://postgres:xyzzz@localhost:6433/pgbouncer?sslmode=disable"

Error - ts=2024-08-12T09:00:25.963Z caller=collector.go:142 level=error msg="error setting up DB connection" err="error pinging pgbouncer: pq: not allowed"

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

No branches or pull requests

5 participants