]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/postgresql/templates/default/postgres_queries.yml.erb
The pg_database metric is now builtin
[chef.git] / cookbooks / postgresql / templates / default / postgres_queries.yml.erb
index c2fc048c8391cf8ff1f86bbd2d334d550246d04f..da8b7bbc962a564bfa15433c50e478aeebdf89fa 100644 (file)
@@ -123,17 +123,15 @@ pg_statio_user_tables:
         description: "Number of buffer hits in this table's TOAST table indexes (if any)"
 <% end -%>
 
-pg_database:
-  query: "SELECT pg_database.oid AS datid, pg_database.datname, pg_database_size(pg_database.datname) AS size_bytes FROM pg_database"
-  master: true
-  cache_seconds: 30
+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:
-    - datid:
-        usage: "LABEL"
-        description: "ID of the database"
     - datname:
         usage: "LABEL"
         description: "Name of the database"
-    - size_bytes:
+    - xid_age:
+        usage: "GAUGE"
+        description: "Age of the oldest unfrozen transaction ID in this database"
+    - mxid_age:
         usage: "GAUGE"
-        description: "Disk space used by the database"
+        description: "Age of the oldest unfrozen multixact ID in this database"