prometheus-community / prometheus-community/postgres_exporter

Collectors failed for bgwriter and database

Open
#686 0 comments 0 reactions 0 assignees View on GitHub

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?
Installed the latest postgres_exporter on Linux Centos 8 with PostgreSQL 12

What did you expect to see?
The postgres_exporter working as expected as I have configured it on another Linux Centos 8 Server with PostgreSQL 14 on it the exact same way without no problems at all.

What did you see instead? Under which circumstances?
When looking at status of the created systemd file logs for the postgres_exporter, I receive odd errors regarding authentication even though the credentials are correct(The Password for postgres_exporter has no special characters). It looks to authenticate and de-authenticate according to the logs at the bottom.

When curling the metrics on the server, I don't receive close to the amount of the metrics I should. When curling the other Server's metrics with the same postgres_exporter installed, I see a lot more output and no errors.

Environment

System information:

Linux 4.18.0-240.22.1.el8_3.x86_64 x86_64

postgres_exporter version:

postgres_exporter, version 0.11.1 (branch: HEAD, revision: b5fd2465646a09bb1c8dbd5c9c00b852da93927a)
build user: root@a2c981f603ff
build date: 20220818-20:58:17
go version: go1.18.5
platform: linux/amd64

PostgreSQL Version:

12

Logs:

systemd Logs:

caller=server.go:74 level=info msg="Established new database connection" fingerprint=localhost:5432
caller=collector.go:196 level=error msg="collector failed" name=bgwriter duration_seconds=0.0069167 err="pq: password authentication failed for user \"postgres_exporter\""
caller=collector.go:196 level=error msg="collector failed" name=database duration_seconds=0.0122411 err="pq: password authentication failed for user \"postgres_exporter\""
caller=postgres_exporter.go:714 level=error err="Error opening connection to database (postgresql://postgres_exporter:PASSWORD_REMOVED@localhost:5432/DB?sslmode=disable): pq: password authentication failed for user \"postgres_exporter\""

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported setup with PostgreSQL 12, CentOS 8, and postgres_exporter 0.11.1, then compare the systemd configuration and logs with the working PostgreSQL 14 server. Inspect the collector.go, server.go, and postgres_exporter.go locations named in the logs. Done means authentication errors are resolved and the expected bgwriter, database, and other metrics are exposed.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, postgresql
Domain
databases, observability
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.