# Prometheus Postgres Exporter failing to connect Database

**URL:** <https://forums.percona.com/t/prometheus-postgres-exporter-failing-to-connect-database/28844>\
**Category:** Percona Operator for PostgreSQL\
**Created:** [February 29, 2024, 2:32pm UTC](https://forums.percona.com/t/prometheus-postgres-exporter-failing-to-connect-database/28844 "2024-02-29T14:32:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rohan\_Roy\_Sharma](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/rohan_roy_sharma/32/15194_2.png) [@Rohan\_Roy\_Sharma](https://forums.percona.com/u/Rohan_Roy_Sharma)\
**Post date:** [February 29, 2024, 2:32pm UTC](https://forums.percona.com/t/prometheus-postgres-exporter-failing-to-connect-database/28844/1 "2024-02-29T14:32:50Z")

</div>

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:

```auto
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

---

<div class="post-metadata">

**Author:** ![Sergey\_Pronin](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sergey_pronin/32/14887_2.png) [@Sergey\_Pronin](https://forums.percona.com/u/Sergey_Pronin)\
**Post date:** [March 7, 2024, 8:14pm UTC](https://forums.percona.com/t/prometheus-postgres-exporter-failing-to-connect-database/28844/2 "2024-03-07T20:14:20Z")

</div>

Hey @Rohan_Roy_Sharma ,

for pg\_hba tuning pls look here: [Changing PostgreSQL options - Percona Operator for PostgreSQL](https://docs.percona.com/percona-operator-for-postgresql/2.0/options.html)

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