Zanzana: Fix shadow client metric (#113771)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user