Changelog
- fixed auxiliary extension schema search;
- fixed WAL metrics definition for native Zabbix agent;
- upgraded Autovacuum and Connection metrics for PG 10+: now it is evaluating using pg_stat_activity.backend_type which makes the calculation more accurate;
- added new Other Connections metric for PG 10+ to count metrics like auxiliary extension backends;
- added new configuration parameter to the [zabbix] section: timeout (in seconds);
- fixed Plugin Errors metric time interval to fit default '60 seconds' value;
- fixed Slave Replication Lag metric to exclude master server from calculation #180;
pg_stat_activity.backend_type
Using pg_stat_activity.backend_type
we can determine user backends by 'client backend' and 'parallel worker' values. So for PG 10+ current strategy for gathering connection metrics relies on backend_type field.
For example, query for gathering waiting user connection:
SELECT count(*)
FROM pg_catalog.pg_stat_activity
WHERE (backend_type = 'client backend' OR backend_type = 'parallel worker')
AND wait_event_type IS NOT NULL;
Also backend_type is useful to count accurately autovacuum processes in the system using 'autovacuum worker' field value.
'Other Connections' metric
Following the previous statement, we added new Other Connections metric to represent count of connections with additional backend_type
. Additional backend_type usually means that there are background workers registered by extensions.
New 'zabbix.timeout' parameter
We added a new configuration parameter for [zabbix] section to define zabbix server response timeout in seconds:
<...>
[zabbix]
enabled = True
client = pg-master
address = 127.0.0.1
port = 10051
; that's it!
timeout = 15
;
re_send = False
<...>
Default value: 15 seconds.