Prometheus Postgres Exporter failing to connect Database

Hi,
We are using percona operator to deploy postgres in our k8s cluster.
There are certain limitations due to which we can not use PMM and hence we switched over to community Prometheus Postgres Exporter.
However, when we deploy the exporter, it errors out with reason:

ts=2024-02-29T14:14:18.580Z caller=server.go:74 level=info msg="Established new database connection" fingerprint=pg-service-cluster-ha:5432
ts=2024-02-29T14:14:18.604Z caller=collector.go:176 level=error msg="Error opening connection to database" err="error querying postgresql version: pq: no pg_hba.conf entry for host \"127.0.0.6\", user \"USERNAME\", database \"test-db\", no encryption"
ts=2024-02-29T14:14:19.596Z caller=postgres_exporter.go:682 level=error err="Error opening connection to database (postgresql://USERNAME:PASSWORD_REMOVED@pg-service-cluster-ha:5432/test-db?sslmode=disable): pq: no pg_hba.conf entry for host \"127.0.0.6\", user \"USERNAME\", database \"test-db\", no encryption"

I don’t see an option to update the pg_hba.conf as well.
Can someone help me out here?

Thanks
Rohan Roy Sharma

Hey @Rohan_Roy_Sharma ,

for pg_hba tuning pls look here: Changing PostgreSQL options - Percona Operator for PostgreSQL

Also it would help if you share how you deploy the exporter. Is it a sidecar?