TOWERBY CETMIX
← Hangar / jet_template_postgres_exporter

Prometheus PostgreSQL Exporter for a Tower PostgreSQL Jet

Deploy a Dockerized PostgreSQL Exporter that discovers a running PostgreSQL Jet and exposes its metrics for Prometheus.

↓ Download↓ 3 downloads

Summary

Category
Jet Templates
Tags
Monitoring
Authors
Cetmix OÜ
License
AGPL-3
Version
1.0.0
Call sign
jet_template_postgres_exporter

This snippet imports a PostgresExporter Jet Template using quay.io/prometheuscommunity/postgres-exporter:v0.20.1. It allows one exporter per server and requires a running postgres_docker Jet on that server. The YAML includes the PostgreSQL 17 dependency template, with optional pgBackRest backups, and the Docker, Fail2ban and Tower Core dependencies.

Deploy and scrape

  1. Import the YAML and install the exporter template on the PostgreSQL host. Set postgres_password in Tower Keys and Secrets and ensure postgres_user matches the PostgreSQL login. When enabling S3 backups for the bundled PostgreSQL Jet, configure its repository settings and the aws_key_id and aws_access_key secrets.
  2. Set postgres_exporter_port and create an exporter Jet targeting Running. Prepare resolves the running PostgreSQL container name and stores it in postgres_exporter_host. Build renders a credential-bearing environment file under the Jet root and uses it to configure the container's connection to the postgres database on port 5432. The database connection uses sslmode=disable on the shared Docker network.
  3. Allow the Prometheus server to reach postgres_exporter_port (typically TCP 9187), checking the effective filtering of Docker-published ports. The exporter publishes this port directly without Traefik.
  4. Run Refresh targets on Prometheus. Check the postgres job and pg_up. Grafana uses the Tower server name as the instance.

Operate

Use Rebuild after changing the database connection or exporter image. Restart reuses the container's existing environment. If pg_up is zero, verify the PostgreSQL Jet, resolved hostname, credentials and Docker network. The template also provides Stop, Remove and Destroy actions for the exporter.