|
| 1 | +--- |
| 2 | +full: true |
| 3 | +cascade: |
| 4 | + type: docs |
| 5 | +breadcrumbs: false |
| 6 | +comments: false |
| 7 | +--- |
| 8 | + |
| 9 | +<div class="hx-mt-6 hx-mb-6"> |
| 10 | +{{< hextra/hero-headline >}} |
| 11 | + Advanced PostgreSQL & pgBouncer <br class="sm:hx-block hx-hidden" />Metrics Exporter for Prometheus |
| 12 | +{{< /hextra/hero-headline >}} |
| 13 | +</div> |
| 14 | + |
| 15 | +<div class="hx-mb-12"> |
| 16 | +{{< hextra/hero-subtitle >}} |
| 17 | + The ultimate monitoring experience for PostgreSQL with **600+ metrics**, <br class="sm:hx-block hx-hidden" /> |
| 18 | + **declarative configuration**, and **dynamic planning** capabilities |
| 19 | +{{< /hextra/hero-subtitle >}} |
| 20 | +</div> |
| 21 | + |
| 22 | +<div class="hx-mb-6"> |
| 23 | +{{< hextra/hero-button text="Get Started" link="getting-started" >}} |
| 24 | +</div> |
| 25 | + |
| 26 | +<div class="hx-mt-6"></div> |
| 27 | + |
| 28 | +{{< hextra/feature-grid >}} |
| 29 | + {{< hextra/feature-card |
| 30 | + title="Comprehensive Metrics" |
| 31 | + subtitle="Monitor PostgreSQL (10-18+) and pgBouncer (1.8-1.24+) with 600+ metrics and ~3K time series per instance" |
| 32 | + style="background: radial-gradient(ellipse at 50% 80%,rgba(142,53,74,0.15),hsla(0,0%,100%,0));" |
| 33 | + >}} |
| 34 | + {{< hextra/feature-card |
| 35 | + title="Declarative Configuration" |
| 36 | + subtitle="Define custom metrics through YAML configs with fine-grained control over timeout, caching, and skip conditions" |
| 37 | + style="background: radial-gradient(ellipse at 50% 80%,rgba(194,97,254,0.15),hsla(0,0%,100%,0));" |
| 38 | + >}} |
| 39 | + {{< hextra/feature-card |
| 40 | + title="Custom Collectors" |
| 41 | + subtitle="Define your own metrics with declarative YAML configuration and dynamic query planning" |
| 42 | + style="background: radial-gradient(ellipse at 50% 80%,rgba(255,119,168,0.15),hsla(0,0%,100%,0));" |
| 43 | + >}} |
| 44 | + {{< hextra/feature-card |
| 45 | + title="Auto-Discovery" |
| 46 | + subtitle="Automatically discover and monitor multiple databases within a PostgreSQL instance" |
| 47 | + style="background: radial-gradient(ellipse at 50% 80%,rgba(142,53,74,0.15),hsla(0,0%,100%,0));" |
| 48 | + >}} |
| 49 | +
|
| 50 | + {{< hextra/feature-card |
| 51 | + title="Dynamic Planning" |
| 52 | + subtitle="Automatically adapt metric collection based on PostgreSQL version, extensions, and server characteristics" |
| 53 | + style="background: radial-gradient(ellipse at 50% 80%,rgba(221,210,59,0.15),hsla(0,0%,100%,0));" |
| 54 | + >}} |
| 55 | + {{< hextra/feature-card |
| 56 | + title="Production Ready" |
| 57 | + subtitle="Battle-tested in real-world environments across 12K+ cores for 6+ years with enterprise reliability" |
| 58 | + style="background: radial-gradient(ellipse at 50% 80%,rgba(120,119,198,0.15),hsla(0,0%,100%,0));" |
| 59 | + >}} |
| 60 | + {{< hextra/feature-card |
| 61 | + title="Health Check APIs" |
| 62 | + subtitle="Comprehensive HTTP endpoints for service health and traffic routing with primary/replica detection" |
| 63 | + style="background: radial-gradient(ellipse at 50% 80%,rgba(221,210,59,0.15),hsla(0,0%,100%,0));" |
| 64 | + >}} |
| 65 | +
|
| 66 | + {{< hextra/feature-card |
| 67 | + title="Smart Caching" |
| 68 | + subtitle="Built-in caching mechanism with configurable TTL to reduce database load and improve performance" |
| 69 | + style="background: radial-gradient(ellipse at 50% 80%,rgba(194,97,254,0.15),hsla(0,0%,100%,0));" |
| 70 | + >}} |
| 71 | +
|
| 72 | + {{< hextra/feature-card |
| 73 | + title="Extension Aware" |
| 74 | + subtitle="Native support for TimescaleDB, Citus, pg_stat_statements, pg_wait_sampling and automatic detection" |
| 75 | + style="background: radial-gradient(ellipse at 50% 80%,rgba(42,142,142,0.15),hsla(0,0%,100%,0));" |
| 76 | + >}} |
| 77 | +
|
| 78 | +{{< /hextra/feature-grid >}} |
| 79 | + |
| 80 | + |
| 81 | +## Installation |
| 82 | + |
| 83 | +PG Exporter provides multiple [install](/install) methods to fit your infrastructure: |
| 84 | + |
| 85 | +{{< tabs items="Docker,YUM,APT,BIN,SRC" >}} |
| 86 | +{{< tab >}} |
| 87 | +```bash |
| 88 | +docker run -d --name pg_exporter -p 9630:9630 -e PG_EXPORTER_URL="postgres://user:pass@host:5432/postgres" pgsty/pg_exporter:latest |
| 89 | +``` |
| 90 | +{{< /tab >}} |
| 91 | +{{< tab >}} |
| 92 | +```bash |
| 93 | +# RPM-based systems |
| 94 | +sudo tee /etc/yum.repos.d/pigsty-infra.repo > /dev/null <<-'EOF' |
| 95 | +[pigsty-infra] |
| 96 | +name=Pigsty Infra for $basearch |
| 97 | +baseurl=https://repo.pigsty.io/yum/infra/$basearch |
| 98 | +enabled = 1 |
| 99 | +gpgcheck = 0 |
| 100 | +module_hotfixes=1 |
| 101 | +EOF |
| 102 | + |
| 103 | +sudo yum makecache; |
| 104 | +sudo yum install -y pg_exporter |
| 105 | +``` |
| 106 | +{{< /tab >}} |
| 107 | +{{< tab >}} |
| 108 | +```bash |
| 109 | +sudo tee /etc/apt/sources.list.d/pigsty-infra.list > /dev/null <<EOF |
| 110 | +deb [trusted=yes] https://repo.pigsty.io/apt/infra generic main |
| 111 | +EOF |
| 112 | + |
| 113 | +sudo apt update; |
| 114 | +sudo apt install -y pg-exporter |
| 115 | +``` |
| 116 | +{{< /tab >}} |
| 117 | +{{< tab >}} |
| 118 | +```bash |
| 119 | +wget https://github.com/pgsty/pg_exporter/releases/download/v1.0.1/pg_exporter-v1.0.1.linux-amd64.tar.gz |
| 120 | +tar -xf pg_exporter-v1.0.1.linux-amd64.tar.gz |
| 121 | +sudo install pg_exporter-v1.0.1.linux-amd64/pg_exporter /usr/bin/ |
| 122 | +sudo install pg_exporter-v1.0.1.linux-amd64/pg_exporter.yml /etc/pg_exporter.yml |
| 123 | +``` |
| 124 | +{{< /tab >}} |
| 125 | +{{< tab >}} |
| 126 | +```bash |
| 127 | +# Build from source |
| 128 | +git clone https://github.com/pgsty/pg_exporter.git |
| 129 | +cd pg_exporter |
| 130 | +make build |
| 131 | +``` |
| 132 | +{{< /tab >}} |
| 133 | +{{< /tabs >}} |
| 134 | + |
| 135 | + |
| 136 | +## Quick Start |
| 137 | + |
| 138 | +Get PG Exporter up and running in minutes, [Getting Started](/getting-started) with: |
| 139 | + |
| 140 | +```bash |
| 141 | +# Run with PostgreSQL URL |
| 142 | +PG_EXPORTER_URL='postgres://user:pass@localhost:5432/postgres' pg_exporter |
| 143 | + |
| 144 | +# Access metrics |
| 145 | +curl http://localhost:9630/metrics |
| 146 | +``` |
| 147 | + |
| 148 | + |
| 149 | +## Documentation |
| 150 | + |
| 151 | +<div class="hx-mt-6 hx-mb-6"> |
| 152 | +{{< cards >}} |
| 153 | +{{< card link="start" title="Getting Started" subtitle="Quick start guide and basic concepts" >}} |
| 154 | +{{< card link="install" title="Installation" subtitle="installation instructions for all platforms" icon="download" >}} |
| 155 | +{{< card link="config" title="Configuration" subtitle="configuration reference and examples" >}} |
| 156 | +{{< card link="deploy" title="Deployment" subtitle="Production deployment best practices" icon="server" >}} |
| 157 | +{{< card link="https://github.com/pgsty/pg_exporter/tree/main/config" title="Collectors" subtitle="Detailed documentation for all metric collectors" icon="database" >}} |
| 158 | +{{< /cards >}} |
| 159 | +</div> |
| 160 | + |
| 161 | +## Live Demo |
| 162 | + |
| 163 | +Experience PG Exporter in action with our live demo environment: |
| 164 | + |
| 165 | +<div class="hx-mt-4"> |
| 166 | +{{< hextra/hero-button text="View Live Demo" link="https://g.pgsty.com" >}} |
| 167 | +</div> |
| 168 | + |
| 169 | +The demo showcases real PostgreSQL clusters monitored by PG Exporter, featuring: |
| 170 | +- Real-time metrics visualization with Grafana |
| 171 | +- Multiple PostgreSQL versions and configurations |
| 172 | +- Extension-specific metrics and monitoring |
| 173 | +- Complete observability stack powered by [Pigsty](https://pgsty.com) |
| 174 | + |
| 175 | +## Community & Support |
| 176 | + |
| 177 | +<div class="hx-mt-6 hx-mb-6"> |
| 178 | +{{< cards >}} |
| 179 | +{{< card link="https://github.com/pgsty/pg_exporter" title="GitHub" subtitle="Source code, issues, and contributions" icon="github" >}} |
| 180 | +{{< card link="https://github.com/pgsty/pg_exporter/discussions" title="Discussions" subtitle="Ask questions and share experiences" icon="chat" >}} |
| 181 | +{{< card link="https://pgsty.com" title="Pigsty" subtitle="Complete PostgreSQL Distro with PG Exporter" >}} |
| 182 | +{{< /cards >}} |
| 183 | +</div> |
| 184 | + |
| 185 | +## License |
| 186 | + |
| 187 | +PG Exporter is open-source software licensed under the [Apache License 2.0](https://github.com/pgsty/pg_exporter/blob/main/LICENSE). |
| 188 | + |
| 189 | +Copyright 2018-2025 © [Ruohang Feng ](https://vonng.com/en) / [[email protected]](mailto:[email protected]) |
0 commit comments