prometheus-community / postgres_exporter

A PostgreSQL metric exporter for Prometheus
Apache License 2.0
2.83k stars 745 forks source link

checkpoints_timed not found when monitoring Postgres 17beta3 #1060

Open HansK-p opened 3 months ago

HansK-p commented 3 months ago

What did you do? Upgraded from Postgresql 16 to Postgresql 17beta3

What did you expect to see? Monitoring working as before.

What did you see instead? Under which circumstances? The error message below is logged by postgres_exporter:

caller=collector.go:202 level=error msg="collector failed" name=stat_bgwriter duration_seconds=0.018634044 err="pq: column \"checkpoints_timed\" does not exist"

This must be as checkpoint related columns in PG 17 have been moved from pg_stat_bgwriter to pg_stat_checkpointer according to https://www.dbi-services.com/blog/postgresql-17-new-catalog-view-pg_stat_checkpointer/.

Environment Running in Kubernetes, any environment.

n-rodriguez commented 2 months ago

Same here :

PostgreSQL version

postgresql-17               17.0-1.pgdg120+1

postgres_exporter version :

root@32132694b4b9:/# postgres_exporter --version
postgres_exporter, version 0.15.0 (branch: HEAD, revision: 68c176b8833b7580bf847cecf60f8e0ad5923f9a)
  build user:       root@7c5a76bc737a
  build date:       20231027-14:38:04
  go version:       go1.21.3
  platform:         linux/arm64
  tags:             unknown
postgres-exporter-1   | {"caller":"collector.go:202","duration_seconds":0.01493675,"err":"pq: column \"checkpoints_timed\" does not exist","level":"error","msg":"collector failed","name":"stat_bgwriter","ts":"2024-09-28T16:02:37.125Z"}
postgres-1            | 2024-09-28 16:02:37 UTC [158-1] concerto@concerto ERROR:  column "checkpoints_timed" does not exist at character 10
postgres-1            | 2024-09-28 16:02:37 UTC [158-2] concerto@concerto STATEMENT:  SELECT
postgres-1            |       checkpoints_timed
postgres-1            |       ,checkpoints_req
postgres-1            |       ,checkpoint_write_time
postgres-1            |       ,checkpoint_sync_time
postgres-1            |       ,buffers_checkpoint
postgres-1            |       ,buffers_clean
postgres-1            |       ,maxwritten_clean
postgres-1            |       ,buffers_backend
postgres-1            |       ,buffers_backend_fsync
postgres-1            |       ,buffers_alloc
postgres-1            |       ,stats_reset
postgres-1            |     FROM pg_stat_bgwriter;
vincejv commented 1 month ago

is there a way to silence these logs while https://github.com/prometheus-community/postgres_exporter/pull/1072 is being reviewed?

hiteshnayak305 commented 1 month ago

+1

High5Apps commented 1 month ago

@vincejv I was able to silence the error logs by running the exporter with the --no-collector.stat_bgwriter flag.

For more info see the Flags section of the README

vincejv commented 1 month ago

@High5Apps thanks a lot, saved my day, also based from the linked commit add this to docker compose command: '--no-collector.stat_bgwriter'

garry-t commented 2 weeks ago

any movements here? :)