From 471da0abba68752074b117a09a2b9a3bf012b39a Mon Sep 17 00:00:00 2001 From: LiZhenCheng9527 Date: Wed, 17 Jan 2024 19:12:54 +0800 Subject: [PATCH] return an error for missing metric templates and count that towards the failure threshold Signed-off-by: LiZhenCheng9527 --- pkg/controller/scheduler_metrics.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/controller/scheduler_metrics.go b/pkg/controller/scheduler_metrics.go index 960db811..6d2d3c82 100644 --- a/pkg/controller/scheduler_metrics.go +++ b/pkg/controller/scheduler_metrics.go @@ -306,6 +306,9 @@ func (c *Controller) runMetricChecks(canary *flaggerv1.Canary) bool { canary.Name, canary.Namespace, metric.Name, val, metric.Threshold) return false } + } else if metric.Name != "request-success-rate" && metric.Name != "request-duration" { + c.recordEventErrorf(canary, "Metric query failed for no usable metrics template were configured") + return false } }