Custom query is skipped on the master with the master option enabled
What did you do? Execute a custom query on the master
What did you expect to see? Executed custom query on the master
What did you see instead? Under which circumstances?
Environment
- System information:
Linux 4.19.52-1.el7.x86_64 x86_64
- postgres_exporter version:
postgres_exporter, version 0.10.0 (branch: HEAD, revision: 57719ba53cac428769aaf3c4c0bb742df3cfca98) build user: root@4dcb2c7f1315 build date: 20210709-11:49:20 go version: go1.16.5 platform: linux/amd64
- postgres_exporter flags:
--extend.query-path /etc/prometheus/postgres_exporter_queries.yaml \
--auto-discover-databases
-
PostgresSQL version:
PostgreSQL 11.12 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
-
Logs:
level=debug msg="Querying namespace" namespace=pg_vacuum_queue
level=debug msg="Query skipped..."
What is in your postgres_exporter_queries.yaml ?
edit: With master set to true in the extra query file, it means you will only run that query "once per postgres database cluster" instead of "once per database".
What is in your
postgres_exporter_queries.yaml?edit: With
masterset totruein the extra query file, it means you will only run that query "once per postgres database cluster" instead of "once per database".
@runhardr What is "postgres cluster" in the context of postgres_exporter?
(edited because of cruft that was included by reply by email)
In postres terminology you can think of a cluster as a server or instance listening on a port. Everything under the "master postgres process", in a single PGDATA dir, single configuration file, etc.
One pg cluster can have multiple databases, each database can have multiple schemas, ...
Things like streaming replication occur at the cluster level, not the database level.
That setting means "metrics for items that apply at the cluster level should only be counted once" rather than having duplicates because those cluster-wide metrics would get scraped again and again for every single database.