Correctly decrease a value for prometheus metrics

This commit is contained in:
9seconds
2021-03-24 21:08:32 +03:00
parent 02aa969d6c
commit bbe8f34e72
+1 -1
View File
@@ -78,7 +78,7 @@ func (p prometheusProcessor) EventFinish(evt mtglib.EventFinish) {
duration := evt.CreatedAt.Sub(sInfo.createdAt) 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)) p.factory.metricSessionDuration.Observe(float64(duration) / float64(time.Second))
if sInfo.remoteIP == nil { if sInfo.remoteIP == nil {