Enhance partitioning logic and update Zabbix config template
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
SELECT
|
||||
table_name,
|
||||
period,
|
||||
keep_history::text AS keep_history,
|
||||
future_partitions,
|
||||
total_size_bytes,
|
||||
EXTRACT(EPOCH FROM (now() - last_updated)) AS age_seconds
|
||||
|
||||
@@ -86,6 +86,38 @@ zabbix_export:
|
||||
value: size
|
||||
- tag: table
|
||||
value: '{#TABLE_NAME}'
|
||||
- uuid: ffa2b3c4d5e64f7a9b8c7d6e5f4a1001
|
||||
name: '{#TABLE_NAME}: Configured Partition Period'
|
||||
type: DEPENDENT
|
||||
key: 'db.partitions.period["{#TABLE_NAME}"]'
|
||||
value_type: CHAR
|
||||
preprocessing:
|
||||
- type: JSONPATH
|
||||
parameters:
|
||||
- '$.[?(@.table_name == "{#TABLE_NAME}")].period.first()'
|
||||
master_item:
|
||||
key: 'pgsql.custom.query["{$PG.CONNSTRING.AGENT2}",,,"{$PG.DBNAME}","partitions.get_all"]'
|
||||
tags:
|
||||
- tag: metric
|
||||
value: config
|
||||
- tag: table
|
||||
value: '{#TABLE_NAME}'
|
||||
- uuid: ffa2b3c4d5e64f7a9b8c7d6e5f4a1002
|
||||
name: '{#TABLE_NAME}: Configured Retention (Keep History)'
|
||||
type: DEPENDENT
|
||||
key: 'db.partitions.retention["{#TABLE_NAME}"]'
|
||||
value_type: CHAR
|
||||
preprocessing:
|
||||
- type: JSONPATH
|
||||
parameters:
|
||||
- '$.[?(@.table_name == "{#TABLE_NAME}")].keep_history.first()'
|
||||
master_item:
|
||||
key: 'pgsql.custom.query["{$PG.CONNSTRING.AGENT2}",,,"{$PG.DBNAME}","partitions.get_all"]'
|
||||
tags:
|
||||
- tag: metric
|
||||
value: config
|
||||
- tag: table
|
||||
value: '{#TABLE_NAME}'
|
||||
master_item:
|
||||
key: 'pgsql.custom.query["{$PG.CONNSTRING.AGENT2}",,,"{$PG.DBNAME}","partitions.get_all"]'
|
||||
lld_macro_paths:
|
||||
|
||||
Reference in New Issue
Block a user