prometheus-community / prometheus-community/postgres_exporter
After upgrade to latest 0.14.0 null values appears for various metrics
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?
upgrade to 0.14.0
What did you expect to see?
no null values
What did you see instead? Under which circumstances?
Environment
Ubuntu 22.04
-
System information:
Linux 5.15.0-57-generic x86_64 -
postgres_exporter version:
postgres_exporter, version 0.14.0 (branch: HEAD, revision: c06e57db4e502696ab4e8b8898bb2a59b7b33a59)
build user: root@f2337de13240
build date: 20230920-01:43:49
go version: go1.20.8
platform: linux/amd64
tags: netgo static_build
- postgres_exporter flags:
/opt/prometheus/postgres_exporter/postgres_exporter --collector.long_running_transactions --collector.stat_statements --web.listen-address :9187
-
PostgreSQL version:
13.3
-
Logs:
postgres_exporter[2809843]: ts=2023-11-15T19:50:31.182Z caller=postgres_exporter.go:682 level=error err="Error opening connection to database (user=postgres%20dbname=production%20host=/var/run/postgresql/%20sslmode=disable): driver: bad connection"
level=error msg="collector failed" name=stat_bgwriter duration_seconds=0.397204571 err="sql: database is closed"
:28:45.587Z caller=collector.go:199 level=error msg="collector failed" name=replication_slot duration_seconds=0.397212416 err="sql: database is closed"
:28:45.587Z caller=collector.go:199 level=error msg="collector failed" name=statio_user_tables duration_seconds=0.39728339 err="sql: database is closed"
:28:45.587Z caller=collector.go:199 level=error msg="collector failed" name=stat_statements duration_seconds=0.397285173 err="sql: database is closed"
:28:45.587Z caller=collector.go:199 level=error msg="collector failed" name=replication duration_seconds=0.39728341 err="sql: database is closed"
:28:45.587Z caller=collector.go:199 level=error msg="collector failed" name=long_running_transactions duration_seconds=0.397279512 err="sql: database is closed"
:28:45.587Z caller=collector.go:199 level=error msg="collector failed" name=locks duration_seconds=0.397212446 err="sql: database is closed"
:28:45.587Z caller=collector.go:199 level=error msg="collector failed" name=database duration_seconds=0.397266999 err="sql: database is closed"
:28:45.588Z caller=collector.go:199 level=error msg="collector failed" name=wal duration_seconds=0.397308607 err="sql: database is closed"
:28:45.588Z caller=collector.go:199 level=error msg="collector failed" name=stat_database duration_seconds=0.397292096 err="sql: database is closed"
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 reviewing the connection handling around postgres_exporter.go:682 and the collector failure path at collector.go:199, then reproduce with PostgreSQL 13.3, exporter 0.14.0, and the listed collector flags. Determine why the database connection closes and verify that the affected metrics no longer expose null values or repeated "sql: database is closed" errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, postgresql
- Domain
- databases, observability
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100