pg_stat_user_tables collector only scraped targets in postgres
pg_stat_user_tables collector only scaped targets in the database of postgres, but actually in a dev or product database system, we have more databases and schemas , it should scrapd all targers in other databases and schemas in it's own namespaces, the database names self-defined or autodiscoveryed.
We have the same issue : pg_stat_user_tables and pg_iostat_user_tables are per database tables which are more usefull on user databases than on system postgres one.
As databases list is discovered thru pg_stat_database table content, these 2 collectors should iterate on them to collect data about all databases of current server.
Some old issues like #86 talk about workarounds with several exporter instances, or several servers, but auto-discovery would be much more complicated in these cases, and it was before the code included collector functions
I have the same issue. These views are really helpful in analyzing user Databases. I thought of not entering the database name in:
DATA_SOURCE_NAME=postgresql://postgres_exporter:password@localhost:5432/?sslmode=disable This also does not work as well as putting wildcards :-D
As a workaround, we found that using table pg_stat_all_tables instead of pg_stat_user_tables returns information about all tables across all databases.
But there's no more column database in this case. Thus if you have several schemas in the same database, or schemas with same name across several databases, it will be confusing.