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 HISTOGRAM column type: SQL query snapshots can be aggregated per label group into classic Prometheus histograms, deriving _bucket / _count / _sum series families; bucket bounds are strictly validated at config load time (finite, strictly increasing, +Inf appended automatically), le becomes a reserved label, and hot reload is fully supported
  • New pg_xact_age collector: 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_age takes slot 0450, with pg_lock / pg_lock_stat / pg_query renumbered to 0460 / 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-path is strictly validated at startup: empty paths, paths not starting with /, paths containing ? # { }, conflicts with built-in endpoints, and non-canonical paths like //metrics that 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-fast pre-check fails
  • RPM / DEB packaging fixes (#105): the prometheus system user’s HOME now points to /var/lib/prometheus (where libpq looks for ~/.pgpass), and the packaged default URL gains the /postgres database name so libpq no longer falls back to a database named after the OS user
  • Version string unified with the v prefix: --version output, the /version endpoint, and the pg_exporter_build_info{version=...} label of official release binaries now report v1.4.0 (GoReleaser artifacts previously reported unprefixed 1.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 pgBouncer 1.8 - 1.25+
  • make docker restores GOPROXY / GOSUMDB build-arg passthrough

Engineering & Build

  • Build toolchain updated to Go 1.26.5, exporter-toolkit v0.17.1, and prometheus/common v0.70.0
  • New regular CI verification workflow: module tidy check, generated-config drift check (make conf output must stay in sync with config/*.yml), race tests, and six-platform cross-builds
  • Docker build tooling consolidated: the docker/ scripts and make docker-release are 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 version label of pg_exporter_build_info or the --version output needs to accommodate the v prefix
  • When any HISTOGRAM collector is configured, le can no longer be used as a constant label

Checksums

https://github.com/pgsty/pg_exporter/releases/download/v1.4.0/checksums.txt

9874191591567ede87ae1d5820f06e781f27c664a7f4a6365211f9e042fd8199  checksums.txt
c6af4ae62e13f518539a6d0b3ce86ff9f7acdb567a4f0f86c6f47563574da724  pg-exporter_1.4.0-1_amd64.deb
ff0360f61982ed627d1b1f93281a0ba66da9d077672f0c214e19522df01e40d6  pg-exporter_1.4.0-1_arm64.deb
4fbadd4e9d918c9bc8e63975378e49375b0ff897d6b8a0f78799538b13dd68a1  pg-exporter_1.4.0-1_ppc64le.deb
5ce106d27fffa77c39fea9bf7cbc60f4328df3d926fef025bfdd082eb6d743fd  pg_exporter-1.4.0-1.aarch64.rpm
870b434e802e0039f10e1e3583c28a1fd83db4363a4608e1fab7f375f6d30600  pg_exporter-1.4.0-1.ppc64le.rpm
c550d16ce3f9276948a4d44174e11716fc5e85e31e8788ea106a57cfbabd8488  pg_exporter-1.4.0-1.x86_64.rpm
11a34e531ac5d6d378b91e768f575525389141a6860afabd0cc9f2d853f06749  pg_exporter-1.4.0.darwin-amd64.tar.gz
49d8d3a5932602f433c4ef681ed12007da1cbc11b5ee0f9d7b4dc2d0dff8e26e  pg_exporter-1.4.0.darwin-arm64.tar.gz
113dfe70d4f780a456c05ca6b731f96c1013bf35ecb87d75c443fe2bac7e333b  pg_exporter-1.4.0.linux-amd64.tar.gz
68b4630ab39943658a8aff135990896a5ccf56c8a992e5982d572c78ef822e18  pg_exporter-1.4.0.linux-arm64.tar.gz
72710625e5658c941b48f7becba9a86491852cea5469240328292838d9ed0979  pg_exporter-1.4.0.linux-ppc64le.tar.gz
14a0cf6ffa04c7e54c1d5aa5b37fe4bea1429c1d1e7cce89e9dd805c4a29db0b  pg_exporter-1.4.0.windows-amd64.tar.gz

Release resources