diff --git a/compute/etc/sql_exporter/connection_counts.libsonnet b/compute/etc/sql_exporter/connection_counts.libsonnet index 9f94db67a9..09a0154277 100644 --- a/compute/etc/sql_exporter/connection_counts.libsonnet +++ b/compute/etc/sql_exporter/connection_counts.libsonnet @@ -4,6 +4,7 @@ help: 'Connection counts', key_labels: [ 'datname', + 'application_name', 'state', ], values: [ diff --git a/compute/etc/sql_exporter/connection_counts.sql b/compute/etc/sql_exporter/connection_counts.sql index 6824480fdb..2f3163d2b0 100644 --- a/compute/etc/sql_exporter/connection_counts.sql +++ b/compute/etc/sql_exporter/connection_counts.sql @@ -1 +1 @@ -SELECT datname, state, count(*) AS count FROM pg_stat_activity WHERE state <> '' GROUP BY datname, state; +SELECT datname, application_name, state, count(*) AS count FROM pg_stat_activity WHERE state <> '' GROUP BY datname, state;