Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Database Tools
  3. postgres_exporter

postgres_exporter

Apache-2.0Gov0.20.1

A Prometheus exporter that collects and exposes PostgreSQL server metrics for monitoring.

GitHubGitHub
3.6k stars835 forks0 contributors

What is postgres_exporter?

Postgres Exporter is a Prometheus exporter for PostgreSQL databases that collects performance and health metrics from PostgreSQL instances and exposes them in a Prometheus-compatible format. It enables comprehensive monitoring of PostgreSQL databases by gathering metrics from system views like pg_stat_*, covering databases, tables, indexes, replication, locks, and background writer activity. The project follows the Prometheus exporter pattern with a focus on reliability, configurability, and seamless integration into existing monitoring stacks.

Target Audience

DevOps engineers, SREs, and database administrators who need to monitor PostgreSQL instances within a Prometheus-based observability stack. It's particularly useful for teams managing multiple PostgreSQL servers, including SaaS or managed service environments.

Value Proposition

Developers choose Postgres Exporter because it provides comprehensive, production-ready PostgreSQL metrics out of the box while offering flexible configuration options like customizable collectors and multi-target support. Its ability to run with non-superuser privileges (using the pg_monitor role) and support for custom SQL queries via YAML configuration make it both secure and extensible for diverse monitoring needs.

Overview

A PostgreSQL metric exporter for Prometheus

Use Cases

Best For

  • Monitoring PostgreSQL database performance metrics like query statistics, table/index usage, and replication status in Prometheus
  • Setting up centralized monitoring for multiple PostgreSQL servers using the multi-target /probe endpoint (beta feature)
  • Collecting custom PostgreSQL metrics through SQL queries defined in YAML configuration files
  • Securely monitoring PostgreSQL instances with non-superuser database accounts using limited privileges
  • Integrating PostgreSQL monitoring into existing Prometheus/Grafana observability stacks
  • Monitoring PostgreSQL replication, locks, and long-running transactions for production database troubleshooting

Not Ideal For

  • Production environments requiring stable, non-beta multi-server monitoring without future breaking changes
  • Teams that cannot modify database user permissions to grant pg_monitor or create custom functions for older PostgreSQL versions
  • Projects not using Prometheus or preferring alternative monitoring systems like InfluxDB or Datadog
  • Simple setups needing only basic metrics without the overhead of configuring numerous collectors and custom queries

Pros & Cons

Pros

Comprehensive Metric Collection

Gathers extensive metrics from PostgreSQL's pg_stat_* system views, covering databases, tables, indexes, replication, and locks out of the box, as highlighted in the key features for detailed performance monitoring.

Flexible Configuration Options

Allows enabling or disabling specific collectors via command-line flags and supports custom SQL queries through a YAML configuration file, enabling tailored monitoring setups without code changes.

Security-Focused Operation

Can run with a non-superuser database account using the pg_monitor role and supports file-based secrets for credentials, reducing security risks in production environments.

Multi-Target Scraping

Offers a beta /probe endpoint for scraping multiple PostgreSQL servers from a single exporter instance, ideal for SaaS or managed service monitoring, though it's labeled as beta.

Cons

Beta Multi-Target Support

The multi-target functionality is explicitly marked as beta and may require changes in future releases, making it less stable for critical production deployments that rely on this feature.

Deprecated Features

Several options like auto-discover-databases and extend.query-path are deprecated, indicating potential breaking changes and reduced long-term support, which could disrupt existing setups.

Complex Setup for Older Versions

For PostgreSQL versions older than 10, non-superuser monitoring requires manually creating custom functions and views, adding operational complexity and maintenance overhead.

Frequently Asked Questions

Quick Stats

Stars3,607
Forks835
Contributors0
Open Issues175
Last commit5 days ago
CreatedSince 2015

Tags

#devops#observability#postgresql-monitoring#time-series#docker#prometheus-exporter#system-monitoring#go#database-metrics

Built With

G
Go
D
Docker

Included in

PostgreSQL11.8kDatabase Tools5.1k
Auto-fetched 1 day ago

Related Projects

CorootCoroot

Coroot is an open-source observability and APM tool with AI-powered Root Cause Analysis. It combines metrics, logs, traces, continuous profiling, and SLO-based alerting with predefined dashboards and inspections.

Stars7,907
Forks398
Last commit2 days ago
dexterdexter

The automatic indexer for Postgres

Stars2,093
Forks58
Last commit22 days ago
pgwatch2pgwatch2

PostgreSQL metrics monitor/dashboard

Stars1,837
Forks225
Last commit1 year ago
Percona Monitoring and ManagementPercona Monitoring and Management

Percona Monitoring and Management: an open source database monitoring, observability and management tool

Stars1,096
Forks229
Last commit1 day ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub