-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated README, adding new Docker image
- Loading branch information
Marco Pracucci
committed
Dec 11, 2018
1 parent
fc3c2a1
commit 7a6e288
Showing
3 changed files
with
63 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
This public image provides an easy way to run the [prometheus-pgbouncer-exporter](https://github.com/spreaker/prometheus-pgbouncer-exporter). | ||
|
||
|
||
## Basic configuration via environment variables | ||
|
||
The image is shipped with a [default config file](https://github.com/spreaker/prometheus-pgbouncer-exporter/blob/master/config.docker.yml) which should be suitable to cover a basic usage. The default config file supports the following placeholders to be replaced via environment variables: | ||
|
||
|
||
| Environment variable | Default value | Description | | ||
| ----------------------- | ------------- | ----------- | | ||
| PGBOUNCER_EXPORTER_HOST | `127.0.0.1` | Host on which the exporter should listen to | | ||
| PGBOUNCER_EXPORTER_PORT | `9127` | Port on which the exporter should listen to | | ||
| PGBOUNCER_HOST | `localhost` | Host of the backend pgbouncer to which the exporter should connect to | | ||
| PGBOUNCER_PORT | `6432` | Port of the backend pgbouncer to which the exporter should connect to | | ||
| PGBOUNCER_USER | `pgbouncer` | Username used to connect to pgbouncer | | ||
| PGBOUNCER_PASS | _empty_ | Password used to connect to pgbouncer | | ||
|
||
|
||
## Providing a custom configuration file | ||
|
||
If the default config file doesn't fit your use case, you can provide a custom one mounting it as a single-file to `/etc/pgbouncer-exporter/config.yml`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
FROM python:3.6.6-alpine | ||
FROM python:3.6.7-alpine | ||
|
||
RUN apk update && \ | ||
apk add postgresql-libs && \ | ||
apk add --virtual .build-deps gcc musl-dev postgresql-dev && \ | ||
python3 -m pip install prometheus-pgbouncer-exporter --no-cache-dir && \ | ||
python3 -m pip install prometheus-pgbouncer-exporter==2.0.1 --no-cache-dir && \ | ||
apk --purge del .build-deps | ||
|
||
ENV PGBOUNCER_EXPORTER_HOST="127.0.0.1" PGBOUNCER_EXPORTER_PORT=9127 \ | ||
PGBOUNCER_USER="pgbouncer" PGBOUNCER_PASS="" \ | ||
PGBOUNCER_HOST="localhost" PGBOUNCER_PORT=6543 | ||
ENV PGBOUNCER_EXPORTER_HOST="127.0.0.1" \ | ||
PGBOUNCER_EXPORTER_PORT=9127 \ | ||
PGBOUNCER_USER="pgbouncer" \ | ||
PGBOUNCER_PASS="" \ | ||
PGBOUNCER_HOST="localhost" \ | ||
PGBOUNCER_PORT=6432 | ||
|
||
EXPOSE 9127 | ||
|
||
COPY config.docker.yml /etc/pgbouncer-exporter/config.yml | ||
|
||
ENTRYPOINT ["pgbouncer-exporter"] | ||
CMD ["--config", "/etc/pgbouncer-exporter/config.yml"] | ||
CMD ["--config", "/etc/pgbouncer-exporter/config.yml"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters