Commit 09cdf3e9 by Torkel Ödegaard

feat(alerting): show execution errors in alert list

parent 5cf97118
......@@ -11,7 +11,7 @@ type AlertSeverityType string
const (
AlertStatePending AlertStateType = "pending"
AlertStateExeuctionError AlertStateType = "exeuction_error"
AlertStateExeuctionError AlertStateType = "execution_error"
AlertStatePaused AlertStateType = "paused"
AlertStateCritical AlertStateType = "critical"
AlertStateWarning AlertStateType = "warning"
......
......@@ -29,7 +29,7 @@ func NewResultHandler() *DefaultResultHandler {
func (handler *DefaultResultHandler) Handle(ctx *EvalContext) {
oldState := ctx.Rule.State
exeuctionError := " "
exeuctionError := ""
if ctx.Error != nil {
handler.log.Error("Alert Rule Result Error", "ruleId", ctx.Rule.Id, "error", ctx.Error)
ctx.Rule.State = m.AlertStateExeuctionError
......
......@@ -76,6 +76,14 @@ function getStateDisplayModel(state) {
stateClass: 'alert-state-warning'
};
}
case 'execution_error': {
return {
text: 'EXECUTION ERROR',
iconClass: 'icon-gf icon-gf-critical',
stateClass: 'alert-state-critical'
};
}
case 'paused': {
return {
text: 'paused',
......
......@@ -33,9 +33,6 @@
<i class="icon-gf icon-gf-settings"></i>
</a>
</div>
<div class="card-item-notice" ng-show="alert.executionError">
<span>Execution Error</span>
</div>
</div>
<div class="card-item-body">
<div class="card-item-details">
......@@ -50,6 +47,8 @@
{{alert.stateModel.text}}
</span> for {{alert.newStateDateAgo}}
</div>
<div class="small muted" ng-show="alert.executionError">
{{alert.executionError}}
</div>
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment