From bbe8f34e72eae006203ab3443c392d6e0632c287 Mon Sep 17 00:00:00 2001 From: 9seconds Date: Wed, 24 Mar 2021 21:08:32 +0300 Subject: [PATCH] Correctly decrease a value for prometheus metrics --- stats/prometheus.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stats/prometheus.go b/stats/prometheus.go index 4c9b0a3..9069bbf 100644 --- a/stats/prometheus.go +++ b/stats/prometheus.go @@ -78,7 +78,7 @@ func (p prometheusProcessor) EventFinish(evt mtglib.EventFinish) { duration := evt.CreatedAt.Sub(sInfo.createdAt) - p.factory.metricClientConnections.WithLabelValues(sInfo.GetRemoteIPType()).Dec() + p.factory.metricClientConnections.WithLabelValues(sInfo.GetClientIPType()).Dec() p.factory.metricSessionDuration.Observe(float64(duration) / float64(time.Second)) if sInfo.remoteIP == nil {