# PG Exporter v1.5.0

> Go 1.27.3, security updates, correct replication identity, safer target URLs, and consistent runtime state

---

LLMS index: [llms.txt](/llms.txt)

---

PG Exporter v1.5.0 updates the Go toolchain and dependencies, fixes replication collector identity and state mappings, and closes six runtime defects around target URLs, discovery, health, collector planning, durations, and HTTP routing.

The bundle still contains **58 YAML files, 96 collector branches, 59 namespaces, and 460 distinct metric definitions**. The metric count spans all version branches, including disabled collectors and two unexpanded SQL histograms; it is not a promise of 460 series in each scrape.

## Changes {#changes}

- **Safer connection URLs:** malformed URL syntax, query escaping, or unsafe decoded parameter names stop startup without exposing the original connection string. Explicit TLS options can no longer disappear silently when malformed parameters are normalized. An empty or whitespace-only selected `PG_EXPORTER_URL_FILE` also fails startup.
- **Correct database discovery:** database identity follows `lib/pq`, including the `dbname` and `database` aliases. Discovery removes conflicting database parameters when substituting a database path and preserves special characters. This prevents repeated collection of one database, duplicate samples, and resulting HTTP 500 responses.
- **Consistent health responses:** each response derives its status code and body from one atomic state snapshot. Concurrent probes, scrapes, and reloads can no longer combine HTTP 200 with a `down` or `starting` body. Health still reports cached target state.
- **Collector plans follow metadata:** changes to the connected user, schema set, or extension set invalidate the plan after a successful metadata precheck. New eligible collectors appear on the next scrape; removed dependencies stop selecting collectors. Unchanged sets preserve their caches.
- **Bounded configuration durations:** YAML TTLs, timeouts, and predicate TTLs reject NaN, infinity, and positive duration overflow. Zero/default semantics and finite negative timeouts that disable deadlines remain unchanged.
- **Reachable metrics paths:** startup checks the actual metrics handler selected by the active HTTP mux, including decoded paths and redirects. A path cannot pass validation while routing to the homepage or a redirect.
- **Replication identity and states:** every `pg_sub_*` sample gains a `datname` label, distinguishing subscriptions with the same name in different databases. `pg_recv_state` uses the actual receiver states, and its legacy query uses PG9.6-compatible `substring()`.
- **More precise collector descriptions:** document optional replication-origin permissions, publication table counts versus subscription table/sequence counts, and `pg_backend` grouping by backend type. These description changes do not add metric families or enable optional collectors.

## Metric and dashboard compatibility {#metric-compatibility}

Compared with v1.4.1 on the same PostgreSQL version, **v1.5.0 does not add, remove, or rename bundled SQL metric names**. Types and units remain unchanged, but labels and state mappings do change. PostgreSQL 19 support first shipped in [v1.3.0](/release/v1.3.0/); upgrading the database can also change the selected SQL branch and a metric's meaning.

| Scope | Metrics | Compatibility action |
|:---|:---|:---|
| v1.5.0 configuration | `pg_sub_*` | Adds `datname` to every sample. Keep database and subscription identity in joins and aggregations; new label sets create new time series. |
| v1.5.0 configuration | `pg_recv_state` | Real receiver states `starting`, `waiting`, `restarting`, and `stopped` now map to 6–9 instead of `-1`. Update value mappings and state alerts; codes 1–3 are reserved. |
| PG18 → PG19 | Existing PG18 metric names | None are removed or renamed by the PG19 branches in this bundle. This does not guarantee unchanged semantics or labels from PostgreSQL itself. |
| PG19 | `pg_sub_sync_error_count` | Keeps the name but becomes the sum of table and sequence synchronization errors. For table-only alerts, use `pg_sub_sync_table_error_count`; `pg_sub_sync_seq_error_count` reports the sequence component. Do not double-count the components and their sum. |
| PG19 | `pg_sub_has_worker`, `pg_sub_reset_time`, `pg_sub_confl_*` | Adds worker presence, reset time, and eight conflict counters. The subscription row can remain without an apply worker; metric presence alone is not a worker-health check. |
| PG19 | `pg_subrel_count` | Includes sequences as well as tables; `pg_pubrel_count` still counts tables only. Review panel labels and count comparisons. |
| PG19 | `pg_wal_fpi_bytes`, `pg_lock_stat_*`, `pg_recovery_state_*`, `pg_vacuum_score_*` | Additive metrics. Recovery state is replica-only; autovacuum scores are primary-only. Existing WAL, lock-distribution, and recovery families remain. |
{.full-width .wide .expand}

Users upgrading from PG17 or earlier must also migrate older names: checkpoint metrics left `pg_bgwriter_*` in PG17, and `pg_wal_write`, `pg_wal_sync`, `pg_wal_write_time`, and `pg_wal_sync_time` are absent from PG18 onward. The [full compatibility guide](/compatibility/#older-postgresql-metrics) lists each replacement, label/aggregation differences, and mixed-version PromQL.

Before rollout, evaluate the actual dashboard and alert expressions and test missing-series input. A successful scrape does not ensure every expected metric exists; an empty alert expression can silently stop firing. The [missing-metric checks](/compatibility/#missing-metric-alerts) include a per-target rule and explain when absence is expected. The full [PG19 metric table](/compatibility/#postgresql-19-metrics) links to the tagged collector definitions; PostgreSQL validation remains scoped to 19 RC1.

## Toolchain and dependencies {#toolchain-and-dependencies}

| Component | v1.4.1 | v1.5.0 |
|:---|:---|:---|
| Go | 1.26.5 | 1.27.3 |
| `prometheus/client_golang` | 1.23.2 | 1.25.0 |
| `prometheus/common` | 0.70.0 | 0.72.1 |
| `prometheus/exporter-toolkit` | 0.17.1 | 0.20.0 |
| `golang.org/x/net` | 0.57.0 | 0.61.0 |
| `golang.org/x/crypto` | 0.54.0 | 0.58.0 |
| `golang.org/x/text` | 0.40.0 | 0.43.0 |

The database driver remains `lib/pq` 1.12.3. There is no driver migration or new optional data source in this release. Prometheus client/model/procfs, YAML, compression, OAuth2, and other transitive modules are also refreshed; a version bump alone is not evidence that an application CVE was fixed.

## Security updates {#security-updates}

The upgrade incorporates upstream security fixes; it does **not** mean every listed CVE was exploitable through PG Exporter. The comparison below uses the v1.4.1 source and dependencies with Go 1.26.5. `S` means a static symbol match, `P` an imported-package match without an affected-symbol call, and `M` a module match whose affected package is not imported. Symbol matches can be conservative and are not attack reproductions.

### Go standard library and build tools {#go-standard-library-and-build-tools}

Go **1.27.3** includes [CVE-2026-111943](https://pkg.go.dev/vuln/GO-2026-6809), which adds an X.509 denylist for untrusted intermediate certificates, plus cumulative HTTP, TLS, template, and parser fixes. The following affected standard-library entries were present in the old baseline; the match column is from Darwin/arm64 and platform-specific preconditions still apply.

| CVE | Component | First fixed version | Old baseline match |
|:---|:---|:---|:---|
| [CVE-2026-39821](https://pkg.go.dev/vuln/GO-2026-5026) | net/http, net/http/internal/http2 | 1.26.6, 1.27.0-rc.3 | P |
| [CVE-2026-46600](https://pkg.go.dev/vuln/GO-2026-5942) | net | 1.26.6, 1.27.0-rc.3 | P |
| [CVE-2026-33818](https://pkg.go.dev/vuln/GO-2026-5972) | encoding/asn1 | 1.26.6, 1.27.0-rc.3 | S |
| [CVE-2026-56859](https://pkg.go.dev/vuln/GO-2026-6088) | encoding/xml | 1.26.6, 1.27.0-rc.3 | M |
| [CVE-2026-56853](https://pkg.go.dev/vuln/GO-2026-6089) | net/http | 1.26.6, 1.27.0-rc.3 | S |
| [CVE-2026-56862](https://pkg.go.dev/vuln/GO-2026-6090) | crypto/tls | 1.26.6, 1.27.0-rc.3 | S |
| [CVE-2026-56858](https://pkg.go.dev/vuln/GO-2026-6091) | html/template | 1.26.6, 1.27.0-rc.3 | S |
| [CVE-2026-56860](https://pkg.go.dev/vuln/GO-2026-6218) | net/url | 1.26.6, 1.27.0-rc.3 | P |
| [CVE-2026-94448](https://pkg.go.dev/vuln/GO-2026-6599) | html/template | 1.26.9, 1.27.2 | S |
| [CVE-2026-97030](https://pkg.go.dev/vuln/GO-2026-6600) | html/template | 1.26.9, 1.27.2 | S |
| [CVE-2026-78659](https://pkg.go.dev/vuln/GO-2026-6603) | net/http, net/http/internal/http2 | 1.26.9, 1.27.2 | S |
| [CVE-2026-56857](https://pkg.go.dev/vuln/GO-2026-6604) | internal/syscall/windows, os | 1.26.9, 1.27.2 | P |
| [CVE-2026-56866](https://pkg.go.dev/vuln/GO-2026-6605) | net/http, net/http/httputil | 1.26.9, 1.27.2 | P |
| [CVE-2026-97031](https://pkg.go.dev/vuln/GO-2026-6607) | crypto/tls | 1.26.9, 1.27.2 | S |
| [CVE-2026-94440](https://pkg.go.dev/vuln/GO-2026-6608) | mime/multipart, net/textproto | 1.26.9, 1.27.2 | S |
| [CVE-2026-78667](https://pkg.go.dev/vuln/GO-2026-6609) | net/http | 1.26.9, 1.27.2 | P |
| [CVE-2026-78660](https://pkg.go.dev/vuln/GO-2026-6610) | net/http, net/http/internal/http2 | 1.26.9, 1.27.2 | P |
| [CVE-2026-78669](https://pkg.go.dev/vuln/GO-2026-6611) | net/http, net/http/internal/http2 | 1.26.9, 1.27.2 | S |
| [CVE-2026-78663](https://pkg.go.dev/vuln/GO-2026-6612) | net/http, net/http/internal/http2 | 1.26.9, 1.27.2 | S |
| [CVE-2026-94439](https://pkg.go.dev/vuln/GO-2026-6613) | net/http | 1.26.9, 1.27.2 | S |
| [CVE-2026-97032](https://pkg.go.dev/vuln/GO-2026-6617) | net/http, net/http/internal/http2 | 1.26.9, 1.27.2 | S |
| [CVE-2026-111943](https://pkg.go.dev/vuln/GO-2026-6809) | crypto/x509 | 1.26.10, 1.27.3 | S |
{.wide .expand}

The build toolchain also includes module/toolchain download-validation fixes **CVE-2026-56865, CVE-2026-56864, CVE-2026-94444, and CVE-2026-94447**. These strengthen the build environment, rather than describing exporter runtime vulnerabilities. The official announcements cover [Go 1.26.6](https://groups.google.com/g/golang-announce/c/94pEornpRlI), [Go 1.27.2](https://groups.google.com/g/golang-announce/c/U2fTuyDJznI), and [Go 1.27.3](https://groups.google.com/g/golang-announce/c/66pojueaQek).

### Go modules {#go-modules}

| Upgrade | Fixes included | Relevance to PG Exporter |
|:---|:---|:---|
| `x/net` 0.57.0 → 0.61.0 | [CVE-2026-78659](https://pkg.go.dev/vuln/GO-2026-6603), [CVE-2026-78660](https://pkg.go.dev/vuln/GO-2026-6610), [CVE-2026-78669](https://pkg.go.dev/vuln/GO-2026-6611), [CVE-2026-78663](https://pkg.go.dev/vuln/GO-2026-6612), [CVE-2026-97032](https://pkg.go.dev/vuln/GO-2026-6617), fixed in 0.60.0 | HTTP/2 memory amplification, malformed response framing, CPU exhaustion, flow-control accounting, and an HPACK race. Four static symbol matches and one package match in the old baseline. The same CVEs also affect Go's bundled HTTP/2 copy; do not count them twice. |
| `x/crypto` 0.54.0 → 0.58.0 | [CVE-2026-56854](https://pkg.go.dev/vuln/GO-2026-6303), fixed in 0.55.0; [CVE-2026-56855](https://pkg.go.dev/vuln/GO-2026-6355) and [CVE-2026-78662](https://pkg.go.dev/vuln/GO-2026-6354), fixed in 0.56.0 | SSH source-address authentication restrictions and deadlocks; affected packages are not imported, so these are module-level updates. |
| `x/text` 0.40.0 → 0.43.0 | [CVE-2026-56851](https://pkg.go.dev/vuln/GO-2026-6629), fixed in 0.41.0 | `secure/precis` Nickname transformation panic; affected package is not imported. |
{.wide .expand}

On 2026-10-23, `govulncheck` found **no symbol-level or imported-package vulnerabilities** in the v1.5.0 candidate for Darwin/arm64, Linux/amd64, and Windows/amd64. The unimported OpenPGP package still produces the module-only advisory [GO-2026-5932](https://pkg.go.dev/vuln/GO-2026-5932), which has no fixed version. This is not a claim that every dependency module is free of advisories. Upgrading Go alone while retaining the old modules leaves the five `x/net` matches; both the compiler and dependency changes matter.

Use the rebuilt release artifacts: installing a newer Go compiler on a host does not change an already compiled exporter binary.

## Upgrade notes {#upgrade-notes}

1. **Deploy the matching collector configuration.** Upgrading only the binary does not apply SQL or label corrections. Compare local customizations before replacing `/etc/pg_exporter.yml`.
2. **Review the `pg_sub_*` label change.** The new `datname` label creates new time series. Keep database identity in PromQL joins and aggregations where needed. `pg_sub_id` remains a Gauge.
3. **Grant the PG10–13 subscription prerequisite.** As an administrator, run the following in each database used as the exporter's **main connection database**, using the actual monitoring role. Granting it only in a subscription's database is insufficient. It does not expose `subconninfo`; PG14+ needs no extra grant under standard catalog ACLs.

   ```sql
   GRANT SELECT (oid) ON pg_catalog.pg_subscription TO monitor;
   ```

4. **Check receiver-state alerts.** `streaming=0`, `stopping=4`, `connecting=5` (PG19+), `starting=6`, `waiting=7`, `restarting=8`, `stopped=9`, and unknown/NULL `=-1`; codes 1–3 are reserved. A missing receiver row remains absent.
5. **Correct previously tolerated invalid input.** Broken URL escapes, empty selected URL files, non-finite durations, and unreachable metrics paths now fail validation. Prefer `/metrics` for compatibility with both HTTP mux implementations.

Omitted `sslmode` still defaults to `disable`; configure TLS explicitly for remote connections. The scratch container still requires a mounted CA for certificate verification. Empty YAML reloads still apply zero configured collectors, invalid files in a directory may be skipped, and `SIGTERM` does not wait for active HTTP requests. See [Security](/security/), [HTTP API](/api/), and [Bundled Collectors](/collectors/) for the operating contracts.

## Validation scope {#validation-scope}

Pre-release validation covered the race suite, both HTTP mux modes, static analysis, module and generated-config consistency, roughly 604,000 short-run fuzz cases, and six target builds. Non-superuser default collection passed on PostgreSQL 9.1–9.6, 10–18, 19 RC1, and PgBouncer 1.26.1. Runtime checks included conflicting database aliases, special database names, schema/extension changes, failed reloads, reconnect recovery, physical standby promotion, and concurrent HTTP requests. RPM/DEB installation and Docker builds were also checked.

These checks cover the recorded versions and scenarios, not every extension combination or production workload. Composite, Patroni, pgBackRest, and PostgreSQL-log components remain development work outside v1.5.0.

## Checksums {#checksums}

[SHA256 checksums](https://github.com/pgsty/pg_exporter/releases/download/v1.5.0/checksums.txt)

```checksums
4cb1dfbbc6d22101d43e0841f6d5d86042a15f3894bd6e935151a1b94b94b980  pg-exporter-1.5.0-1.aarch64.rpm
c7efed8ab2062b873c87664987d73b8ff37fde89943b98a7f1967aef7961f7eb  pg-exporter-1.5.0-1.ppc64le.rpm
6788c7cbb83e4708199f00a1ddf8057f74ba3606e28e3aa26eeaf1a453a1e1b3  pg-exporter-1.5.0-1.x86_64.rpm
91f705bbeba67a6a4c4e6a4595efb3d214f787d38d7e310c3121a594ecdce28f  pg-exporter_1.5.0-1_amd64.deb
75dd27cdd734a84d703d594d0b4173d21ff302c95cb04320da528f8789f147bd  pg-exporter_1.5.0-1_arm64.deb
f41acf7693172d5e843df2c5e49e5173e74f9519f84b5453b0dcfa834c1efaf1  pg-exporter_1.5.0-1_ppc64le.deb
f3e5d03d3c3ca7df5e50e017e1c18ec78ccdc099f610296f674349acc1466975  pg_exporter-1.5.0.darwin-amd64.tar.gz
3fb47e285c2700227b0437c827fdbf0d87a93e24befb5e94f439082073700e8d  pg_exporter-1.5.0.darwin-arm64.tar.gz
e372f6defb844b4bfbe3286b40dba3d4aae2ce72c4bed9980e3b9a56507aef56  pg_exporter-1.5.0.linux-amd64.tar.gz
19f34db9e034d1437791af52676cf32e60a669d4a5036e0cc3efbe14efb61cde  pg_exporter-1.5.0.linux-arm64.tar.gz
aef7e910480656ddc744c4d6f1cdb3448299e6c63a469d9110fdf280d0c15ac2  pg_exporter-1.5.0.linux-ppc64le.tar.gz
cf39b3ecfeeac7d088e348ab24e717e600e3f61c98611b0815fb18fef1db1d9f  pg_exporter-1.5.0.windows-amd64.tar.gz
```

**v1\.5\.0 · 2026-10-23**
- [View release](https://github.com/pgsty/pg_exporter/releases/tag/v1.5.0)
- [Source · tar\.gz](https://github.com/pgsty/pg_exporter/archive/refs/tags/v1.5.0.tar.gz)
- [Source · zip](https://github.com/pgsty/pg_exporter/archive/refs/tags/v1.5.0.zip)
- [pgsty\/pg\_exporter](https://github.com/pgsty/pg_exporter)
