Skip to content

collector pg_stat_statements broken for postgresql version >= 13 #875

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

Closed
roock opened this issue Jul 25, 2023 · 3 comments
Closed

collector pg_stat_statements broken for postgresql version >= 13 #875

roock opened this issue Jul 25, 2023 · 3 comments

Comments

@roock
Copy link

roock commented Jul 25, 2023

What did you do?

starting postgresql_exportet (latest release version, 0.13.2) against a postgresql 13 database with pg_stat_stement extension enable

What did you expect to see?

pg_stat_statements are getting exported

What did you see instead? Under which circumstances?

pg_stat_statements scraper is failing

curl http://XXXXXXXX:9187/metrics |grep 'pg_scrape_collector_success{collector="stat_statements"}'
pg_scrape_collector_success{collector="stat_statements"} 0

This was already discussed in #541, but got closed as this was about the not officially supported query in queries.yml.
Now the query is part of the official collector and the README indicates that all versions from 10 to 15 are supported and tested.

Environment

Debian 10 with Postgresql 13, postgres_exporter running as binary

  • System information:
Linux XXXXX 4.19.0-24-amd64 #1 SMP Debian 4.19.282-1 (2023-04-29) x86_64 GNU/Linux
  • postgres_exporter version:
/usr/local/bin/postgres_exporter --version
postgres_exporter, version 0.13.2 (branch: HEAD, revision: 8c3604b85e38ae7141e84ecdc318b6015a196c97)
  build user:       root@2ea2be721819
  build date:       20230724-00:08:19
  go version:       go1.20.6
  platform:         linux/amd64
  tags:             netgo static_build
  • postgres_exporter flags:
/usr/local/bin/postgres_exporter --web.listen-address XXXXXXX:9187 --extend.query-path /etc/postgres_exporter/queries.yaml --collector.stat_statements --config.file /etc/postgres_exporter/postgres_exporter.yml
ls -la /etc/postgres_exporter/postgres_exporter.yml /etc/postgres_exporter/queries.yaml
-rw-r----- 1 postgres-exporter adm 0 Jul 18 17:19 /etc/postgres_exporter/postgres_exporter.yml
-rw-r----- 1 postgres-exporter adm 0 Jul 18 17:19 /etc/postgres_exporter/queries.yaml
  • PostgreSQL version:

13.11-1.pgdg100+1

  • Logs:
2023-07-25T16:25:45.927985+02:00 xxxxxxx postgres_exporter[8527]: ts=2023-07-25T14:25:45.927Z caller=collector.go:190 level=error msg="collector failed" name=stat_statements duration_seconds=0.023481794 err="pq: column pg_stat_statements.total_time does not exist"
@roock
Copy link
Author

roock commented Jul 25, 2023

This is probably fixed by #874
(I swear I search issues ans PR and there wasn't anything when I started creating the issue).

@roock roock closed this as completed Jul 25, 2023
@jiangjian0920
Copy link

postgresql version:14.8 postgres_exporter version: 0.13.2
I have used the latest installation package(postgres_exporter-0.13.2.linux-amd64.tar.gz), but the postgres_exporter still generates error messages in the logs:
caller=collector.go:190 level=error msg="collector failed" name=stat_statements duration_seconds=0.013086994 err="pq: column pg_stat_statements.total_time does not exist"

@roock
Copy link
Author

roock commented Aug 10, 2023

@jiangjian0920 Unfortunately this isn't fixed on the latest version yet. It's fixed on current master, so you cain either wait for the next release or build postgres_exporter from master yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants