From 3c9357a2e9604f7be8dcd9362413af0079704a64 Mon Sep 17 00:00:00 2001 From: bergquist Date: Mon, 16 Jan 2017 14:58:06 +0100 Subject: [PATCH] fix(alerting): supports lowercase metrics this fix is due to EvalMatch now serailize as lower case. ref #7257 --- public/app/features/alerting/alert_def.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/public/app/features/alerting/alert_def.ts b/public/app/features/alerting/alert_def.ts index e6bd75379b2..fdc0857620e 100644 --- a/public/app/features/alerting/alert_def.ts +++ b/public/app/features/alerting/alert_def.ts @@ -116,14 +116,18 @@ function getStateDisplayModel(state) { } } -function joinEvalMatches(matches, seperator: string) { +function joinEvalMatches(matches, separator: string) { return _.reduce(matches, (res, ev)=> { + if (ev.metric !== undefined && ev.value !== undefined) { + res.push(ev.metric + '=' + ev.value); + } + if (ev.Metric !== undefined && ev.Value !== undefined) { - res.push(ev.Metric + "=" + ev.Value); + res.push(ev.Metric + '=' + ev.Value); } return res; - }, []).join(seperator); + }, []).join(separator); } export default {