Skip to content

safe_wal_size not available on pg12 #1097

Closed
@michael-todorovic

Description

@michael-todorovic

What did you do?
I'm running postgres_exporter in multi-target mode and target a pg 12.17 cluster

What did you expect to see?
No issues

What did you see instead? Under which circumstances?
I got the following error mesage:

{"time":"2024-11-27T16:42:03.793572559Z","level":"ERROR","source":"collector.go:201","msg":"collector failed","target":"<server>:5431/db","name":"replication_slot","duration_seconds":0.028229965,"err":"pq: column \"safe_wal_size\" does not exist"}

This column exists starting pg13 so the exporter is likely missing a version check

Environment

  • postgres_exporter version:
postgres_exporter, version 0.16.0 (branch: HEAD, revision: a324fe37bca5193a293118b940b3df7ab3a8505c)
  build user:       root@buildkitsandbox
  build date:       20241127-14:34:19
  go version:       go1.23.0
  platform:         linux/amd64
  tags:             unknown
  • postgres_exporter flags:
    --config.file=/app/postgres_exporter.yml
    --log.format=json
    --collector.postmaster
    --collector.index
    --collector.stat_user_indexes
    --collector.stat_checkpointer
  • PostgreSQL version:

    12.17

I'll try to provide a PR for that

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions