Alerting: Fix DatasourceUID and RefID missing for DatasourceNoData alerts (#66733)
This commit fixes a bug where DatasourceUID and RefID annotations are missing for DatasourceNoData alerts in Grafana 9.5. This bug affects datasource plugins that have moved to using the data plane contract.
This commit is contained in:
@@ -575,6 +575,26 @@ func TestEvaluate(t *testing.T) {
|
||||
"ref_id": "A",
|
||||
},
|
||||
}},
|
||||
}, {
|
||||
name: "is no data for one frame with no fields",
|
||||
cond: models.Condition{
|
||||
Data: []models.AlertQuery{{
|
||||
RefID: "A",
|
||||
DatasourceUID: "test",
|
||||
}},
|
||||
},
|
||||
resp: backend.QueryDataResponse{
|
||||
Responses: backend.Responses{
|
||||
"A": {Frames: []*data.Frame{{Fields: nil}}},
|
||||
},
|
||||
},
|
||||
expected: Results{{
|
||||
State: NoData,
|
||||
Instance: data.Labels{
|
||||
"datasource_uid": "test",
|
||||
"ref_id": "A",
|
||||
},
|
||||
}},
|
||||
}}
|
||||
|
||||
for _, tc := range cases {
|
||||
|
||||
Reference in New Issue
Block a user