All databases are always shown, regardless of flags, connect string etc.
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.
This is particularly annoying when trying to scrape data from tables which only exist in user databases. The query will also be attempted on the ‘postgres’ database itself, where the respective table does not exist and thus in turn causes the exporter to throw errors and set the respective error metric to 1.