PG Exporter v1.4.0
Snapshot histograms, pg_xact_age collector, HTTP hardening
v1.4.0 introduces the Snapshot Histogram metric type and the new pg_xact_age transaction age collector, along with a round of systematic hardening across HTTP routing, packaging, and the build toolchain.
New Features
- New
HISTOGRAMcolumn type: SQL query snapshots can be aggregated per label group into classic Prometheus histograms, deriving_bucket/_count/_sumseries families; bucket bounds are strictly validated at config load time (finite, strictly increasing,+Infappended automatically),lebecomes a reserved label, and hot reload is fully supported - New
pg_xact_agecollector: exposes the distribution of open transaction age (pg_xact_age_seconds) and idle-in-transaction age (pg_xact_age_idle_seconds) as histograms; cluster-level collection, client backends only, 10s TTL - Default config bundle grows from 57 to 58 definition files;
pg_xact_agetakes slot0450, withpg_lock/pg_lock_stat/pg_queryrenumbered to0460/0470/0480(contents unchanged)
Fixes & Improvements
- HTTP route registration is isolated to a private ServeMux instead of the global
DefaultServeMux, so endpoints registered by third-party libraries can no longer be exposed accidentally --web.telemetry-pathis strictly validated at startup: empty paths, paths not starting with/, paths containing?#{}, conflicts with built-in endpoints, and non-canonical paths like//metricsthat could never be matched all fail fast with a clear error- The landing page HTML-escapes the telemetry path
- The primary connection pool is properly closed when
--fail-fastpre-check fails - RPM / DEB packaging fixes (#105): the
prometheussystem user’s HOME now points to/var/lib/prometheus(where libpq looks for~/.pgpass), and the packaged default URL gains the/postgresdatabase name so libpq no longer falls back to a database named after the OS user - Version string unified with the
vprefix:--versionoutput, the/versionendpoint, and thepg_exporter_build_info{version=...}label of official release binaries now reportv1.4.0(GoReleaser artifacts previously reported unprefixed1.3.0); artifact file names, package versions, and Docker image tag conventions are unchanged - Histogram value casting aligned with the scalar path: timestamp and boolean columns are exempt from
scale - GoReleaser embedded package metadata corrected: supported range updated to PostgreSQL
9.x - 19+and PgBouncer1.8 - 1.25+ make dockerrestoresGOPROXY/GOSUMDBbuild-arg passthrough
Engineering & Build
- Build toolchain updated to Go
1.26.5, exporter-toolkitv0.17.1, and prometheus/commonv0.70.0 - New regular CI verification workflow: module tidy check, generated-config drift check (
make confoutput must stay in sync withconfig/*.yml), race tests, and six-platform cross-builds - Docker build tooling consolidated: the
docker/scripts andmake docker-releaseare removed; multi-arch release images are built by GoReleaser - Config coverage tests generalized: tests no longer assume specific collectors exist in the config directory, making trimmed custom bundles easier to maintain
Upgrade Notes
- If you were running with a non-canonical telemetry path (e.g.
//metrics), the process will now refuse to start — previously it started but the metrics endpoint was silently unreachable - Automation that parses the
versionlabel ofpg_exporter_build_infoor the--versionoutput needs to accommodate thevprefix - When any
HISTOGRAMcollector is configured,lecan no longer be used as a constant label
Checksums
https://github.com/pgsty/pg_exporter/releases/download/v1.4.0/checksums.txt
