'Unable fetch metrics from postgresql://pgbouncer:***@vsaxx:6432/pgbouncer", "exception": "invalid integer value \"xxx\" for connection option \"port\"

I am deploying the prometheus-pgbouncer-exporter to kubernetes by helm chart. Although pods in this namespace is running, the log of pods always show this error message, which failed to collecting metrics and these pgbouncer servers could be shown in grafana.

The original issue:

{"asctime": "xxxx", "levelname": "ERROR", "message": "Unable fetch metrics from postgresql://pgbouncer:***@localhost:6432/pgbouncer", "exception": "could not connect to server: Connection refused\n\tIs the server running on host "localhost" (127.0.0.1) and accepting\n\tTCP/IP connections on port 6432?\ncould not connect to server: Address not available\n\tIs the server running on host "localhost" (::1) and accepting\n\tTCP/IP connections on port 6432?\n"}

When i try to debug and re-deploy it again, another issue occurs:

{"asctime": "2022-04-22 08:41:33", "levelname": "ERROR", "message": "Unable fetch metrics from postgresql://pgbouncer:***@xxxx:6432/pgbouncer", "exception": "invalid integer value "AgAjp0E7ePrce41jwBgvO8" for connection option "port"\n"}

I'm really new to pgbouncer, helm chart, kubernetes and grafana.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source