Przeglądaj źródła

fix(alerting): supports lowercase metrics

this fix is due to EvalMatch now serailize as lower case.

ref #7257
bergquist 9 lat temu
rodzic
commit
3c9357a2e9
1 zmienionych plików z 7 dodań i 3 usunięć
  1. 7 3
      public/app/features/alerting/alert_def.ts

+ 7 - 3
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 {