From f11d0b5917c7d7facfecf61ed36e1b10771416aa Mon Sep 17 00:00:00 2001 From: Dominik Vagner Date: Wed, 8 Jul 2026 14:21:32 +0200 Subject: [PATCH] feat: log kessel errors to external service metric There is a PatchmanAlertExternalService alert that check if the count of these external service errors is increasing. It used to be tracked for RBAC calls, but not for Kessel. This adds the prometheus counter increments back. --- manager/middlewares/kessel.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/manager/middlewares/kessel.go b/manager/middlewares/kessel.go index 55e918ec2..8d1e4936c 100644 --- a/manager/middlewares/kessel.go +++ b/manager/middlewares/kessel.go @@ -4,6 +4,7 @@ import ( "app/base/utils" "context" "net/http" + "strconv" "strings" "time" @@ -96,6 +97,7 @@ func hasPermissionKessel(c *gin.Context) { c.AbortWithStatusJSON(http.StatusInternalServerError, utils.ErrorResponse{ Error: "Unexpected server error", // missing cert or failed to make a new gRPC client }) + serviceErrorCnt.WithLabelValues("kessel", strconv.Itoa(http.StatusInternalServerError)).Inc() return } defer func() { @@ -117,6 +119,7 @@ func hasPermissionKessel(c *gin.Context) { c.AbortWithStatusJSON(http.StatusInternalServerError, utils.ErrorResponse{ Error: "Communication with RBAC failed", }) + serviceErrorCnt.WithLabelValues("kessel", strconv.Itoa(http.StatusInternalServerError)).Inc() return }