Skip to content

Commit 7ef9bb8

Browse files
committed
TUN-7000: Reduce metric cardinality of closedConnections metric by removing error as tag
1 parent 45e8eb7 commit 7ef9bb8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

quic/metrics.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ var (
1515
clientConnLabels = []string{"conn_index"}
1616
clientMetrics = struct {
1717
totalConnections prometheus.Counter
18-
closedConnections *prometheus.CounterVec
18+
closedConnections prometheus.Counter
1919
sentPackets *prometheus.CounterVec
2020
sentBytes *prometheus.CounterVec
2121
receivePackets *prometheus.CounterVec
@@ -30,9 +30,8 @@ var (
3030
totalConnections: prometheus.NewCounter(
3131
totalConnectionsOpts(logging.PerspectiveClient),
3232
),
33-
closedConnections: prometheus.NewCounterVec(
33+
closedConnections: prometheus.NewCounter(
3434
closedConnectionsOpts(logging.PerspectiveClient),
35-
[]string{"error"},
3635
),
3736
sentPackets: prometheus.NewCounterVec(
3837
sentPacketsOpts(logging.PerspectiveClient),
@@ -284,7 +283,7 @@ func (cc *clientCollector) startedConnection() {
284283
}
285284

286285
func (cc *clientCollector) closedConnection(err error) {
287-
clientMetrics.closedConnections.WithLabelValues(err.Error()).Inc()
286+
clientMetrics.closedConnections.Inc()
288287
}
289288

290289
func (cc *clientCollector) sentPackets(size logging.ByteCount) {

0 commit comments

Comments
 (0)