Merge pull request #7249 from grafana/alerting_test_alertrule
Enable error and no_data overrides when testing alerting.
This commit is contained in:
+1
-1
@@ -120,10 +120,10 @@ func AlertTest(c *middleware.Context, dto dtos.AlertTestCommand) Response {
|
||||
}
|
||||
|
||||
res := backendCmd.Result
|
||||
|
||||
dtoRes := &dtos.AlertTestResult{
|
||||
Firing: res.Firing,
|
||||
ConditionEvals: res.ConditionEvals,
|
||||
State: res.Rule.State,
|
||||
}
|
||||
|
||||
if res.Error != nil {
|
||||
|
||||
@@ -37,6 +37,7 @@ type AlertTestCommand struct {
|
||||
|
||||
type AlertTestResult struct {
|
||||
Firing bool `json:"firing"`
|
||||
State m.AlertStateType `json:"state"`
|
||||
ConditionEvals string `json:"conditionEvals"`
|
||||
TimeMs string `json:"timeMs"`
|
||||
Error string `json:"error,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user