Zanzana: Fix shadow client metric (#113771)

This commit is contained in:
Alexander Zobnin
2025-11-12 16:48:48 +00:00
committed by GitHub
parent 5162988fa1
commit 4bca10195e
2 changed files with 2 additions and 3 deletions
+1 -1
View File
@@ -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,
@@ -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