From 638ba572f100a535676260d18d4ce90bcdea5c37 Mon Sep 17 00:00:00 2001 From: theTibi Date: Fri, 22 Aug 2025 10:50:47 +0200 Subject: [PATCH] PMM-14260 - duplicate metrics - we have to add master:true to the queries to make sure they only run once --- queries-hr.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/queries-hr.yml b/queries-hr.yml index eba836b78..5fd59ad67 100644 --- a/queries-hr.yml +++ b/queries-hr.yml @@ -1,4 +1,5 @@ pg_custom_replication_slots: + master: true query: | SELECT slot_name, @@ -29,6 +30,7 @@ pg_custom_replication_slots: description: "Confirmed flush LSN in bytes for the replication slot." pg_custom_stat_wal_receiver: + master: true query: | SELECT status, @@ -72,8 +74,8 @@ pg_custom_stat_wal_receiver: pg_custom_database_size_custom: + master: true query: "SELECT pg_database.datname, pg_database_size(pg_database.datname) as bytes FROM pg_database" - master: false cache_seconds: 30 metrics: - datname: @@ -84,6 +86,7 @@ pg_custom_database_size_custom: description: "Disk space used by the database" pg_custom_replication_wal: + master: true query: | SELECT pg_last_wal_receive_lsn() AS received_lsn, @@ -105,6 +108,7 @@ pg_custom_replication_wal: description: "Current WAL replication lag in bytes." pg_custom_stat_replication: + master: true query: | SELECT pid, @@ -159,6 +163,7 @@ pg_custom_stat_replication: description: "Synchronization state (e.g., async, sync)." pg_custom_stat_activity_walsender: + master: true query: | SELECT pid, @@ -190,6 +195,7 @@ pg_custom_stat_activity_walsender: description: "Current state of the WAL sender process" pg_custom_stat_subscription: + master: true query: "SELECT subid, subname, pid, received_lsn, last_msg_send_time, last_msg_receipt_time FROM pg_stat_subscription;" metrics: - subid: @@ -197,7 +203,7 @@ pg_custom_stat_subscription: description: "Subscription ID" - subname: usage: "LABEL" - description: "Subscription Name" + description: "Subscription Name" - pid: usage: "GAUGE" description: "Process ID of subscription worker" @@ -212,6 +218,7 @@ pg_custom_stat_subscription: description: "Last message receipt time" pg_custom_publication: + master: true query: "SELECT pubname, puballtables, pubinsert, pubupdate, pubdelete FROM pg_publication;" metrics: - pubname: