Fix activity query

* Modify the activity query to ensure each state is always reported.

* Fix the activity preprocessor to unwrap the value from the array
  containing it.
This commit is contained in:
2025-10-18 12:49:09 -04:00
parent 175fd85f9f
commit 8182ad75b9
2 changed files with 37 additions and 21 deletions

View File

@@ -411,7 +411,7 @@ zabbix_export:
preprocessing:
- type: JSONPATH
parameters:
- '$[?(@.state == "active")].max_state_time'
- '$[?(@.state == "active")].max_state_time.first()'
master_item:
key: 'pgmon_connection_states[{#DBNAME}]'
tags:
@@ -429,7 +429,7 @@ zabbix_export:
preprocessing:
- type: JSONPATH
parameters:
- '$[?(@.state == "active")].backend_count'
- '$[?(@.state == "active")].backend_count.first()'
master_item:
key: 'pgmon_connection_states[{#DBNAME}]'
tags:
@@ -448,7 +448,7 @@ zabbix_export:
preprocessing:
- type: JSONPATH
parameters:
- '$[?(@.state == "disabled")].max_state_time'
- '$[?(@.state == "disabled")].max_state_time.first()'
master_item:
key: 'pgmon_connection_states[{#DBNAME}]'
tags:
@@ -466,7 +466,7 @@ zabbix_export:
preprocessing:
- type: JSONPATH
parameters:
- '$[?(@.state == "disabled")].backend_count'
- '$[?(@.state == "disabled")].backend_count.first()'
master_item:
key: 'pgmon_connection_states[{#DBNAME}]'
tags:
@@ -485,7 +485,7 @@ zabbix_export:
preprocessing:
- type: JSONPATH
parameters:
- '$[?(@.state == "fastpath function call")].max_state_time'
- '$[?(@.state == "fastpath function call")].max_state_time.first()'
master_item:
key: 'pgmon_connection_states[{#DBNAME}]'
tags:
@@ -503,7 +503,7 @@ zabbix_export:
preprocessing:
- type: JSONPATH
parameters:
- '$[?(@.state == "fastpath function call")].backend_count'
- '$[?(@.state == "fastpath function call")].backend_count.first()'
master_item:
key: 'pgmon_connection_states[{#DBNAME}]'
tags:
@@ -522,7 +522,7 @@ zabbix_export:
preprocessing:
- type: JSONPATH
parameters:
- '$[?(@.state == "idle")].max_state_time'
- '$[?(@.state == "idle")].max_state_time.first()'
master_item:
key: 'pgmon_connection_states[{#DBNAME}]'
tags:
@@ -540,7 +540,7 @@ zabbix_export:
preprocessing:
- type: JSONPATH
parameters:
- '$[?(@.state == "idle")].backend_count'
- '$[?(@.state == "idle")].backend_count.first()'
master_item:
key: 'pgmon_connection_states[{#DBNAME}]'
tags:
@@ -559,7 +559,7 @@ zabbix_export:
preprocessing:
- type: JSONPATH
parameters:
- '$[?(@.state == "idle in transaction (aborted)")].max_state_time'
- '$[?(@.state == "idle in transaction (aborted)")].max_state_time.first()'
master_item:
key: 'pgmon_connection_states[{#DBNAME}]'
tags:
@@ -577,7 +577,7 @@ zabbix_export:
preprocessing:
- type: JSONPATH
parameters:
- '$[?(@.state == "idle in transaction (aborted)")].backend_count'
- '$[?(@.state == "idle in transaction (aborted)")].backend_count.first()'
master_item:
key: 'pgmon_connection_states[{#DBNAME}]'
tags:
@@ -596,7 +596,7 @@ zabbix_export:
preprocessing:
- type: JSONPATH
parameters:
- '$[?(@.state == "idle in transaction")].max_state_time'
- '$[?(@.state == "idle in transaction")].max_state_time.first()'
master_item:
key: 'pgmon_connection_states[{#DBNAME}]'
tags:
@@ -614,7 +614,7 @@ zabbix_export:
preprocessing:
- type: JSONPATH
parameters:
- '$[?(@.state == "idle in transaction")].backend_count'
- '$[?(@.state == "idle in transaction")].backend_count.first()'
master_item:
key: 'pgmon_connection_states[{#DBNAME}]'
tags:
@@ -633,7 +633,7 @@ zabbix_export:
preprocessing:
- type: JSONPATH
parameters:
- '$[?(@.state == "starting")].max_state_time'
- '$[?(@.state == "starting")].max_state_time.first()'
master_item:
key: 'pgmon_connection_states[{#DBNAME}]'
tags:
@@ -651,7 +651,7 @@ zabbix_export:
preprocessing:
- type: JSONPATH
parameters:
- '$[?(@.state == "starting")].backend_count'
- '$[?(@.state == "starting")].backend_count.first()'
master_item:
key: 'pgmon_connection_states[{#DBNAME}]'
tags: