]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/postgresql/templates/default/postgres_queries.yml.erb
Add postgres metric for active WAL segments
[chef.git] / cookbooks / postgresql / templates / default / postgres_queries.yml.erb
index 37d854f7725221589d40bef998a6b9f153b0bd49..daf3fa5a1d5fe311502abdfb97369212cfb04503 100644 (file)
@@ -135,3 +135,11 @@ pg_unfrozen_ids:
     - mxid_age:
         usage: "GAUGE"
         description: "Age of the oldest unfrozen multixact ID in this database"
+
+pg_wal:
+  query: "SELECT count(*) AS segment_count FROM pg_ls_waldir() WHERE name ~ '^[0-9A-Z]{24}$'"
+  master: true
+  metrics:
+    - segment_count:
+        usage: "GAUGE"
+        description: "Number of WAL segments"