postgres_exporter
postgres_exporter copied to clipboard
Default metrics does not exclude databases
What did you do?
- Using "--auto-discover-databases"
- Using "--exclude-databases" to exclude certain default databases like "postgres", "template0", ....
What did you expect to see?
- All metrics should only generated for the databases which are not excluded
What did you see instead? Under which circumstances?
- At least the following metrics "pg_locks_count" and "pg_stat_activity_count" are also generated for excluded databases
Environment
-
postgres_exporter version:
0.11.1
-
postgres_exporter flags:
--disable-settings-metrics
--auto-discover-databases
--exclude-databases postgres,template0
-
PostgreSQL version:
14.4
Is this behavior known and is this behavior intended?
Me too. Run as
PG_EXPORTER_AUTO_DISCOVER_DATABASES=true -e PG_EXPORTER_INCLUDE_DATABASES=<my base> quay.io/prometheuscommunity/postgres-exporter
used version
postgres_exporter_build_info{branch="HEAD",goversion="go1.18.5",revision="b5fd2465646a09bb1c8dbd5c9c00b852da93927a",version="0.11.1"} 1
All data about all databases are here (include postgres. template0, template1)
pg_stat_activity_count{datname="postgres",server="<myserver>:5432",state="idle"} 4
pg_stat_activity_count{datname="template0",server="<myserver>:5432",state="idle"} 0
Also tried
-e PG_EXPORTER_AUTO_DISCOVER_DATABASES=true -e PG_EXPORTER_EXCLUDE_DATABASES=template0,template1,postgres -e PG_EXPORTER_WEB_TELEMETRY_PATH=/metric2 quay.io/prometheuscommunity/postgres-exporter
No effect about exclude, but telemetry_path changed.
Also no effect from PG_EXPORTER_AUTO_DISCOVER_DATABASES=true
, without it (default false?) all databases showed again.
I created a similar, but slightly different issue recently, #750
@CEikermann did you figure it out?