From 4bca10195e680ef3aef6c1a99c69ce6141d5eebd Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Wed, 12 Nov 2025 17:48:48 +0100 Subject: [PATCH] Zanzana: Fix shadow client metric (#113771) --- pkg/services/authz/zanzana/client/metrics.go | 2 +- pkg/services/authz/zanzana/client/shadow_client.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/services/authz/zanzana/client/metrics.go b/pkg/services/authz/zanzana/client/metrics.go index 33f9a83c13e..3fe7b1dd590 100644 --- a/pkg/services/authz/zanzana/client/metrics.go +++ b/pkg/services/authz/zanzana/client/metrics.go @@ -33,7 +33,7 @@ func newShadowClientMetrics(reg prometheus.Registerer) *metrics { ), compileSeconds: promauto.With(reg).NewHistogramVec( prometheus.HistogramOpts{ - Name: "compile_seconds", + Name: "engine_compile_seconds", Help: "Histogram for item checker compilation time for the specific access control engine (RBAC and zanzana).", Namespace: metricsNamespace, Subsystem: metricsSubSystem, diff --git a/pkg/services/authz/zanzana/client/shadow_client.go b/pkg/services/authz/zanzana/client/shadow_client.go index f2f0ec7d4f1..93fbfd10b4d 100644 --- a/pkg/services/authz/zanzana/client/shadow_client.go +++ b/pkg/services/authz/zanzana/client/shadow_client.go @@ -40,13 +40,12 @@ func (c *ShadowClient) Check(ctx context.Context, id authlib.AuthInfo, req authl } timer := prometheus.NewTimer(c.metrics.evaluationsSeconds.WithLabelValues("zanzana")) - defer timer.ObserveDuration() - zanzanaCtx := context.WithoutCancel(ctx) res, err := c.zanzanaClient.Check(zanzanaCtx, id, req, folder) if err != nil { c.logger.Error("Failed to run zanzana check", "error", err) } + timer.ObserveDuration() acRes := <-acResChan acErr := <-acErrChan