prometheus-community / prometheus-community/postgres_exporter

All databases are always shown, regardless of flags, connect string etc.

Open
#568 1 comment 10 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?
I'm seeing that postgres_exporter, regardless of flags provided, always collects 'all' databases for certain queries - even when specifying a very explicit connect string to a specific database.

Tried with --no-auto-discover-database, --include-databases and --exclude-databases. In practice, the database names are always shown due to (amongst others) the pg_locks metrics that are collected..

What did you expect to see?
Only the database that I want to see.

What did you see instead? Under which circumstances?
Always, all databases.

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

Reproduce the behavior in postgres_exporter using --no-auto-discover-database, --include-databases, and --exclude-databases with a connect string for one database. Trace the collection path for pg_locks and related queries; done when database names outside the requested scope are no longer 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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.