PG Exporter Blog
PG Exporter articles, design decisions, and release notes.
Read articles for monitoring practice, design records for architecture and tradeoffs, and release notes for changes in each version. Use the manuals to install and operate the current stable release.
Bounded SQL Scrapes and Client Cancellation
v1.6.0: bounded waiting for two scrapers, request cancellation, and the existing failure-cache policy.
Cluster Progress with Safe Relation Labels
v1.6.0: keep cluster-wide progress and use numeric OIDs for user relations in other databases.
Container Trust Roots and Release Checks
v1.6.0: include CA roots and the license in both scratch images, and exercise TLS and DEB artifacts in release validation.
Target Identity and Consistent Health Responses
v1.5.0 target-state guarantees, with the v1.6.0 amendment separating health probes from collection.
Correcting Replication Collector Identity and Semantics
Minimal corrections to subscription identity, receiver states, origin permissions, and relation counts
Turning PostgreSQL CSV Logs into Durable Metrics
Read complete CSV records, persist cursors and aggregates, and publish bounded PostgreSQL log metrics
Caching pgBackRest Metrics Outside the Scrape Path
Run pgBackRest in a bounded background worker and serve the latest valid metrics snapshot
The PostgreSQL Observability Product We Chose Not to Build
Why a separate incident workbench became a CSV log collector inside PG Exporter
One Endpoint, Several Sources: The Composite Exporter Contract
Combine PostgreSQL and optional metric sources with fixed ownership and independent failure handling
Snapshot Histograms Are Gauges, Not Counters
Why SQL snapshot distributions expose bucket, count, and sum as Gauge series
Adopting the Victoria observability stack in Pigsty
The December 2025 Pigsty v4 beta introduced VictoriaMetrics, VictoriaLogs, and VictoriaTraces. This article records the motivation, test results, and deployment model.
PGCon.Dev 2024: The Week PostgreSQL Commits Paused
Notes from PGCon.Dev 2024: extension packaging, observability, community discussions, and plans for PostgreSQL.
PostgreSQL Macro Query Optimization with pg_stat_statements
Query optimization is one of the core responsibilities of DBAs. This article introduces how to use metrics provided by pg_stat_statements for macro-level PostgreSQL query optimization.
Monitor Existing PostgreSQL with Pigsty: RDS, PolarDB, and Self-Hosted Databases
Deploy Pigsty on ECS and connect existing PostgreSQL databases, using Alibaba Cloud PolarDB and RDS for PostgreSQL as examples.
Diagnose PostgreSQL slow queries
Use query statistics, logs, and monitoring to find a slow query, test its cause, and verify a fix.
The First Pigsty Release
Introducing Pigsty's first release: PostgreSQL monitoring, high-availability cluster provisioning, and a local demo environment.
Golden Monitoring Metrics: Errors, Latency, Throughput, Saturation
Understanding the golden monitoring metrics in PostgreSQL
Introducing Pigsty, a PostgreSQL Monitoring System
The PostgreSQL monitoring system I built: its architecture, monitoring hierarchy, instance and cluster dashboards, and slow-query analysis.
PostgreSQL's KPI
PG Load measures accumulated transaction time per second, normalized by a chosen concurrency value. This article derives the metric and shows how to use it for alerting and capacity assessment.
An Overview of PostgreSQL Monitoring
A tour of a PostgreSQL monitoring system: dashboards, architecture, key metrics, and the statistics behind them.
Relation Bloat Monitoring and Management
Estimate PostgreSQL table and index bloat from statistics, then use VACUUM FULL or pg_repack to reclaim space.
Monitoring Table Size in PostgreSQL
Measure PostgreSQL table storage, including indexes, TOAST, and relation forks.
PostgreSQL Server Log Configuration
CSV logs can be imported into PostgreSQL tables or queried through file_fdw for analysis.
Bounded SQL Scrapes and Client Cancellation
v1.6.0: bounded waiting for two scrapers, request cancellation, and the existing failure-cache policy.
Cluster Progress with Safe Relation Labels
v1.6.0: keep cluster-wide progress and use numeric OIDs for user relations in other databases.
Container Trust Roots and Release Checks
v1.6.0: include CA roots and the license in both scratch images, and exercise TLS and DEB artifacts in release validation.
Target Identity and Consistent Health Responses
v1.5.0 target-state guarantees, with the v1.6.0 amendment separating health probes from collection.
Correcting Replication Collector Identity and Semantics
Minimal corrections to subscription identity, receiver states, origin permissions, and relation counts
Turning PostgreSQL CSV Logs into Durable Metrics
Read complete CSV records, persist cursors and aggregates, and publish bounded PostgreSQL log metrics
Caching pgBackRest Metrics Outside the Scrape Path
Run pgBackRest in a bounded background worker and serve the latest valid metrics snapshot
The PostgreSQL Observability Product We Chose Not to Build
Why a separate incident workbench became a CSV log collector inside PG Exporter
One Endpoint, Several Sources: The Composite Exporter Contract
Combine PostgreSQL and optional metric sources with fixed ownership and independent failure handling
Snapshot Histograms Are Gauges, Not Counters
Why SQL snapshot distributions expose bucket, count, and sum as Gauge series
Adopting the Victoria observability stack in Pigsty
The December 2025 Pigsty v4 beta introduced VictoriaMetrics, VictoriaLogs, and VictoriaTraces. This article records the motivation, test results, and deployment model.
PGCon.Dev 2024: The Week PostgreSQL Commits Paused
Notes from PGCon.Dev 2024: extension packaging, observability, community discussions, and plans for PostgreSQL.
PostgreSQL Macro Query Optimization with pg_stat_statements
Query optimization is one of the core responsibilities of DBAs. This article introduces how to use metrics provided by pg_stat_statements for macro-level PostgreSQL query optimization.
Monitor Existing PostgreSQL with Pigsty: RDS, PolarDB, and Self-Hosted Databases
Deploy Pigsty on ECS and connect existing PostgreSQL databases, using Alibaba Cloud PolarDB and RDS for PostgreSQL as examples.
Diagnose PostgreSQL slow queries
Use query statistics, logs, and monitoring to find a slow query, test its cause, and verify a fix.
The First Pigsty Release
Introducing Pigsty's first release: PostgreSQL monitoring, high-availability cluster provisioning, and a local demo environment.
Golden Monitoring Metrics: Errors, Latency, Throughput, Saturation
Understanding the golden monitoring metrics in PostgreSQL
Introducing Pigsty, a PostgreSQL Monitoring System
The PostgreSQL monitoring system I built: its architecture, monitoring hierarchy, instance and cluster dashboards, and slow-query analysis.
PostgreSQL's KPI
PG Load measures accumulated transaction time per second, normalized by a chosen concurrency value. This article derives the metric and shows how to use it for alerting and capacity assessment.
An Overview of PostgreSQL Monitoring
A tour of a PostgreSQL monitoring system: dashboards, architecture, key metrics, and the statistics behind them.
Relation Bloat Monitoring and Management
Estimate PostgreSQL table and index bloat from statistics, then use VACUUM FULL or pg_repack to reclaim space.
Monitoring Table Size in PostgreSQL
Measure PostgreSQL table storage, including indexes, TOAST, and relation forks.
PostgreSQL Server Log Configuration
CSV logs can be imported into PostgreSQL tables or queried through file_fdw for analysis.
-
Bounded SQL Scrapes and Client Cancellation
Status: Shipped in v1.6.0. Decision / last verification: 2026-11-09. Scope: v1.6.0 at source 6bee809 on main, addressing #116. Not shipped in v1.5.0. Delivery: Tag v1.6.0 points to 6bee809; the GitHub Release, versioned archives, RPM/DEB packages, …
Status: Shipped in v1.6.0. Decision / last verification: 2026-11-09. Scope: v1.6.0 at source 6bee809 on main, addressing #116. Not shipped in v1.5.0. Delivery: Tag v1.6.0 points to 6bee809; the GitHub Release, versioned archives, RPM/DEB packages, …
-
Cluster Progress with Safe Relation Labels
Status: Shipped in v1.6.0. Decision / last verification: 2026-11-09. Scope: v1.6.0 at source 6bee809 on main, #115; PostgreSQL 12+ vacuum, index creation, and cluster progress. Not shipped in v1.5.0. Delivery: Tag v1.6.0 points to 6bee809; the …
Status: Shipped in v1.6.0. Decision / last verification: 2026-11-09. Scope: v1.6.0 at source 6bee809 on main, #115; PostgreSQL 12+ vacuum, index creation, and cluster progress. Not shipped in v1.5.0. Delivery: Tag v1.6.0 points to 6bee809; the …
-
Container Trust Roots and Release Checks
Status: Shipped in v1.6.0. Decision date / last verification: 2026-11-08 / 2026-11-09. Scope: Container and release-validation changes based on v1.5.0 source 1891254, incorporating the packaging correction from 68c95ba. No exporter runtime or driver …
Status: Shipped in v1.6.0. Decision date / last verification: 2026-11-08 / 2026-11-09. Scope: Container and release-validation changes based on v1.5.0 source 1891254, incorporating the packaging correction from 68c95ba. No exporter runtime or driver …
-
Target Identity and Consistent Health Responses
Status: Original contract shipped in v1.5.0; the 2026-11-09 health amendment shipped in v1.6.0. Decision / last verification: Original decision 2026-10-23; health amendment and local verification 2026-11-09. Scope: v1.5.0 at source 1891254 (fix …
Status: Original contract shipped in v1.5.0; the 2026-11-09 health amendment shipped in v1.6.0. Decision / last verification: Original decision 2026-10-23; health amendment and local verification 2026-11-09. Scope: v1.5.0 at source 1891254 (fix …
-
Correcting Replication Collector Identity and Semantics
Status: Shipped in v1.5.0. Decision date / last verified: 2026-10-22 / 2026-10-23. Scope: Collector corrections in pg_exporter main commit d97ba38fc8390984df994b2f9ea58b43ecfc8b89, based on 72f00a4fa4e6eb7524174f2122b3fe1e1d608db4; PostgreSQL …
Status: Shipped in v1.5.0. Decision date / last verified: 2026-10-22 / 2026-10-23. Scope: Collector corrections in pg_exporter main commit d97ba38fc8390984df994b2f9ea58b43ecfc8b89, based on 72f00a4fa4e6eb7524174f2122b3fe1e1d608db4; PostgreSQL …
-
Turning PostgreSQL CSV Logs into Durable Metrics
PostgreSQL logs record events that SQL snapshots can miss: deadlocks, authentication failures, canceled autovacuum workers, checkpoints, temporary-file removals, and client disconnects. They can also report statement duration, according to the …
PostgreSQL logs record events that SQL snapshots can miss: deadlocks, authentication failures, canceled autovacuum workers, checkpoints, temporary-file removals, and client disconnects. They can also report statement duration, according to the …
-
Caching pgBackRest Metrics Outside the Scrape Path
pgbackrest info --output=json reports backup state. The command can contact remote repositories and wait for storage. Running it during a Prometheus request would add that delay to database monitoring. Status: Implemented but unreleased. Decision …
pgbackrest info --output=json reports backup state. The command can contact remote repositories and wait for storage. Running it during a Prometheus request would add that delay to database monitoring. Status: Implemented but unreleased. Decision …
-
The PostgreSQL Observability Product We Chose Not to Build
We first considered a local PostgreSQL incident workbench. It would read structured logs, reconstruct session timelines, provide interactive filters and a terminal interface, and later run as an agent. Status: Superseded on 2026-08-24 by PostgreSQL …
We first considered a local PostgreSQL incident workbench. It would read structured logs, reconstruct session timelines, provide interactive filters and a terminal interface, and later run as an agent. Status: Superseded on 2026-08-24 by PostgreSQL …
-
One Endpoint, Several Sources: The Composite Exporter Contract
Composite mode combines PostgreSQL, PgBouncer, Patroni, pgBackRest, and PostgreSQL log metrics in one /metrics endpoint. It reduces the number of processes and scrape targets for a database node. PostgreSQL remains the primary source; each optional …
Composite mode combines PostgreSQL, PgBouncer, Patroni, pgBackRest, and PostgreSQL log metrics in one /metrics endpoint. It reduces the number of processes and scrape targets for a database node. PostgreSQL remains the primary source; each optional …
-
Snapshot Histograms Are Gauges, Not Counters
A scalar metric cannot describe the distribution of a changing population. One 30-minute transaction and one hundred 18-second transactions have the same total age, but different counts, maxima, and operational effects. Status: Shipped in v1.4.0. …
A scalar metric cannot describe the distribution of a changing population. One 30-minute transaction and one hundred 18-second transactions have the same total age, but different counts, maxima, and operational effects. Status: Shipped in v1.4.0. …
-
Adopting the Victoria observability stack in Pigsty
This article describes the Pigsty v4 beta in December 2025. While preparing Pigsty v4.0, I replaced the default Prometheus and Loki services with VictoriaMetrics and VictoriaLogs. I also added VictoriaTraces. The aim was to reduce storage and memory …
This article describes the Pigsty v4 beta in December 2025. While preparing Pigsty v4.0, I replaced the default Prometheus and Loki services with VictoriaMetrics and VictoriaLogs. I also added VictoriaTraces. The aim was to reduce storage and memory …
-
PGCon.Dev 2024: The Week PostgreSQL Commits Paused
This is a June 2024 conference report. Roles, package counts, and proposals reflect that event. PGCon, the predecessor to PGCon.Dev, was held in Ottawa from 2007 through 2023. It brought PostgreSQL developers together to discuss the project’s …
This is a June 2024 conference report. Roles, package counts, and proposals reflect that event. PGCon, the predecessor to PGCon.Dev, was held in Ottawa from 2007 through 2023. It brought PostgreSQL developers together to discuss the project’s …
-
PostgreSQL Macro Query Optimization with pg_stat_statements
This article describes the monitoring approach used in 2023. Its examples use PostgreSQL 15 fields and the dashboards available at that time. Slow queries increase response times and consume database resources. They can also prolong lock contention …
This article describes the monitoring approach used in 2023. Its examples use PostgreSQL 15 fields and the dashboards available at that time. Slow queries increase response times and consume database resources. They can also prolong lock contention …
-
Monitor Existing PostgreSQL with Pigsty: RDS, PolarDB, and Self-Hosted Databases
This tutorial describes Pigsty and Alibaba Cloud services as used in September 2023. Commands, prices, and dashboard details reflect that period. Pigsty is a PostgreSQL distribution. You can also use it solely to monitor PostgreSQL and hosts. This …
This tutorial describes Pigsty and Alibaba Cloud services as used in September 2023. Commands, prices, and dashboard details reflect that period. Pigsty is a PostgreSQL distribution. You can also use it solely to monitor PostgreSQL and hosts. This …
-
Diagnose PostgreSQL slow queries
This walkthrough uses the Pigsty sandbox and dashboards from February 2021. Slow queries occupy connections, hold locks, and consume CPU and I/O. On a standby, a long query can conflict with WAL replay. PostgreSQL can delay replay or cancel the …
This walkthrough uses the Pigsty sandbox and dashboards from February 2021. Slow queries occupy connections, hold locks, and consume CPU and I/O. On a standby, a long query can conflict with WAL replay. PostgreSQL can delay replay or cancel the …
-
The First Pigsty Release
This article describes Pigsty at its January 2021 release. Today, I released Pigsty. Official website: pigsty.cc What is Pigsty? Pigsty monitors large PostgreSQL fleets and automates the deployment of highly available clusters. It is free, …
This article describes Pigsty at its January 2021 release. Today, I released Pigsty. Official website: pigsty.cc What is Pigsty? Pigsty monitors large PostgreSQL fleets and automates the deployment of highly available clusters. It is free, …
-
Golden Monitoring Metrics: Errors, Latency, Throughput, Saturation
Written in 2020. The metric counts and examples describe the deployment at that time. Preface Operating a database is like driving a car: both require attention to a dashboard. Metrics show the current state and help you decide when to act. Cars …
Written in 2020. The metric counts and examples describe the deployment at that time. Preface Operating a database is like driving a car: both require attention to a dashboard. Metrics show the current state and help you decide when to act. Cars …
-
Introducing Pigsty, a PostgreSQL Monitoring System
This article presents Pigsty as it stood in May 2020. Metric counts and dashboard names describe that system. I recently built a database monitoring system called Pigsty. This article describes its architecture, dashboards, and metrics. Pigsty uses …
This article presents Pigsty as it stood in May 2020. Metric counts and dashboard names describe that system. I recently built a database monitoring system called Pigsty. This article describes its architecture, dashboards, and metrics. Pigsty uses …
-
PostgreSQL's KPI
Written in 2020. This article develops a load indicator from PgBouncer transaction time. PG Load measures accumulated transaction time per second, divided by a chosen concurrency value. It combines the amount of work a database handles with the time …
Written in 2020. This article develops a load indicator from PgBouncer transaction time. PG Load measures accumulated transaction time per second, divided by a chosen concurrency value. It combines the amount of work a database handles with the time …
-
An Overview of PostgreSQL Monitoring
This article describes a monitoring system from December 2018. Its dashboard layout and statistics-collector details belong to that period. Using monitoring to manage PostgreSQL Managing PostgreSQL requires an understanding of its operating state. …
This article describes a monitoring system from December 2018. Its dashboard layout and statistics-collector details belong to that period. Using monitoring to manage PostgreSQL Managing PostgreSQL requires an understanding of its operating state. …
-
Relation Bloat Monitoring and Management
This article was written in 2018. It explains statistics-based bloat estimates and maintenance practices from that period. PostgreSQL uses MVCC to let transactions work with different row versions. Old versions can leave tables and indexes larger …
This article was written in 2018. It explains statistics-based bloat estimates and maintenance practices from that period. PostgreSQL uses MVCC to let transactions work with different row versions. Old versions can leave tables and indexes larger …
-
Monitoring Table Size in PostgreSQL
This 2018 article explains physical storage for ordinary PostgreSQL tables. Table Storage Layout An ordinary table has its own storage and may also have a TOAST table: Main table: stores row data, relkind='r'. TOAST table: stores out-of-line values …
This 2018 article explains physical storage for ordinary PostgreSQL tables. Table Storage Layout An ordinary table has its own storage and may also have a TOAST table: Main table: stores row data, relkind='r'. TOAST table: stores out-of-line values …
-
PostgreSQL Server Log Configuration
This article was written in 2018. The table definitions below use the 23-column PostgreSQL 10 CSV format, and the Filebeat example uses the legacy prospectors configuration. CSV logs can be imported into PostgreSQL tables or queried through file_fdw …
This article was written in 2018. The table definitions below use the 23-column PostgreSQL 10 CSV format, and the Filebeat example uses the legacy prospectors configuration. CSV logs can be imported into PostgreSQL tables or queried through file_fdw …