diff --git a/pkg/models/alerts.go b/pkg/models/alerts.go index 716bff161f4..9e84a7cce7b 100644 --- a/pkg/models/alerts.go +++ b/pkg/models/alerts.go @@ -43,13 +43,13 @@ func (cmd *SaveDashboardCommand) GetAlertModels() *[]AlertRule { OrgId: cmd.Result.OrgId, PanelId: panel.Get("id").MustInt64(), Id: alerting.Get("id").MustInt64(), - QueryRefId: alerting.Get("query_ref").MustString(), - WarnLevel: alerting.Get("warn_level").MustString(), - CritLevel: alerting.Get("crit_level").MustString(), + QueryRefId: alerting.Get("queryRef").MustString(), + WarnLevel: alerting.Get("warnLevel").MustString(), + CritLevel: alerting.Get("critLevel").MustString(), Interval: alerting.Get("interval").MustString(), Title: alerting.Get("title").MustString(), Description: alerting.Get("description").MustString(), - QueryRange: alerting.Get("query_range").MustString(), + QueryRange: alerting.Get("queryRange").MustString(), Aggregator: alerting.Get("aggregator").MustString(), } diff --git a/pkg/models/alerts_test.go b/pkg/models/alerts_test.go index b3dcffea4cf..d9a3da9ef3b 100644 --- a/pkg/models/alerts_test.go +++ b/pkg/models/alerts_test.go @@ -67,12 +67,12 @@ func TestAlertModel(t *testing.T) { "stack": false, "steppedLine": false, "alerting": { - "query_ref": "A", - "warn_level": "> 30", - "crit_level": "> 50", + "queryRef": "A", + "warnLevel": "> 30", + "critLevel": "> 50", "title": "desktop visiter alerts", "description": "Restart the webservers", - "query_range": "5m", + "queryRange": "5m", "aggregator": "avg", "interval": "10" }, diff --git a/public/app/plugins/panel/graph/module.ts b/public/app/plugins/panel/graph/module.ts index a22fa6286b9..4776377a625 100644 --- a/public/app/plugins/panel/graph/module.ts +++ b/public/app/plugins/panel/graph/module.ts @@ -313,11 +313,11 @@ class GraphCtrl extends MetricsPanelCtrl { convertThresholdsToAlerts() { if (this.panel.grid && this.panel.grid.thresholds1) { - this.panel.alerting.warn_level = '< ' + this.panel.grid.threshold1; + this.panel.alerting.warnLevel = '< ' + this.panel.grid.threshold1; } if (this.panel.grid && this.panel.grid.thresholds2) { - this.panel.alerting.crit_level = '< ' + this.panel.grid.threshold2; + this.panel.alerting.critLevel = '< ' + this.panel.grid.threshold2; } } diff --git a/public/app/plugins/panel/graph/partials/tab_alerting.html b/public/app/plugins/panel/graph/partials/tab_alerting.html index 0bbfb262171..00e1f940183 100644 --- a/public/app/plugins/panel/graph/partials/tab_alerting.html +++ b/public/app/plugins/panel/graph/partials/tab_alerting.html @@ -8,7 +8,7 @@ Query to watch
@@ -17,11 +17,11 @@

We noticed you have existing threshholds.Convert them

Warn level - +
Critical level - +
@@ -39,7 +39,7 @@
Query range + ng-model="ctrl.panel.alerting.queryRange" placeholder="10m">