Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metrics are not visible for Azure Postgress PaaS service #401

Open
nikbhadane opened this issue Jun 3, 2020 · 10 comments
Open

Metrics are not visible for Azure Postgress PaaS service #401

nikbhadane opened this issue Jun 3, 2020 · 10 comments

Comments

@nikbhadane
Copy link

Hi all,
We are using postgres_exporter in Kubernetes environment to fetch postgres metrics. And for monitoring we are using Grafana with Prometheus as a data source.
In Postgres-exporter DATA_SOURCE_NAME we are putting Azure PostgreSQL PaaS service details with "ssmode=require".

But the metrics are not able to showing any data when we execute any pg_* in Prometheus.
don't know why it is happening.

Also in postgres_exporter there in no such error or warning message.

Can someone please help?

@nikbhadane nikbhadane changed the title Metrics are not visible in Azure Postgress PaaS service Metrics are not visible for Azure Postgress PaaS service Jun 3, 2020
@alexinthesky
Copy link

Hi how can actually have the exporter connect correctly to managed postgres?
no luck here because user format is "postgres@DB_NAME" and postgres_exporter does not seam happy with @ char

@nadley
Copy link

nadley commented Oct 16, 2020

Hi how can actually have the exporter connect correctly to managed postgres?
no luck here because user format is "postgres@DB_NAME" and postgres_exporter does not seam happy with @ char

Did you find a solution for that ?

@mbanck
Copy link
Contributor

mbanck commented Nov 26, 2021

For the record, the new (still in preview) Azure Flexible Server no longer has that user@instance login thing.
We were using postgres_exporter with the old/current Azure Single Server successfully for a long time, I think the trick is to HTML-encode the @ in the username, i.e. replace it with %40

@songleo
Copy link

songleo commented Apr 7, 2022

when I try to connect the Postgres on Azure, I get the following error:

ts=2022-04-07T09:23:03.681Z caller=main.go:123 level=info msg="Listening on address" address=:9187
ts=2022-04-07T09:23:03.682Z caller=tls_config.go:195 level=info msg="TLS is disabled." http2=false
ts=2022-04-07T09:23:08.099Z caller=server.go:74 level=info msg="Established new database connection" fingerprint=test.postgres.database.azure.com:5432
ts=2022-04-07T09:23:09.139Z caller=postgres_exporter.go:731 level=error err="Error opening connection to database (postgres://user1:PASSWORD_REMOVED@test.postgres.database.azure.com/postgres?sslmode=disable): pq: no pg_hba.conf entry for host \"66.187.232.127\", user \"user1\", database \"postgres\", SSL off"

so that means the postgres-exorter can not support the Azure Postgres? thanks

@mbanck
Copy link
Contributor

mbanck commented Apr 7, 2022

@songleo it seems you haven't whitelisted the IP the exporter is connecting from, so Azure rejects it: pq: no pg_hba.conf entry for host \"66.187.232.127\",

@alexinthesky
Copy link

alexinthesky commented Apr 7, 2022 via email

@songleo
Copy link

songleo commented Apr 7, 2022

@mbanck thank you so much, but the IP is dynamic. so do you know how to handle this case?

@songleo
Copy link

songleo commented Apr 7, 2022

You also have to set ssl to required Le jeu. 7 avr. 2022 à 12:05, Michael Banck @.> a écrit :

@songleo https://github.com/songleo it seems you haven't whitelisted the IP the exporter is connecting from, so Azure rejects it: pq: no pg_hba.conf entry for host "66.187.232.127", — Reply to this email directly, view it on GitHub <#401 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADRP4PPREILTOXKNTPABQ6TVD2XODANCNFSM4NRODGOA . You are receiving this because you commented.Message ID: @.
>

thanks, let me try it with the SSL

@songleo
Copy link

songleo commented Apr 7, 2022

@mbanck do we have a doc or guide I can follow with? thanks

@mbanck
Copy link
Contributor

mbanck commented Apr 7, 2022

There's nothing to follow and this is not postgres_exporter specific, this is basic managed postgres - You need to use a VPN or deploy postgres_exporter on a VM with stable IP or something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants