Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checkpoints_timed not found when monitoring Postgres 17beta3 #1060

Open
HansK-p opened this issue Aug 18, 2024 · 5 comments · May be fixed by #1072
Open

checkpoints_timed not found when monitoring Postgres 17beta3 #1060

HansK-p opened this issue Aug 18, 2024 · 5 comments · May be fixed by #1072

Comments

@HansK-p
Copy link

HansK-p commented Aug 18, 2024

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.

  • System information:
image: postgres:17beta3
prometheuscommunity/postgres-exporter:v0.15.0
  • postgres_exporter version: v0.15.0

  • postgres_exporter flags: none

  • PostgreSQL version: postgres 17beta3

  • Logs:

caller=collector.go:202 level=error msg="collector failed" name=stat_bgwriter duration_seconds=0.018634044 err="pq: column \"checkpoints_timed\" does not exist"
@n-rodriguez
Copy link
Contributor

n-rodriguez commented Sep 28, 2024

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
Copy link

vincejv commented Oct 8, 2024

is there a way to silence these logs while #1072 is being reviewed?

@hiteshnayak305
Copy link

+1

n-rodriguez added a commit to n-rodriguez/postgres_exporter that referenced this issue Oct 17, 2024
@High5Apps
Copy link

High5Apps commented Oct 17, 2024

@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

High5Apps added a commit to High5Apps/organize-backend that referenced this issue Oct 17, 2024
- Fix checkpoints_timed not found error by using the `--no-collector.stat_bgwriter` flag in the docker compose command
  - This flag can be removed once the issue below is fixed, and a new docker image is released
  - prometheus-community/postgres_exporter#1060
- https://github.com/prometheus-community/postgres_exporter
- https://www.rockdata.net/external/postgres_exporter-metrics/
- https://stackoverflow.com/a/59366582
- https://hub.docker.com/r/prometheuscommunity/postgres-exporter
@vincejv
Copy link

vincejv commented Oct 19, 2024

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

n-rodriguez added a commit to n-rodriguez/postgres_exporter that referenced this issue Oct 26, 2024
n-rodriguez added a commit to n-rodriguez/postgres_exporter that referenced this issue Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants