return an error for missing metric templates and count that towards the failure threshold

Signed-off-by: LiZhenCheng9527 <lizhencheng6@huawei.com>
This commit is contained in:
LiZhenCheng9527
2024-01-18 09:51:31 +08:00
parent b562ddd3e2
commit 471da0abba
+3
View File
@@ -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
}
}