Advanced PostgreSQL & pgBouncer 
Metrics Exporter for Prometheus

The ultimate monitoring experience for PostgreSQL with 600+ metrics
declarative configuration, and dynamic planning capabilities

Installation

PG Exporter provides multiple install methods to fit your infrastructure:

docker run -d --name pg_exporter -p 9630:9630 -e PG_EXPORTER_URL="postgres://user:pass@host:5432/postgres" pgsty/pg_exporter:latest
# RPM-based systems
sudo tee /etc/yum.repos.d/pigsty-infra.repo > /dev/null <<-'EOF'
[pigsty-infra]
name=Pigsty Infra for $basearch
baseurl=https://repo.pigsty.io/yum/infra/$basearch
enabled = 1
gpgcheck = 0
module_hotfixes=1
EOF

sudo yum makecache;
sudo yum install -y pg_exporter
sudo tee /etc/apt/sources.list.d/pigsty-infra.list > /dev/null <<EOF
deb [trusted=yes] https://repo.pigsty.io/apt/infra generic main
EOF

sudo apt update;
sudo apt install -y pg-exporter
wget https://github.com/pgsty/pg_exporter/releases/download/v1.0.1/pg_exporter-v1.0.1.linux-amd64.tar.gz
tar -xf pg_exporter-v1.0.1.linux-amd64.tar.gz
sudo install pg_exporter-v1.0.1.linux-amd64/pg_exporter /usr/bin/
sudo install pg_exporter-v1.0.1.linux-amd64/pg_exporter.yml /etc/pg_exporter.yml
# Build from source
git clone https://github.com/pgsty/pg_exporter.git
cd pg_exporter
make build

Quick Start

Get PG Exporter up and running in minutes, Getting Started with:

# Run with PostgreSQL URL
PG_EXPORTER_URL='postgres://user:pass@localhost:5432/postgres' pg_exporter

# Access metrics
curl http://localhost:9630/metrics

Documentation

Live Demo

Experience PG Exporter in action with our live demo environment:

The demo showcases real PostgreSQL clusters monitored by PG Exporter, featuring:

  • Real-time metrics visualization with Grafana
  • Multiple PostgreSQL versions and configurations
  • Extension-specific metrics and monitoring
  • Complete observability stack powered by Pigsty

Community & Support

License

PG Exporter is open-source software licensed under the Apache License 2.0.

Copyright 2018-2025 © Ruohang Feng / rh@vonng.com

Last updated on