From 4d999f8dd29e1ae5ef0d4c4cef7e1f8761fcbaf5 Mon Sep 17 00:00:00 2001 From: Roberto D'Auria Date: Mon, 22 Jan 2024 21:31:43 +0100 Subject: [PATCH] Add metric to count failed setCC attempts --- internal/handler/handler.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/internal/handler/handler.go b/internal/handler/handler.go index 2d36950..9e24082 100644 --- a/internal/handler/handler.go +++ b/internal/handler/handler.go @@ -58,6 +58,15 @@ var ( }, []string{"direction", "status"}, ) + congestionControlErrors = promauto.NewCounterVec( + prometheus.CounterOpts{ + Namespace: "msak", + Subsystem: "throughput1", + Name: "congestion_control_errors_total", + Help: "Number of attempts to set congestion control algorithm that resulted in an error.", + }, + []string{"cc"}, + ) fileWrites = promauto.NewCounterVec( prometheus.CounterOpts{ Namespace: "msak", @@ -203,6 +212,7 @@ func (h *Handler) upgradeAndRunMeasurement(kind model.TestDirection, rw http.Res if requestCC != "" { err = conn.SetCC(requestCC) if err != nil { + congestionControlErrors.WithLabelValues(requestCC).Inc() log.Info("Failed to set cc", "ctx", fmt.Sprintf("%p", req.Context()), "source", wsConn.RemoteAddr(), "cc", requestCC, "error", err)