From 684e924211a6a0cefe38b38ad1a5509ea01235a8 Mon Sep 17 00:00:00 2001 From: Tristan Partin Date: Wed, 25 Sep 2024 13:18:34 -0500 Subject: [PATCH] Fix compute_logical_snapshot_files for v14 The function, pg_ls_logicalsnapdir(), was added in version 15. Signed-off-by: Tristan Partin --- compute/etc/neon_collector.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compute/etc/neon_collector.yml b/compute/etc/neon_collector.yml index 29be0958dd..acb17d3cc0 100644 --- a/compute/etc/neon_collector.yml +++ b/compute/etc/neon_collector.yml @@ -195,7 +195,7 @@ metrics: -- Postgres creates temporary snapshot files of the form %X-%X.snap.%d.tmp. These -- temporary snapshot files are renamed to the actual snapshot files after they are -- completely built. We only WAL-log the completely built snapshot files. - (SELECT COUNT(*) FROM pg_ls_logicalsnapdir() WHERE name LIKE '%.snap') AS num_logical_snapshot_files; + (SELECT COUNT(*) FROM pg_ls_dir('pg_logical/snapshots') AS name WHERE name LIKE '%.snap') AS num_logical_snapshot_files; # In all the below metrics, we cast LSNs to floats because Prometheus only supports floats. # It's probably fine because float64 can store integers from -2^53 to +2^53 exactly. @@ -244,4 +244,3 @@ metrics: SELECT slot_name, CASE WHEN wal_status = 'lost' THEN 1 ELSE 0 END AS wal_is_lost FROM pg_replication_slots; -