Fix ID age query and template

This commit is contained in:
James Campbell 2025-06-04 00:47:51 -04:00
parent 295d1d6310
commit 6a22597f1f
Signed by: james
GPG Key ID: 2287C33A40DC906A
2 changed files with 45 additions and 14 deletions

View File

@ -22,7 +22,7 @@ metrics:
max_frozen_age:
type: row
query:
0: SELECT max(age(datfrozenxid)), max(mxid_age(datminmxid)) FROM pg_database
0: SELECT max(age(datfrozenxid)) AS xid_age, max(mxid_age(datminmxid)) AS mxid_age FROM pg_database
# Per-database metrics
db_stats:
@ -47,12 +47,6 @@ metrics:
test_args:
repid: 127.0.0.1_test_rep
# Debugging
sleep:
type: value
query:
0: SELECT now(), pg_sleep(5);
# Per-slot metrics
slot_stats:
type: row

View File

@ -11,6 +11,44 @@ zabbix_export:
groups:
- name: 'My Templates'
items:
- uuid: cc4a50ca681b4c4fb8c1c98f4bc81c96
name: 'Max Frozen MXID Age'
type: DEPENDENT
key: pgmon.age.mxid
delay: '0'
history: 90d
description: 'Maximum age of any frozen MXID in any database'
preprocessing:
- type: JSONPATH
parameters:
- $.mxid_age
- type: MATCHES_REGEX
parameters:
- '^[0-9]+$'
master_item:
key: 'pgmon[max_frozen_age]'
tags:
- tag: Application
value: PostgreSQL
- uuid: 2fa86d8c4a3a481e856a9414c5c70216
name: 'Max Frozen XID Age'
type: DEPENDENT
key: pgmon.age.xid
delay: '0'
history: 90d
description: 'Maximum age of any frozen XID in any database'
preprocessing:
- type: JSONPATH
parameters:
- $.xid_age
- type: MATCHES_REGEX
parameters:
- '^[0-9]+$'
master_item:
key: 'pgmon[max_frozen_age]'
tags:
- tag: Application
value: PostgreSQL
- uuid: de1fa757395440118026f4c7a7c4ebbe
name: 'PostgreSQL latest supported version'
type: DEPENDENT
@ -71,15 +109,14 @@ zabbix_export:
- tag: Application
value: PostgreSQL
- uuid: 8706eccb7edc4fa394f552fc31f401a9
name: 'Max Frozen XID Age'
name: 'PostgreSQL ID Age Info'
type: HTTP_AGENT
key: 'pgmon[max_frozen_age]'
history: 90d
description: 'Maximum age of any frozen XID in any database'
preprocessing:
- type: MATCHES_REGEX
parameters:
- '^[0-9]+$'
delay: 5m
history: '0'
value_type: TEXT
trends: '0'
description: 'Maximum age of any frozen XID and MXID in any database'
url: 'http://localhost:{$AGENT_PORT}/max_frozen_age'
tags:
- tag: Application