From 197c1b397f1dfb9e533dfba8e0d161b5ebf2a0ef Mon Sep 17 00:00:00 2001 From: Yogesh Sharma Date: Thu, 19 Nov 2020 12:11:59 -0800 Subject: [PATCH] Fix connection query metric for PG 9.6 (#212) (#213) Co-authored-by: Keith Fiske --- exporter/postgres/queries_pg96.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exporter/postgres/queries_pg96.yml b/exporter/postgres/queries_pg96.yml index aa629561..0cd228a1 100644 --- a/exporter/postgres/queries_pg96.yml +++ b/exporter/postgres/queries_pg96.yml @@ -12,7 +12,7 @@ ccp_connection_stats: , idle_in_txn , (select coalesce(extract(epoch from (max(now() - state_change))),0) from monitor.pg_stat_activity() where state = 'idle in transaction') as max_idle_in_txn_time , (select coalesce(extract(epoch from (max(now() - query_start))),0) from monitor.pg_stat_activity() where state <> 'idle') as max_query_time - , (select coalesce(extract(epoch from (max(now() - query_start))),0) from pg_catalog.pg_stat_activity where backend_type = 'client backend' and wait_event_type = 'Lock' ) as max_blocked_query_time + , (select coalesce(extract(epoch from (max(now() - query_start))),0) from pg_catalog.pg_stat_activity where wait_event_type = 'Lock' ) as max_blocked_query_time , max_connections from ( select count(*) as total