Export connection counts from sql_exporter (#6926)

## Problem

We want to show connection counts to console users.

## Summary of changes

Start exporting connection counts grouped by database name and
connection state.
This commit is contained in:
Roman Zaynetdinov
2024-02-27 15:47:05 +02:00
committed by GitHub
parent e895644555
commit 2991d01b61

View File

@@ -132,6 +132,16 @@ files:
query: |
select pg_size_bytes(current_setting('neon.file_cache_size_limit')) as lfc_cache_size_limit;
- metric_name: connection_counts
type: gauge
help: 'Connection counts'
key_labels:
- datname
- state
values: [count]
query: |
select datname, state, count(*) as count from pg_stat_activity where state <> '' group by datname, state;
build: |
# Build cgroup-tools
#