Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add postgres_exporter to docker image #481

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,19 @@ RUN set -eux; \
mv -v /tmp/"$pkg"/pgbouncer_exporter /usr/local/bin/pgbouncer_exporter; \
rm -rfv /tmp/pkg.tgz /tmp/"$pkg"

# postgres-exporter
ARG POSTGRES_EXPORTER_VERSION="0.15.0"
RUN set -eux; \
pkg="postgres_exporter-${POSTGRES_EXPORTER_VERSION}.linux-$(dpkg --print-architecture)"; \
curl --silent \
--location \
--output /tmp/pkg.tgz \
"https://github.com/prometheus-community/postgres_exporter/releases/download/v${POSTGRES_EXPORTER_VERSION}/${pkg}.tar.gz"; \
cd /tmp; \
tar xvzf /tmp/pkg.tgz "$pkg"/postgres_exporter; \
mv -v /tmp/"$pkg"/postgres_exporter /usr/local/bin/postgres_exporter; \
rm -rfv /tmp/pkg.tgz /tmp/"$pkg"

# forbid creation of a main cluster when package is installed
RUN sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf

Expand Down