From e5afa6f3a4a2b9548225055c647e7d97f485e912 Mon Sep 17 00:00:00 2001 From: Nathan J Mehl Date: Wed, 10 Nov 2021 13:46:47 -0500 Subject: [PATCH] Fix counter types The various `*_cnt` metrics are counters, and should use the prometheus COUNTER data type. --- pgpool2_exporter.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pgpool2_exporter.go b/pgpool2_exporter.go index eb757a9..713a378 100755 --- a/pgpool2_exporter.go +++ b/pgpool2_exporter.go @@ -171,7 +171,7 @@ var ( "port": {LABEL, "Backend port"}, "role": {LABEL, "Role (primary or standby)"}, "status": {GAUGE, "Backend node Status (1 for up or waiting, 0 for down or unused)"}, - "select_cnt": {GAUGE, "SELECT statement counts issued to each backend"}, + "select_cnt": {COUNTER, "SELECT statement counts issued to each backend"}, "replication_delay": {GAUGE, "Replication delay"}, }, "pool_backend_stats": { @@ -179,15 +179,15 @@ var ( "port": {LABEL, "Backend port"}, "role": {LABEL, "Role (primary or standby)"}, "status": {GAUGE, "Backend node Status (1 for up or waiting, 0 for down or unused)"}, - "select_cnt": {GAUGE, "SELECT statement counts issued to each backend"}, - "insert_cnt": {GAUGE, "INSERT statement counts issued to each backend"}, - "update_cnt": {GAUGE, "UPDATE statement counts issued to each backend"}, - "delete_cnt": {GAUGE, "DELETE statement counts issued to each backend"}, - "ddl_cnt": {GAUGE, "DDL statement counts issued to each backend"}, - "other_cnt": {GAUGE, "other statement counts issued to each backend"}, - "panic_cnt": {GAUGE, "Panic message counts returned from backend"}, - "fatal_cnt": {GAUGE, "Fatal message counts returned from backend)"}, - "error_cnt": {GAUGE, "Error message counts returned from backend"}, + "select_cnt": {COUNTER, "SELECT statement counts issued to each backend"}, + "insert_cnt": {COUNTER, "INSERT statement counts issued to each backend"}, + "update_cnt": {COUNTER, "UPDATE statement counts issued to each backend"}, + "delete_cnt": {COUNTER, "DELETE statement counts issued to each backend"}, + "ddl_cnt": {COUNTER, "DDL statement counts issued to each backend"}, + "other_cnt": {COUNTER, "other statement counts issued to each backend"}, + "panic_cnt": {COUNTER, "Panic message counts returned from backend"}, + "fatal_cnt": {COUNTER, "Fatal message counts returned from backend)"}, + "error_cnt": {COUNTER, "Error message counts returned from backend"}, }, "pool_health_check_stats": { "hostname": {LABEL, "Backend hostname"},