Open lukeshaughnessy opened 7 years ago
127.0.0.1
as seen by the postgres_exporter
Docker container refers to itself, try using the IP of the system hosting the DB?
Thanks, that was the correct answer. Maybe a note in the docs to specify host ip in the docker run command?
Maybe just use --net=host
.
Steps to Reproduce:
postgres=>
docker run -e DATA_SOURCE_NAME="postgresql://postgres_exporter:password@127.0.0.1:5432/postgres?sslmode=disable" -p 9187:9187 wrouesnel/postgres_exporter
level=info msg="Error opening connection to database (could not parse DATA_SOURCE_NAME): dial tcp 127.0.0.1:5432: getsockopt: connection refused" source="postgres_exporter.go:959"