Pgconn module written by Jackc is only targeted for PostgreSQL, and pgmetrics uses that module for PostgreSQL and pgbouncer, which is leading to this error. pgmetrics takes the first connection to the server and runs a query. Before running the second query, it verifies whether the connection is alive by sending the comment to the server "-- ping" and PostgreSQL accepts it as a comment. But pgbouncer considered it as a command and ran it, which ended up with ERROR invalid command '-- ping', use SHOW HELP;