Vonng / pg_exporter

Advanced PostgreSQL & Pgbouncer Metrics Exporter for Prometheus
https://pigsty.io
Apache License 2.0
164 stars 42 forks source link

Switch from unmaintained lib/pq driver to pgx with stdlib wrapper #52

Closed ringerc closed 4 weeks ago

ringerc commented 4 weeks ago

Driver github.com/lib/pq states that it is in maintenance mode.

pgx offers built-in connection pooling and much more, and is actively maintained.

The default URI postgresql:///?sslmode=disable will work out of the box with a unix socket connection, or one can be specified with e.g. -u 'postgres://postgres@:/?sslmode=disable&host=/var/run/postgresql'

It's possible that some driver-specific options may vary, so this merits more testing. It should be possible to make it a CLI option and mark lib/pq deprecated rather than switching immediately, if that is deemed necessary.