postgres_exporter icon indicating copy to clipboard operation
postgres_exporter copied to clipboard

Support other unix ports

Open StyXman opened this issue 1 year ago • 2 comments

What did you do?

Run postgres on unix socket /var/run/postgresql/.s.PGSQL.5433. Run pg_exp with DATA_SOURCE_NAME='host=/var/run/postgresql/.s.PGSQL.5433 dbname=gis'

What did you see instead? Under which circumstances?

err="dial unix /var/run/postgresql/.s.PGSQL.5433/.s.PGSQL.5432: connect: not a directory"

Also tried removing the socket filename, just leavinbg the run directory, but pg_exp still only tries the 5432 socket and not 5433.

Environment

  • System information:

    Linux 6.1.0-7-amd64 x86_64

Debian stable.

  • postgres_exporter version:
postgres_exporter, version 0.11.1 (branch: debian/sid, revision: 0.11.1-3+b5)
  build user:       [email protected]
  build date:       20230409-10:13:00
  go version:       go1.19.8
  platform:         linux/amd64

StyXman avatar Nov 16 '24 19:11 StyXman

This version is quite old. Can you try on v0.17.0?

sysadmind avatar Feb 23 '25 18:02 sysadmind

The postgresql connection parameters for unix domain sockets are a little weird. The DSN you're probably looking for is host=/var/run/postgresql port=5433 dbname=gis That will attempt to connect to /var/run/postgresql/.s.PGSQL.5433

benjunmun avatar Sep 09 '25 14:09 benjunmun