postgres_exporter
by
prometheus-community

Description: A PostgreSQL metric exporter for Prometheus

View on GitHub ↗

Summary Information

Updated 55 minutes ago
Added to GitGenius on July 24th, 2022
Created on August 24th, 2015
Open Issues & Pull Requests: 327 (+0)
Number of forks: 828
Total Stargazers: 3,560 (+0)
Total Subscribers: 46 (+0)

Issue Activity (beta)

Open issues: 154
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 1,028 days
Stale 30+ days: 153
Stale 90+ days: 144

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 1
Events in 7 days: 1

Top labels

  • enhancement (11)
  • help wanted (7)
  • bug (5)
  • question (3)
  • documentation (2)
  • invalid (2)
  • needs info (1)

Most active issues this week

Repository Insights (GitGenius)

Median issue/PR response: 45.5 days
Mean response time: 540.2 days
90th percentile: 2115.4 days
Tracked items: 133

Most active contributors

Detailed Description

The postgres_exporter is a Prometheus exporter written in Go that collects and exposes metrics from PostgreSQL database servers. It enables monitoring of PostgreSQL instances by converting internal database statistics into Prometheus-compatible metrics that can be scraped and visualized in monitoring systems.

The exporter supports PostgreSQL versions 13 through 18 as verified by its CI testing. It is distributed as a Docker container image and can be deployed either as a sidecar alongside individual PostgreSQL instances or as a centralized service using the multi-target pattern. The multi-target functionality, currently in beta, allows a single exporter instance to monitor multiple PostgreSQL targets by accepting HTTP requests to the /probe endpoint with target DSN parameters, making it suitable for monitoring SaaS-managed PostgreSQL services where sidecar deployment is not feasible.

The exporter provides extensive configurability through command-line flags and environment variables. It includes numerous collector modules that can be individually enabled or disabled, covering database statistics, replication status, transaction activity, WAL archiving, background writer statistics, table and index I/O metrics, and statement-level query statistics. Key collectors enabled by default include database metrics, locks, replication, replication slots, settings, statement activity, archiver statistics, background writer metrics, database statistics, vacuum progress, replication statistics, and user table statistics. Optional collectors disabled by default include database wraparound detection, long-running transaction tracking, postmaster metrics, idle process detection, autovacuum activity, checkpoint statistics, WAL receiver status, index I/O metrics, WAL metrics, and xlog location tracking.

Configuration is managed through a YAML file that supports auth_modules for defining preset authentication credentials, allowing sensitive connection information to be kept out of URLs when using the multi-target endpoint. The exporter accepts data source configuration through multiple environment variables including DATA_SOURCE_NAME, DATA_SOURCE_URI, and file-based variants for usernames and passwords, supporting secure credential management through mounted files rather than environment variables.

According to GitGenius activity tracking, the repository has experienced significant community engagement with 133 tracked issues and pull requests. The median response latency for issues and PRs is approximately 1092 hours, with a mean of 12965 hours, indicating variable response times across different types of requests. Enhancement requests are the most common issue type with 5 tracked instances, followed by help wanted requests with 3 instances and bug reports with 2 instances. The most active contributors tracked are sysadmind with 54 events, SuperQ with 28 events, and isaiasanchez with 7 events. The repository shares contributors with microsoft/vscode, keycloak/keycloak, and microsoft/typescript, indicating cross-project collaboration within the broader open-source ecosystem.

The exporter includes advanced features such as configurable collection timeouts to prevent connection exhaustion when databases respond slowly, support for custom queries through external YAML files, metric prefix customization, and flexible logging with both logfmt and JSON output formats. It can be deployed with systemd socket activation on Linux systems and supports TLS and basic authentication through web configuration files.

postgres_exporter
by
prometheus-communityprometheus-community/postgres_exporter

Repository Details

Fetching additional details & charts...