Skip to content

Commit 10acd40

Browse files
authored
Updated for SSL
1 parent 97123c9 commit 10acd40

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

README.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This package is available for Docker:
1515
# Start an example database
1616
docker run --net=host -it --rm -e POSTGRES_PASSWORD=password postgres
1717
# Connect to it
18-
docker run --net=host -e DATA_SOURCE_NAME="postgresql://postgres:password@localhost:5432/postgres?sslmode=disable" wrouesnel/postgres_exporter
18+
docker run --net=host -e DATA_SOURCE_NAME="postgresql://postgres:password@localhost:5432/postgres?sslmode=require" mattalord/postgres_exporter_ssl
1919
```
2020

2121
## Building and running
@@ -33,11 +33,6 @@ $ ./postgres_exporter <flags>
3333

3434
To build the dockerfile, run `go run mage.go docker`.
3535

36-
This will build the docker image as `wrouesnel/postgres_exporter:latest`. This
37-
is a minimal docker image containing *just* postgres_exporter. By default no SSL
38-
certificates are included, if you need to use SSL you should either bind-mount
39-
`/etc/ssl/certs/ca-certificates.crt` or derive a new image containing them.
40-
4136
### Vendoring
4237
Package vendoring is handled with [`govendor`](https://github.com/kardianos/govendor)
4338

@@ -127,7 +122,7 @@ must be set via the `DATA_SOURCE_NAME` environment variable.
127122

128123
For running it locally on a default Debian/Ubuntu install, this will work (transpose to init script as appropriate):
129124

130-
sudo -u postgres DATA_SOURCE_NAME="user=postgres host=/var/run/postgresql/ sslmode=disable" postgres_exporter
125+
sudo -u postgres DATA_SOURCE_NAME="user=postgres host=/var/run/postgresql/sslmode=require" postgres_exporter
131126

132127
Also, you can set a list of sources to scrape different instances from the one exporter setup. Just define a comma separated string.
133128

@@ -237,7 +232,7 @@ GRANT SELECT ON postgres_exporter.pg_stat_replication TO postgres_exporter;
237232
> **NOTE**
238233
> <br />Remember to use `postgres` database name in the connection string:
239234
> ```
240-
> DATA_SOURCE_NAME=postgresql://postgres_exporter:password@localhost:5432/postgres?sslmode=disable
235+
> DATA_SOURCE_NAME=postgresql://postgres_exporter:password@localhost:5432/postgres?sslmode=require
241236
> ```
242237
243238
# Hacking

0 commit comments

Comments
 (0)