From b3fe4a1dadd069e17c31ff192b4032883988ba2a Mon Sep 17 00:00:00 2001 From: shreddedbacon Date: Thu, 30 May 2024 17:00:54 +1000 Subject: [PATCH] fix: update status to check for 2xx and any other 200 http code with regex --- handlers/idler/service-kubernetes.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handlers/idler/service-kubernetes.go b/handlers/idler/service-kubernetes.go index dec18f0..a2a85b7 100644 --- a/handlers/idler/service-kubernetes.go +++ b/handlers/idler/service-kubernetes.go @@ -126,7 +126,7 @@ func (h *Idler) KubernetesServiceIdler(ctx context.Context, opLog logr.Logger, n defer cancel() // get the number of requests to any ingress in the exported namespace by status code promQuery := fmt.Sprintf( - `round(sum(increase(nginx_ingress_controller_requests{exported_namespace="%s",status="200"}[%s])) by (status))`, + `round(sum(increase(nginx_ingress_controller_requests{exported_namespace="%s",status=~"2[0-9x]{2}"}[%s])) by (status))`, namespace.ObjectMeta.Name, prometheusInternalCheck, )