prometheus-community / prometheus-community/postgres_exporter
Postgres Exporter Metric Missing
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 3.6k
- Forks
- 835
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 10
Description
Hello, I'm creating a dashboard database using Postgres Exporter, Prometheus, and Grafana. But it seems the database is not connected to the grafana dashboard because there is no data and the database not appear on dashboard. Then i check Prometheus, there is no query for pg_stat?
The only queries available are pg_exporter_last_scrape_duration_seconds, pg_up, pg_exporter_last_scrape_error, pg_exporter_scrapes_total.
So basically, I'm missing some metrics from the PostgreSQL exporter.
Then i check debugs logs and showing like this
Can anyone help me on how to resolve this? Thank you
docker logs -f e1a02e402ab7
ts=2023-12-28T01:27:48.486Z caller=main.go:86 level=warn msg="Error loading config" err="Error opening config file "postgres_exporter.yml": open postgres_exporter.yml: no such file or directory"
ts=2023-12-28T01:27:48.486Z caller=proc.go:267 msg="Excluded databases" databases=[]
ts=2023-12-28T01:27:48.487Z caller=tls_config.go:274 level=info msg="Listening on" address=[::]:9187
ts=2023-12-28T01:27:48.487Z caller=tls_config.go:277 level=info msg="TLS is disabled." http2=false address=[::]:9187
ts=2023-12-28T01:27:51.616Z caller=collector.go:176 level=error msg="Error opening connection to database" err="error querying postgresql version: dial tcp 127.0.0.1:5432: connect: connection refused"
ts=2023-12-28T01:27:52.613Z caller=postgres_exporter.go:682 level=error err="Error opening connection to database (postgresql://postgres:PASSWORD_REMOVED@localhost:5432/%20postgres?sslmode=disable): malformed dsn "dbname=' postgres' host='localhost' password='pswr' port='5432' sslmode='disable' user='postgres'""
ts=2023-12-28T01:28:06.613Z caller=collector.go:176 level=error msg="Error opening connection to database" err="error querying postgresql version: dial tcp 127.0.0.1:5432: connect: connection refused"
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 with the Docker logs, the postgres_exporter.yml configuration reference, and the reported PostgreSQL connection errors. Verify the exporter’s connection and configuration, then check Prometheus for PostgreSQL metrics and Grafana for the corresponding dashboard data; done means those metrics are exposed and visible in the dashboard.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, grafana, postgres, prometheus
- Domain
- databases, devops, observability
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100