Open caseyandgina opened 2 months ago
With this URL:
http://localhost:9187/probe?target=app_prometheus_postgres_exporter@%2Frun%2Fpostgresql:5432/postgres
It interprets the first %2F as a separator and everything after it as a db name, trying to use a TCP connection instead:
caller=probe.go:81 level=error target=app_prometheus_postgres_exporter@/run/postgresql:5432/postgres msg="Error opening connection to database" err="error querying postgresql version: pq: no pg_hba.conf entry for host \"127.0.0.1\", user \"app_prometheus_postgres_exporter\", database \"run/postgresql:5432/postgres\", SSL encryption"
caller=postgres_exporter.go:682 level=error err="Error opening connection to database (postgresql://app_prometheus_postgres_exporter:PASSWORD_REMOVED@/run/postgresql:5432/postgres): pq: no pg_hba.conf entry for host \"127.0.0.1\", user \"app_prometheus_postgres_exporter\", database \"run/postgresql:5432/postgres\", SSL encryption
I'd like to collect metrics like analyze/vacuum stats for tables in multiple databases, not just the one in the primary DSN. I'm trying to use multi-target support for this, but running into an issue when using a UNIX socket for the connection, as the slashes in the path aren't being decoded correctly.
For example, the following URL:
http://localhost:9187/probe?target=user=app_prometheus_postgres_exporter%20dbname=postgres%20host=%2Frun%2Fpostgresql%20port=5432
Results in:
If there's a better/simpler way, please let me know.