Add slot lag metrics

This commit is contained in:
James Campbell 2025-06-16 00:56:14 -04:00
parent c0185d4b86
commit b981a9ad36
Signed by: james
GPG Key ID: 2287C33A40DC906A

View File

@ -108,6 +108,8 @@ zabbix_export:
tags:
- tag: Application
value: PostgreSQL
- tag: Type
value: Raw
- uuid: 8706eccb7edc4fa394f552fc31f401a9
name: 'PostgreSQL ID Age Info'
type: HTTP_AGENT
@ -121,6 +123,8 @@ zabbix_export:
tags:
- tag: Application
value: PostgreSQL
- tag: Type
value: Raw
- uuid: ee88f5f4d2384f97946d049af5af4502
name: 'PostgreSQL version'
type: HTTP_AGENT
@ -689,6 +693,8 @@ zabbix_export:
value: PostgreSQL
- tag: Database
value: '{#DBNAME}'
- tag: Type
value: Raw
- uuid: e0edbaf6f98249a6b357ade2ab41a76a
name: 'Average heap hit ratio on {#DBNAME}'
type: DEPENDENT
@ -781,6 +787,8 @@ zabbix_export:
value: PostgreSQL
- tag: Database
value: '{#DBNAME}'
- tag: Type
value: Raw
graph_prototypes:
- uuid: 1f7de43b77714f819e61c31273712b70
name: 'DML Totals for {#DBNAME}'
@ -1078,6 +1086,8 @@ zabbix_export:
value: Replication
- tag: Database
value: '{#DBNAME}'
- tag: Type
value: Raw
url: 'http://localhost:{$AGENT_PORT}/discover_rep'
lld_macro_paths:
- lld_macro: '{#CLIENT_ADDR}'
@ -1092,6 +1102,40 @@ zabbix_export:
key: pgmon_discover_slots
delay: 10m
item_prototypes:
- uuid: 536c5f82e3074ddfbfd842b3a2e8d46c
name: 'Slot {#SLOT_NAME} - Confirmed Flushed Bytes Lag'
type: DEPENDENT
key: 'pgmon_slot[confirmed_flush_bytes,{#SLOT_NAME}]'
delay: '0'
description: 'The lag in bytes for the slot. This metric is how far behind the consumer has reported to be with regard to flushing writes to disk (or equivalent).'
preprocessing:
- type: JSONPATH
parameters:
- $.confirmed_flush_bytes
master_item:
key: 'pgmon_slot_stats[{#SLOT_NAME}]'
tags:
- tag: Application
value: PostgreSQL
- tag: Slot
value: '{#SLOT_NAME}'
- uuid: f239449d8e9e4ce79965528400f1669a
name: 'Slot {#SLOT_NAME} - Restart Bytes Lag'
type: DEPENDENT
key: 'pgmon_slot[restart_bytes,{#SLOT_NAME}]'
delay: '0'
description: 'The lag in bytes for the slot. This metric is how far behind the restart location is, as reported by the consumer.'
preprocessing:
- type: JSONPATH
parameters:
- $.restart_bytes
master_item:
key: 'pgmon_slot_stats[{#SLOT_NAME}]'
tags:
- tag: Application
value: PostgreSQL
- tag: Slot
value: '{#SLOT_NAME}'
- uuid: a9f53efdce0a4bdc970925f8588e01c5
name: 'Replication Slot Stats for {#SLOT_NAME}'
type: HTTP_AGENT
@ -1103,6 +1147,13 @@ zabbix_export:
query_fields:
- name: slot
value: '{#SLOT_NAME}'
tags:
- tag: Application
value: PostgreSQL
- tag: Slot
value: '{#SLOT_NAME}'
- tag: Type
value: Raw
url: 'http://localhost:{$AGENT_PORT}/discover_slots'
lld_macro_paths:
- lld_macro: '{#ACTIVE}'