From 7ef9bb89d30fe0f4db01fad539b75ce1e9f5971a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Oliveirinha?= Date: Wed, 7 Dec 2022 11:04:32 +0000 Subject: [PATCH] TUN-7000: Reduce metric cardinality of closedConnections metric by removing error as tag --- quic/metrics.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/quic/metrics.go b/quic/metrics.go index 631cbbb6..900ac172 100644 --- a/quic/metrics.go +++ b/quic/metrics.go @@ -15,7 +15,7 @@ var ( clientConnLabels = []string{"conn_index"} clientMetrics = struct { totalConnections prometheus.Counter - closedConnections *prometheus.CounterVec + closedConnections prometheus.Counter sentPackets *prometheus.CounterVec sentBytes *prometheus.CounterVec receivePackets *prometheus.CounterVec @@ -30,9 +30,8 @@ var ( totalConnections: prometheus.NewCounter( totalConnectionsOpts(logging.PerspectiveClient), ), - closedConnections: prometheus.NewCounterVec( + closedConnections: prometheus.NewCounter( closedConnectionsOpts(logging.PerspectiveClient), - []string{"error"}, ), sentPackets: prometheus.NewCounterVec( sentPacketsOpts(logging.PerspectiveClient), @@ -284,7 +283,7 @@ func (cc *clientCollector) startedConnection() { } func (cc *clientCollector) closedConnection(err error) { - clientMetrics.closedConnections.WithLabelValues(err.Error()).Inc() + clientMetrics.closedConnections.Inc() } func (cc *clientCollector) sentPackets(size logging.ByteCount) {