spreaker / prometheus-pgbouncer-exporter

Prometheus exporter for PgBouncer
MIT License
104 stars 38 forks source link

Cannot get metrics due to Unable to run query #46

Closed DanielLund closed 2 years ago

DanielLund commented 2 years ago

When running pgbouncer exporter i get the following errors:

{"asctime": "2022-06-29 16:17:32", "levelname": "ERROR", "message": "Unable run query SHOW STATS on postgresql://postgres:@localhost:6432/DEV-DB", "exception": "unrecognized configuration parameter \"stats\"\n"} {"asctime": "2022-06-29 16:17:32", "levelname": "ERROR", "message": "Unable run query SHOW POOLS on postgresql://postgres:@localhost:6432/DEV-DB", "exception": "unrecognized configuration parameter \"pools\"\n"} {"asctime": "2022-06-29 16:17:32", "levelname": "ERROR", "message": "Unable run query SHOW DATABASES on postgresql://postgres:@localhost:6432/DEV-DB", "exception": "unrecognized configuration parameter \"databases\"\n"} {"asctime": "2022-06-29 16:17:32", "levelname": "ERROR", "message": "Unable run query SHOW CONFIG on postgresql://postgres:@localhost:6432/DEV-DB", "exception": "unrecognized configuration parameter \"config\"\n"} {"asctime": "2022-06-29 16:17:32", "levelname": "INFO", "message": "Exporter listening on 0.0.0.0:9100"} {"asctime": "2022-06-29 16:17:33", "levelname": "ERROR", "message": "Unable run query SHOW STATS on postgresql://postgres:@localhost:6432/DEV-DB", "exception": "unrecognized configuration parameter \"stats\"\n"} {"asctime": "2022-06-29 16:17:33", "levelname": "ERROR", "message": "Unable run query SHOW POOLS on postgresql://postgres:@localhost:6432/DEV-DB", "exception": "unrecognized configuration parameter \"pools\"\n"} {"asctime": "2022-06-29 16:17:33", "levelname": "ERROR", "message": "Unable run query SHOW DATABASES on postgresql://postgres:@localhost:6432/DEV-DB", "exception": "unrecognized configuration parameter \"databases\"\n"} {"asctime": "2022-06-29 16:17:33", "levelname": "ERROR", "message": "Unable run query SHOW CONFIG on postgresql://postgres:@localhost:6432/DEV-DB", "exception": "unrecognized configuration parameter \"config\"\n"}

I have added the user for the db i am using pgbouncer for to both admin_users and stats_users

not sure what else to do.

DanielLund commented 2 years ago

When changing the database to pgbouncer i get the following error {"asctime": "2022-06-29 17:23:33", "levelname": "ERROR", "message": "Unable fetch metrics from postgresql://postgres:***@127.0.0.1:6432/pgbouncer", "exception": "connection to server at \"127.0.0.1\", port 6432 failed: FATAL: not allowed\n"}

DanielLund commented 2 years ago

All sorted, had to change the pg_hba.conf file

anwareset commented 1 year ago

Hi @DanielLund

All sorted, had to change the pg_hba.conf file

Can you share your pg_hba.conf file? Im facing similar issue.