[Alerting]: Update scheduler to evaluate rules created by the unified API (#32589)

* Update scheduler

* Fix tests

* Fixes after code review feedback

* lint - add uncommitted modifications

Co-authored-by: kyle <kyle@grafana.com>
This commit is contained in:
Sofia Papagiannaki
2021-04-03 20:13:29 +03:00
committed by GitHub
co-authored by kyle
parent 455fbce020
commit daabf64aa1
11 changed files with 275 additions and 212 deletions
-3
View File
@@ -184,12 +184,9 @@ func (srv RulerSrv) RoutePostNameRulesConfig(c *models.ReqContext, ruleGroupConf
// TODO check quota
// TODO validate UID uniqueness in the payload
ruleGroup := ruleGroupConfig.Name
if err := srv.store.UpdateRuleGroup(store.UpdateRuleGroupCmd{
OrgID: c.SignedInUser.OrgId,
NamespaceUID: namespaceUID,
RuleGroup: ruleGroup,
RuleGroupConfig: ruleGroupConfig,
}); err != nil {
return response.Error(http.StatusInternalServerError, "failed to update rule group", err)
@@ -74,7 +74,7 @@
"condition": "B",
"data": [
{
"refId": "query",
"refId": "A",
"queryType": "",
"relativeTimeRange": {
"from": 18000,
@@ -82,7 +82,7 @@
},
"model": {
"alias": "just-testing",
"datasource": "000000004",
"datasource": "gdev-testdata",
"datasourceUid": "000000004",
"intervalMs": 1000,
"maxDataPoints": 100,
@@ -74,7 +74,7 @@
"condition": "B",
"data": [
{
"refId": "query",
"refId": "A",
"queryType": "",
"relativeTimeRange": {
"from": 18000,
@@ -82,7 +82,7 @@
},
"model": {
"alias": "just-testing",
"datasource": "000000004",
"datasource": "gdev-testdata",
"datasourceUid": "000000004",
"intervalMs": 1000,
"maxDataPoints": 100,