prometheus-community / postgres_exporter

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

Image `latest` seems to not contain additional collectors #908

Closed JosefMachytkaNetApp closed 1 year ago

JosefMachytkaNetApp commented 1 year ago

Could you please check process building docker images? Looks like image latest does not contain additional collectors. Definitely not WAL related ones.

Image latest shows 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

Image master shows version:

postgres_exporter, version 0.13.1 (branch: master, revision: 31ef4ed5a2c3835bca7da0ac0a77a516af472e26)
  build user:       root@33ec95979028
  build date:       20230912-13:08:56
  go version:       go1.20.8
  platform:         linux/amd64
  tags:             netgo static_build

Thank you very much for your effort.

JosefMachytkaNetApp commented 1 year ago

OK, I think I know the answer why you excluded additional collectors from the official latest image, some additional collectors seem to be broken. This is what I see in docker logs when testing master image with different versions of PostgreSQL:

ts=2023-09-12T14:54:28.616Z caller=collector.go:199 level=error msg="collector failed" name=stat_wal_receiver duration_seconds=0.016148697 err="pq: syntax error at or near \")\""
...
ts=2023-09-12T14:54:28.607Z caller=collector.go:199 level=error msg="collector failed" name=xlog_location duration_seconds=0.006929916 err="pq: function pg_last_xlog_replay_location() does not exist"
...
ts=2023-09-12T14:54:28.618Z caller=collector.go:199 level=error msg="collector failed" name=stat_activity_autovacuum duration_seconds=0.017654145 err="pq: syntax error at or near \")\""

And the binary build from master has the same errors of course. So even my own image does not solve this problem.

JosefMachytkaNetApp commented 1 year ago

BTW, there is another interesting problem with master build - with PostgreSQL 15 exporter opens still new and new connections into database, until it reaches max_connections limit.

sysadmind commented 1 year ago

Thank you for reporting the 3 errors in your logs. These were bugs and they should be resolved in #910. Once that is merged, you should be able to try it out.

As for latest vs master tag for our docker images, they serve separate purposes. For this project, latest is the latest tagged release. This release will be considered stable and is what most users will want to use. master is built from the master branch in git and will contain new features before they are included in an actual release. I would not recommend this for production because this code may not be up to the same quality as a release.

JosefMachytkaNetApp commented 1 year ago

Thank you, sounds good. Looking forward to test new stable release. Again - thank you very much for all your effort.