prometheus-community / prometheus-community/postgres_exporter
SCRAM-SHA-256 is not supported by postgres exporter, getting authentication failed error
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 3.6k
- Forks
- 835
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 10
Description
What did you do?
What did you expect to see?
Postgres exporter must be able to connect to postgres database if SCRAM-SHA-256 is enabled .
What did you see instead? Under which circumstances?
Getting this error:-
Aug 28 08:56:13 HOSTNAME postgres_exporter[2177291]: ts=2023-08-28T08:56:13.556Z caller=server.go:74 level=info msg="Established new database connection" fingerprint=localhost:5432
Aug 28 08:56:14 XXXXXXXX.com postgres_exporter[2177291]: ts=2023-08-28T08:56:14.562Z caller=postgres_exporter.go:691 level=error err="Error opening connection to database (postgresql://postgres_exporter:PASSWORD_REMOVED@localhost:5432/postgres?sslmode=disable): pq: password authentication failed for user "postgres_exporter""
Postgres exporter is unable to connect to postgres database . Both postgres exporter and Postgres database are running on same server.
Environment
-
System information:
insert output of
uname -srmhere
Linux 4.18.0-425.19.2.el8_7.x86_64 x86_64
-
postgres_exporter version:
insert output of
postgres_exporter --versionhere
postgres_exporter, version 0.13.1 -
postgres_exporter flags:
insert list of flags used here
-
PostgreSQL version:
insert PostgreSQL version here
PostgreSQL 14.7 (EnterpriseDB Advanced Server 14.7.0) on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-16), 64-bit -
Logs:
insert logs relevant to the issue here
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the SCRAM-SHA-256 connection failure with PostgreSQL 14.7 and postgres_exporter 0.13.1. Review the connection-related paths reported in server.go and postgres_exporter.go, then verify that the exporter connects successfully with SCRAM-SHA-256 and collects metrics without the authentication error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, postgresql
- Domain
- databases, observability-sre
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100