[Unit]
Description=Prometheus exporter for PostgreSQL/Pgbouncer server metrics
Documentation=https://github.com/Vonng/pg_exporter
After=network.target

[Service]
EnvironmentFile=-/etc/default/pgbouncer_exporter
User={{ pg_dbsu|default('postgres') }}
ExecStart=/usr/bin/pg_exporter $PG_EXPORTER_OPTS
ExecReload=/usr/bin/kill -HUP $MAINPID
Restart=on-failure
RestartSec=5
CPUQuota=10%

[Install]
WantedBy=multi-user.target