Alerting/Expr: New SSE Request/QueryType, alerting move data source UID (#33282)

This commit is contained in:
Kyle Brandt
2021-04-23 10:52:32 -04:00
committed by GitHub
parent 659ea20c3c
commit 5e818146de
19 changed files with 179 additions and 248 deletions
+20 -20
View File
@@ -90,8 +90,8 @@ func TestAlertAndGroupsQuery(t *testing.T) {
From: ngmodels.Duration(time.Duration(5) * time.Hour),
To: ngmodels.Duration(time.Duration(3) * time.Hour),
},
DatasourceUID: "-100",
Model: json.RawMessage(`{
"datasourceUid": "-100",
"type": "math",
"expression": "2 + 3 > 1"
}`),
@@ -208,8 +208,8 @@ func TestAlertRuleCRUD(t *testing.T) {
From: ngmodels.Duration(time.Duration(5) * time.Hour),
To: ngmodels.Duration(time.Duration(3) * time.Hour),
},
DatasourceUID: "-100",
Model: json.RawMessage(`{
"datasourceUid": "-100",
"type": "math",
"expression": "2 + 3 > 1"
}`),
@@ -238,8 +238,8 @@ func TestAlertRuleCRUD(t *testing.T) {
From: ngmodels.Duration(time.Duration(5) * time.Hour),
To: ngmodels.Duration(time.Duration(3) * time.Hour),
},
DatasourceUID: "-100",
Model: json.RawMessage(`{
"datasourceUid": "-100",
"type": "math",
"expression": "2 + 3 > 1"
}`),
@@ -268,8 +268,8 @@ func TestAlertRuleCRUD(t *testing.T) {
From: ngmodels.Duration(time.Duration(5) * time.Hour),
To: ngmodels.Duration(time.Duration(3) * time.Hour),
},
DatasourceUID: "-100",
Model: json.RawMessage(`{
"datasourceUid": "-100",
"type": "math",
"expression": "2 + 3 > 1"
}`),
@@ -299,8 +299,8 @@ func TestAlertRuleCRUD(t *testing.T) {
From: ngmodels.Duration(time.Duration(5) * time.Hour),
To: ngmodels.Duration(time.Duration(3) * time.Hour),
},
DatasourceUID: "-100",
Model: json.RawMessage(`{
"datasourceUid": "-100",
"type": "math",
"expression": "2 + 3 > 1"
}`),
@@ -368,8 +368,8 @@ func TestAlertRuleCRUD(t *testing.T) {
From: ngmodels.Duration(time.Duration(5) * time.Hour),
To: ngmodels.Duration(time.Duration(3) * time.Hour),
},
DatasourceUID: "-100",
Model: json.RawMessage(`{
"datasourceUid": "-100",
"type": "math",
"expression": "2 + 3 > 1"
}`),
@@ -388,8 +388,8 @@ func TestAlertRuleCRUD(t *testing.T) {
From: ngmodels.Duration(time.Duration(5) * time.Hour),
To: ngmodels.Duration(time.Duration(3) * time.Hour),
},
DatasourceUID: "-100",
Model: json.RawMessage(`{
"datasourceUid": "-100",
"type": "math",
"expression": "2 + 3 > 1"
}`),
@@ -474,8 +474,8 @@ func TestAlertRuleCRUD(t *testing.T) {
"from":18000,
"to":10800
},
"datasourceUid":"-100",
"model":{
"datasourceUid":"-100",
"expression":"2 + 3 \u003e 1",
"intervalMs":1000,
"maxDataPoints":100,
@@ -509,8 +509,8 @@ func TestAlertRuleCRUD(t *testing.T) {
"from":18000,
"to":10800
},
"datasourceUid":"-100",
"model":{
"datasourceUid":"-100",
"expression":"2 + 3 \u003e 1",
"intervalMs":1000,
"maxDataPoints":100,
@@ -567,8 +567,8 @@ func TestAlertRuleCRUD(t *testing.T) {
From: ngmodels.Duration(time.Duration(5) * time.Hour),
To: ngmodels.Duration(time.Duration(3) * time.Hour),
},
DatasourceUID: "-100",
Model: json.RawMessage(`{
"datasourceUid": "-100",
"type": "math",
"expression": "2 + 3 < 1"
}`),
@@ -651,8 +651,8 @@ func TestAlertRuleCRUD(t *testing.T) {
From: ngmodels.Duration(time.Duration(5) * time.Hour),
To: ngmodels.Duration(time.Duration(3) * time.Hour),
},
DatasourceUID: "-100",
Model: json.RawMessage(`{
"datasourceUid": "-100",
"type": "math",
"expression": "2 + 3 < 1"
}`),
@@ -733,8 +733,8 @@ func TestAlertRuleCRUD(t *testing.T) {
"from":18000,
"to":10800
},
"model":{
"datasourceUid":"-100",
"datasourceUid":"-100",
"model":{
"expression":"2 + 3 \u003C 1",
"intervalMs":1000,
"maxDataPoints":100,
@@ -817,8 +817,8 @@ func TestAlertRuleCRUD(t *testing.T) {
"from": 18000,
"to": 10800
},
"datasourceUid":"-100",
"model": {
"datasourceUid": "-100",
"type":"math",
"expression":"1 < 2"
}
@@ -868,8 +868,8 @@ func TestAlertRuleCRUD(t *testing.T) {
"from": 18000,
"to": 10800
},
"datasourceUid": "-100",
"model": {
"datasourceUid": "-100",
"type":"math",
"expression":"1 > 2"
}
@@ -919,8 +919,8 @@ func TestAlertRuleCRUD(t *testing.T) {
"from": 18000,
"to": 10800
},
"datasourceUid": "-100",
"model": {
"datasourceUid": "-100",
"type":"math",
"expression":"1 > 2"
}
@@ -946,8 +946,8 @@ func TestAlertRuleCRUD(t *testing.T) {
"from": 18000,
"to": 10800
},
"datasourceUid": "unknown",
"model": {
"datasourceUid": "unknown"
}
}
],
@@ -997,8 +997,8 @@ func TestAlertRuleCRUD(t *testing.T) {
"from": 18000,
"to": 10800
},
"datasourceUid": "-100",
"model": {
"datasourceUid": "-100",
"type":"math",
"expression":"1 < 2"
}
@@ -1050,8 +1050,8 @@ func TestAlertRuleCRUD(t *testing.T) {
"from": 18000,
"to": 10800
},
"datasourceUid": "-100",
"model": {
"datasourceUid": "-100",
"type":"math",
"expression":"1 > 2"
}
@@ -1103,8 +1103,8 @@ func TestAlertRuleCRUD(t *testing.T) {
"from": 18000,
"to": 10800
},
"datasourceUid": "unknown",
"model": {
"datasourceUid": "unknown"
}
}
],