]> git.openstreetmap.org Git - chef.git/commitdiff
Add postgres metric for active WAL segments
authorTom Hughes <tom@compton.nu>
Tue, 2 May 2023 20:43:34 +0000 (21:43 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 2 May 2023 20:43:34 +0000 (21:43 +0100)
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"