mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Renamed Initialized to Pending
This commit is contained in:
@@ -86,7 +86,7 @@ func (handler *DefaultResultHandler) Handle(evalContext *EvalContext) error {
|
||||
handler.log.Error("Failed to save annotation for new alert state", "error", err)
|
||||
}
|
||||
|
||||
if (oldState == m.AlertStateInitialized) && (evalContext.Rule.State == m.AlertStateOK) {
|
||||
if (oldState == m.AlertStatePending) && (evalContext.Rule.State == m.AlertStateOK) {
|
||||
handler.log.Info("Notfication not sent", "oldState", oldState, "newState", evalContext.Rule.State)
|
||||
} else {
|
||||
handler.notifier.Notify(evalContext)
|
||||
@@ -103,8 +103,8 @@ func (handler *DefaultResultHandler) shouldUpdateAlertState(evalContext *EvalCon
|
||||
|
||||
func countStateResult(state m.AlertStateType) {
|
||||
switch state {
|
||||
case m.AlertStateInitialized:
|
||||
metrics.M_Alerting_Result_State_Initialized.Inc(1)
|
||||
case m.AlertStatePending:
|
||||
metrics.M_Alerting_Result_State_Pending.Inc(1)
|
||||
case m.AlertStateAlerting:
|
||||
metrics.M_Alerting_Result_State_Alerting.Inc(1)
|
||||
case m.AlertStateOK:
|
||||
|
||||
@@ -173,7 +173,7 @@ func upsertAlerts(existingAlerts []*m.Alert, cmd *m.SaveAlertsCommand, sess *xor
|
||||
} else {
|
||||
alert.Updated = time.Now()
|
||||
alert.Created = time.Now()
|
||||
alert.State = m.AlertStateInitialized
|
||||
alert.State = m.AlertStatePending
|
||||
alert.NewStateDate = time.Now()
|
||||
|
||||
_, err := sess.Insert(alert)
|
||||
|
||||
@@ -47,7 +47,7 @@ func TestAlertingDataAccess(t *testing.T) {
|
||||
So(err2, ShouldBeNil)
|
||||
So(alert.Name, ShouldEqual, "Alerting title")
|
||||
So(alert.Message, ShouldEqual, "Alerting message")
|
||||
So(alert.State, ShouldEqual, "initialized")
|
||||
So(alert.State, ShouldEqual, "pending")
|
||||
So(alert.Frequency, ShouldEqual, 1)
|
||||
})
|
||||
|
||||
@@ -77,7 +77,7 @@ func TestAlertingDataAccess(t *testing.T) {
|
||||
So(query.Result[0].Name, ShouldEqual, "Name")
|
||||
|
||||
Convey("Alert state should not be updated", func() {
|
||||
So(query.Result[0].State, ShouldEqual, "initialized")
|
||||
So(query.Result[0].State, ShouldEqual, "pending")
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user