Summary
With the monitoring Compose profile, postgres-exporter logs this error on every Prometheus scrape (~15s):
level=ERROR source=collector.go:227 msg="collector failed" name=stat_replication err="pq: column \"slot_name\" does not exist"
Postgres logs the same failing query against pg_stat_replication.
This is not a Tangle Postgres or version-pinning issue. It is an upstream bug in prometheuscommunity/postgres-exporter affecting the default-enabled stat_replication collector.
Root cause
PR prometheus-community/postgres_exporter#1306 (shipped in v0.20.0) rewrote the collector with an explicit column list that includes slot_name from pg_stat_replication:
SELECT application_name, client_addr::text, state, slot_name, ...
FROM pg_stat_replication
slot_name is not a column on pg_stat_replication on any supported PostgreSQL version (including our compose postgres:latest / pinned postgres:18.4). The column lives on pg_replication_slots and must be joined.
Upstream tracking:
v0.20.0 does not include the fix. Local compose using :latest and CI/prod pins using v0.19.1 are both affected (v0.19.1 has the same broken collector after the standalone refactor landed in the release line).
Impact on Tangle
- Log spam in
postgres-exporter and db containers when --profile monitoring is active
pg_stat_replication_* metrics are missing from Prometheus
- Other postgres-exporter collectors (connections, activity, settings, etc.) still work
- Low practical impact for local dev: compose
db is single-node with no replication
Affected wiring:
docker-compose.yml — postgres-exporter service (monitoring profile)
docker/versions.prod.env — POSTGRES_EXPORTER_IMAGE=prometheuscommunity/postgres-exporter:v0.19.1
infra/azure/parameters.prod.json — same pin for ACA tangle-study-postgres-exporter
Reproduction
docker compose --profile monitoring up
# watch postgres-exporter / db logs
Confirmed with prometheuscommunity/postgres-exporter:latest reporting version 0.20.0.
Proposed workaround
Disable the broken collector until upstream ships a fix:
postgres-exporter:
command: ["--no-collector.stat_replication"]
Alternative: ignore the errors locally (harmless for dev).
Resolution criteria
Summary
With the
monitoringCompose profile,postgres-exporterlogs this error on every Prometheus scrape (~15s):Postgres logs the same failing query against
pg_stat_replication.This is not a Tangle Postgres or version-pinning issue. It is an upstream bug in
prometheuscommunity/postgres-exporteraffecting the default-enabledstat_replicationcollector.Root cause
PR prometheus-community/postgres_exporter#1306 (shipped in v0.20.0) rewrote the collector with an explicit column list that includes
slot_namefrompg_stat_replication:slot_nameis not a column onpg_stat_replicationon any supported PostgreSQL version (including our composepostgres:latest/ pinnedpostgres:18.4). The column lives onpg_replication_slotsand must be joined.Upstream tracking:
v0.20.0 does not include the fix. Local compose using
:latestand CI/prod pins usingv0.19.1are both affected (v0.19.1 has the same broken collector after the standalone refactor landed in the release line).Impact on Tangle
postgres-exporteranddbcontainers when--profile monitoringis activepg_stat_replication_*metrics are missing from Prometheusdbis single-node with no replicationAffected wiring:
docker-compose.yml—postgres-exporterservice (monitoringprofile)docker/versions.prod.env—POSTGRES_EXPORTER_IMAGE=prometheuscommunity/postgres-exporter:v0.19.1infra/azure/parameters.prod.json— same pin for ACAtangle-study-postgres-exporterReproduction
docker compose --profile monitoring up # watch postgres-exporter / db logsConfirmed with
prometheuscommunity/postgres-exporter:latestreporting version 0.20.0.Proposed workaround
Disable the broken collector until upstream ships a fix:
Alternative: ignore the errors locally (harmless for dev).
Resolution criteria
POSTGRES_EXPORTER_IMAGEindocker/versions.prod.env/infra/azure/parameters.prod.jsonpg_scrape_collector_success{collector="stat_replication"}= 1 after upgrade