X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/dc7216b15b33567990e864c855d928ac9e73ad07..a19f9c4c8ce5cbc8b5b73d2d33de98bae686176b:/cookbooks/postgresql/templates/default/postgres_queries.yml.erb diff --git a/cookbooks/postgresql/templates/default/postgres_queries.yml.erb b/cookbooks/postgresql/templates/default/postgres_queries.yml.erb index c2fc048c8..f513b33e7 100644 --- a/cookbooks/postgresql/templates/default/postgres_queries.yml.erb +++ b/cookbooks/postgresql/templates/default/postgres_queries.yml.erb @@ -137,3 +137,16 @@ pg_database: - size_bytes: usage: "GAUGE" description: "Disk space used by the database" + +pg_unfrozen_ids: + query: "SELECT current_database() AS datname, max(age(relfrozenxid)) AS xid_age, max(mxid_age(relminmxid)) AS mxid_age FROM pg_class WHERE relkind IN ('r', 'm')" + metrics: + - datname: + usage: "LABEL" + description: "Name of the database" + - xid_age: + usage: "GAUGE" + description: "Age of the oldest unfrozen transaction ID in this database" + - mxid_age: + usage: "GAUGE" + description: "Age of the oldest unfrozen multixact ID in this database"