From 60d2bf40d4d3b5ac91ff30c655dc810a8ea23b68 Mon Sep 17 00:00:00 2001 From: David Coles Date: Fri, 24 May 2024 15:14:51 +0100 Subject: [PATCH] Fix stats issue Prometheus stats were showing the total stats instead of individual values for each backend --- cmd/prometheus.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/prometheus.go b/cmd/prometheus.go index d1ecd50..90b5cfb 100644 --- a/cmd/prometheus.go +++ b/cmd/prometheus.go @@ -84,6 +84,7 @@ func prometheus(p string, services map[netip.Addr][]Serv, summary Summary, vips for _, d := range s.Destinations { real := fmt.Sprintf("%s:%d", d.Address, d.Port) + stat := d.Stats up := zeroone(d.Up) r = metric(r, p+`_backend_sessions{service="%s",name="%s",backend="%s"} %d`, serv, name, real, stat.Current)