Skip to content
This repository was archived by the owner on Nov 28, 2022. It is now read-only.

Commit 15139d5

Browse files
committed
Correct metric name
1 parent 321a059 commit 15139d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gauges/backends.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ type backendsByUserAndClientAddress struct {
8282
func (g *Gauges) BackendsByUserAndClientAddress() *prometheus.GaugeVec {
8383
var gauge = prometheus.NewGaugeVec(
8484
prometheus.GaugeOpts{
85-
Name: "postgresql_backends_by_state_total",
85+
Name: "postgresql_backends_by_user_total",
8686
Help: "Number of backends currently connected to database by user and client address",
8787
ConstLabels: g.labels,
8888
},
@@ -93,7 +93,7 @@ func (g *Gauges) BackendsByUserAndClientAddress() *prometheus.GaugeVec {
9393
SELECT
9494
COUNT(*) AS total,
9595
usename,
96-
COALESCE(client_addr, '127.0.0.1') AS client_addr
96+
COALESCE(client_addr, '::1') AS client_addr
9797
FROM pg_stat_activity
9898
WHERE datname = current_database()
9999
GROUP BY usename, client_addr

0 commit comments

Comments
 (0)