spreaker / prometheus-pgbouncer-exporter

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

Database name configurable #11

Closed mazzy89 closed 5 years ago

mazzy89 commented 5 years ago

Why is the database name not configurable in the Docker image and set to pgbouncer?

pracucci commented 5 years ago

Can you elaborate more your question, please?

The database is exported as a label on each metric. The exporter exports metrics for all databases configured in pgbouncer.

On Thu, Apr 4, 2019, 16:58 Salvatore Mazzarino notifications@github.com wrote:

Why is the database name not configurable and set to pgbouncer?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/spreaker/prometheus-pgbouncer-exporter/issues/11, or mute the thread https://github.com/notifications/unsubscribe-auth/ABn4EFO7lvE1rWyXBM1EDAccUxdeMe14ks5vdmd8gaJpZM4cdsrc .

mazzy89 commented 5 years ago

in the docker image, you can pass different values like username, password, host but in the connection string the database name is hardcoded and it is pgbouncer. Any reasons for that?

https://github.com/spreaker/prometheus-pgbouncer-exporter/blob/7a6e2885a4ef48a400243b3038a3763a8de847b0/config.docker.yml#L13

pracucci commented 5 years ago

Yes. The pgbouncer metrics are exported by pgbouncer on a "virtual" database called "pgbouncer".

May you explain your use case, so I will try to better help you, please?

On Sun, Apr 7, 2019, 06:05 Salvatore Mazzarino notifications@github.com wrote:

in the docker image, you can pass different values like username, password, host but in the connection string the database name is hardcoded and it is pgbouncer. Any reasons for that?

https://github.com/spreaker/prometheus-pgbouncer-exporter/blob/7a6e2885a4ef48a400243b3038a3763a8de847b0/config.docker.yml#L13

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/spreaker/prometheus-pgbouncer-exporter/issues/11#issuecomment-480576456, or mute the thread https://github.com/notifications/unsubscribe-auth/ABn4ENtMNhXEZbPXFMO5-eYBZNeelbQiks5vecLOgaJpZM4cdsrc .

mazzy89 commented 5 years ago

I've enabled in my app PGBouncer but I don't have any database called pgbouncer. I was just afraid that since I don't have any database pgbouncer in there, the connection would fail for that.

pracucci commented 5 years ago

Check out the admin console doc: https://pgbouncer.github.io/usage.html

The exporter just uses that.

On Sun, Apr 7, 2019, 06:29 Salvatore Mazzarino notifications@github.com wrote:

I've enabled in my app PGBouncerbut I don't have any database called pgbouncer. I was just afraid that since I don't have any database pgbouncer` in there, the connection would fail for that.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/spreaker/prometheus-pgbouncer-exporter/issues/11#issuecomment-480577977, or mute the thread https://github.com/notifications/unsubscribe-auth/ABn4EI0JUHF6HyQ2hNBJwDzcDCpqMqe-ks5veciYgaJpZM4cdsrc .

MaicolBen commented 5 years ago

Yeah, I don't think you can change the pgbouncer's admin database name in the pgbouncer instance.