pg_exporter 0.11.1

PostgreSQL metric exporter for Prometheus
Documentation
# ----------------------------------------------------------------------------─
# pg_exporter Environment Configuration Example
# ----------------------------------------------------------------------------─

# Listening port for Prometheus scrape
# Default: 9432
PG_EXPORTER_PORT=9187

# ----------------------------------------------------------------------------
# PostgreSQL Connection Settings (DSN)
# ----------------------------------------------------------------------------
# For local UNIX socket (peer authentication)
# Uses system user 'postgres_exporter' (no password needed)
PG_EXPORTER_DSN='postgresql:///postgres?host=/var/run/postgresql&user=postgres_exporter'
#
# If using password authentication, set both PGPASSWORD and DSN:
#
# PGPASSWORD='SuperSecret'
# PG_EXPORTER_DSN='postgresql:///postgres?host=/var/run/postgresql&user=postgres_exporter'
#
# For TCP connections (e.g., when connecting to a remote host)
#PG_EXPORTER_DSN='postgresql://postgres_exporter@127.0.0.1:5432/postgres'

# ----------------------------------------------------------------------------
# Database Filtering
# ----------------------------------------------------------------------------
# Comma-separated list (no spaces) of databases to exclude from collection.
# These are typical system databases that don’t need metrics scraping.
PG_EXPORTER_EXCLUDE_DATABASES='template0,template1,postgres'

# ----------------------------------------------------------------------------
# OpenTelemetry Tracing (optional)
# ----------------------------------------------------------------------------
# Endpoint for OTLP trace export.
# Useful for debugging query performance or exporter latency.
# OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
# OTEL_EXPORTER_OTLP_HEADERS='key1=value1'