Add sequence metrics to Zabbix template
This commit is contained in:
parent
45953848e2
commit
98b74d9aed
@ -226,7 +226,7 @@ metrics:
|
||||
type: row
|
||||
query:
|
||||
100000: >
|
||||
SELECT COUNT(*) FILTER (WHERE has_sequence_privilege(c.oid, 'SELECT,USAGE')) AS readable_sequences,
|
||||
SELECT COUNT(*) FILTER (WHERE has_sequence_privilege(c.oid, 'SELECT,USAGE')) AS visible_sequences,
|
||||
COUNT(*) AS total_sequences
|
||||
FROM pg_class AS c
|
||||
WHERE relkind = 'S';
|
||||
|
||||
@ -785,6 +785,76 @@ zabbix_export:
|
||||
value: PostgreSQL
|
||||
- tag: Database
|
||||
value: '{#DBNAME}'
|
||||
- uuid: 5960120dd01c4926b0fc1fbe9c011507
|
||||
name: 'Database max sequence usage in {#DBNAME}'
|
||||
type: HTTP_AGENT
|
||||
key: 'pgmon_db_max_sequence[{#DBNAME}]'
|
||||
delay: 5m
|
||||
value_type: FLOAT
|
||||
units: '%'
|
||||
description: 'The percent of the currently configured value range for the most utilized sequence.'
|
||||
url: 'http://localhost:{$AGENT_PORT}/sequence_usage'
|
||||
query_fields:
|
||||
- name: dbname
|
||||
value: '{#DBNAME}'
|
||||
tags:
|
||||
- tag: Application
|
||||
value: PostgreSQL
|
||||
- tag: Database
|
||||
value: '{#DBNAME}'
|
||||
- uuid: 48b9cc80ac4d4aee9e9f3a5d6f7d4a95
|
||||
name: 'Total number of sequences on {#DBNAME}'
|
||||
type: DEPENDENT
|
||||
key: 'pgmon_db_sequences[total,{#DBNAME}]'
|
||||
delay: '0'
|
||||
description: 'Total number of sequences in the database.'
|
||||
preprocessing:
|
||||
- type: JSONPATH
|
||||
parameters:
|
||||
- $.total_sequences
|
||||
master_item:
|
||||
key: 'pgmon_db_sequence_visibility[{#DBNAME}]'
|
||||
tags:
|
||||
- tag: Application
|
||||
value: PostgreSQL
|
||||
- tag: Database
|
||||
value: '{#DBNAME}'
|
||||
- uuid: 6521a9bab2ac47bf85429832d289bbac
|
||||
name: 'Visible sequences on {#DBNAME}'
|
||||
type: DEPENDENT
|
||||
key: 'pgmon_db_sequences[visible,{#DBNAME}]'
|
||||
delay: '0'
|
||||
description: 'Number of sequences in the database for which Zabbix can see stats.'
|
||||
preprocessing:
|
||||
- type: JSONPATH
|
||||
parameters:
|
||||
- $.visible_sequences
|
||||
master_item:
|
||||
key: 'pgmon_db_sequence_visibility[{#DBNAME}]'
|
||||
tags:
|
||||
- tag: Application
|
||||
value: PostgreSQL
|
||||
- tag: Database
|
||||
value: '{#DBNAME}'
|
||||
- uuid: 00f2da3eb99940839410a6ecd5df153f
|
||||
name: 'Database sequence visibility in {#DBNAME}'
|
||||
type: HTTP_AGENT
|
||||
key: 'pgmon_db_sequence_visibility[{#DBNAME}]'
|
||||
delay: 30m
|
||||
value_type: TEXT
|
||||
trends: '0'
|
||||
description: 'Statistics about the number of sequences that exist and the number Zabbix can actually see stats for.'
|
||||
url: 'http://localhost:{$AGENT_PORT}/sequence_visibility'
|
||||
query_fields:
|
||||
- name: dbname
|
||||
value: '{#DBNAME}'
|
||||
tags:
|
||||
- tag: Application
|
||||
value: PostgreSQL
|
||||
- tag: Database
|
||||
value: '{#DBNAME}'
|
||||
- tag: Type
|
||||
value: Raw
|
||||
- uuid: 492b3cac15f348c2b85f97b69c114d1b
|
||||
name: 'Database Stats for {#DBNAME}'
|
||||
type: HTTP_AGENT
|
||||
@ -803,6 +873,17 @@ zabbix_export:
|
||||
value: '{#DBNAME}'
|
||||
- tag: Type
|
||||
value: Raw
|
||||
trigger_prototypes:
|
||||
- uuid: d29d0fd9d9d34b5ebd649592b0829ce5
|
||||
expression: 'last(/PostgreSQL by pgmon/pgmon_db_sequences[total,{#DBNAME}]) <> last(/PostgreSQL by pgmon/pgmon_db_sequences[visible,{#DBNAME}])'
|
||||
name: 'Sequences not visible to Zabbix on {#DBNAME}'
|
||||
priority: WARNING
|
||||
description: 'There are sequences for which Zabbix cannot see usage statistics'
|
||||
tags:
|
||||
- tag: Application
|
||||
value: PostgreSQL
|
||||
- tag: Component
|
||||
value: Sequence
|
||||
graph_prototypes:
|
||||
- uuid: 1f7de43b77714f819e61c31273712b70
|
||||
name: 'DML Totals for {#DBNAME}'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user