feat(alerting): save execution error upon state changed

This commit is contained in:
bergquist
2016-08-17 09:27:29 +02:00
parent 9915f15ed0
commit 6497b307c4
5 changed files with 11 additions and 63 deletions
+6 -9
View File
@@ -10,9 +10,11 @@ type AlertStateType string
type AlertSeverityType string
const (
AlertStatePending AlertStateType = "pending"
AlertStateFiring AlertStateType = "firing"
AlertStateOK AlertStateType = "ok"
AlertStatePending AlertStateType = "pending"
AlertStateExeuctionError AlertStateType = "exeuction_error"
AlertStatePaused AlertStateType = "paused"
AlertStateFiring AlertStateType = "firing"
AlertStateOK AlertStateType = "ok"
)
func (s AlertStateType) IsValid() bool {
@@ -41,7 +43,6 @@ type Alert struct {
Severity AlertSeverityType
State AlertStateType
Handler int64
Paused bool
Silenced bool
ExecutionError string
Frequency int64
@@ -115,6 +116,7 @@ type SetAlertStateCommand struct {
AlertId int64
OrgId int64
State AlertStateType
Error string
Timestamp time.Time
}
@@ -122,11 +124,6 @@ type DeleteAlertCommand struct {
AlertId int64
}
type SaveExecutionErrorCommand struct {
AlertId int64
ExecutionError string
}
//Queries
type GetAlertsQuery struct {
OrgId int64