From ea3aca34553b21852e72cb4961c76eca9e530d1f Mon Sep 17 00:00:00 2001 From: James Campbell Date: Mon, 7 Jul 2025 13:15:03 -0400 Subject: [PATCH] Filter out initial logical replication sync workers * Slots are crated for each table during the initial sync, which only live for the duration of the copy for that table. * The initial sync backend workers' names are also based on the table being copied. * Filter out the above in Zabbix discovery based on application_name and slot_name. --- zabbix_templates/pgmon_templates.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/zabbix_templates/pgmon_templates.yaml b/zabbix_templates/pgmon_templates.yaml index 64a13fe..d18c450 100644 --- a/zabbix_templates/pgmon_templates.yaml +++ b/zabbix_templates/pgmon_templates.yaml @@ -1572,6 +1572,12 @@ zabbix_export: type: HTTP_AGENT key: pgmon_discover_rep delay: 10m + filter: + conditions: + - macro: '{#APPLICATION_NAME}' + value: '^pg_[0-9]+_sync_[0-9]+_[0-9]+$' + operator: NOT_MATCHES_REGEX + formulaid: A lifetime: 30d enabled_lifetime_type: DISABLE_NEVER item_prototypes: @@ -1775,6 +1781,8 @@ zabbix_export: value: Raw url: 'http://localhost:{$AGENT_PORT}/discover_rep' lld_macro_paths: + - lld_macro: '{#APPLICATION_NAME}' + path: $.application_name - lld_macro: '{#CLIENT_ADDR}' path: $.client_addr - lld_macro: '{#REPID}' @@ -1786,6 +1794,12 @@ zabbix_export: type: HTTP_AGENT key: pgmon_discover_slots delay: 10m + filter: + conditions: + - macro: '{#SLOT_NAME}' + value: '^pg_[0-9]+_sync_[0-9]+_[0-9]+$' + operator: NOT_MATCHES_REGEX + formulaid: A item_prototypes: - uuid: 536c5f82e3074ddfbfd842b3a2e8d46c name: 'Slot {#SLOT_NAME} - Confirmed Flushed Bytes Lag'