]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/postgresql/templates/default/postgres_queries.yml.erb
Add monitoring for unfrozen IDs in postgres databases
[chef.git] / cookbooks / postgresql / templates / default / postgres_queries.yml.erb
index c2fc048c8391cf8ff1f86bbd2d334d550246d04f..f513b33e7662cee3906b2f2acc158f951d13137b 100644 (file)
@@ -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"