]> git.openstreetmap.org Git - chef.git/blob - cookbooks/postgresql/templates/default/postgres_queries.yml.erb
Report database size and replication delay for postgres
[chef.git] / cookbooks / postgresql / templates / default / postgres_queries.yml.erb
1 pg_replication:
2   query: "SELECT EXTRACT(EPOCH FROM (now() - pg_last_xact_replay_timestamp())) AS lag_seconds"
3   master: true
4   metrics:
5     - lag_seconds:
6         usage: "GAUGE"
7         description: "Replication lag behind master in seconds"
8
9 pg_database:
10   query: "SELECT pg_database.oid AS datid, pg_database.datname, pg_database_size(pg_database.datname) AS size_bytes FROM pg_database"
11   master: true
12   cache_seconds: 30
13   metrics:
14     - datid:
15         usage: "LABEL"
16         description: "ID of the database"
17     - datname:
18         usage: "LABEL"
19         description: "Name of the database"
20     - size_bytes:
21         usage: "GAUGE"
22         description: "Disk space used by the database"