Skip to content

Commit

Permalink
Revert "* This patch will fix unknown incident being ignored"
Browse files Browse the repository at this point in the history
This reverts commit 21e6b64aa5d34070dc9fe632fd415b732990687f.
  • Loading branch information
Pradeep Mishra committed Oct 20, 2017
1 parent 3eb7ec3 commit c714bc9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 21 deletions.
1 change: 0 additions & 1 deletion cmd/bosun/conf/conf.go
Expand Up @@ -433,7 +433,6 @@ type Alert struct {
UnknownsNormal bool
UnjoinedOK bool `json:",omitempty"`
Log bool
IgnoreError bool
RunEvery int
ReturnType models.FuncType

Expand Down
2 changes: 0 additions & 2 deletions cmd/bosun/conf/rule/loaders.go
Expand Up @@ -225,8 +225,6 @@ func (c *Conf) loadAlert(s *parse.SectionNode) {
a.UnknownsNormal = true
case "log":
a.Log = true
case "ignoreError":
a.IgnoreError = true
case "runEvery":
var err error
a.RunEvery, err = strconv.Atoi(v)
Expand Down
21 changes: 3 additions & 18 deletions cmd/bosun/sched/check.go
Expand Up @@ -116,6 +116,7 @@ func (s *Schedule) runHistory(r *RunHistory, ak models.AlertKey, event *models.E
// get existing open incident if exists
var incident *models.IncidentState
rt := &models.RenderedTemplates{}

incident, err = data.GetOpenIncident(ak)
if err != nil {
return
Expand Down Expand Up @@ -567,12 +568,8 @@ func (s *Schedule) CheckAlert(T miniprofiler.Timer, r *RunHistory, a *conf.Alert
unevalCount, unknownCount := markDependenciesUnevaluated(r.Events, deps, a.Name)
if err != nil {
slog.Errorf("Error checking alert %s: %s", a.Name, err.Error())
if a.IgnoreUnknown {
removeUnknownEvents(r.Events, a.Name)
}
if !a.IgnoreError {
s.markAlertError(a.Name, err)
}
removeUnknownEvents(r.Events, a.Name)
s.markAlertError(a.Name, err)
} else {
s.markAlertSuccessful(a.Name)
}
Expand Down Expand Up @@ -616,13 +613,6 @@ func markDependenciesUnevaluated(events map[models.AlertKey]*models.Event, deps
if ak.Name() != alert {
continue
}

if len(deps) == 0 {
if ev.Status == models.StUnknown {
unknownCount++
}
}

for _, dep := range deps {
if len(dep.Group) == 0 || dep.Group.Overlaps(ak.Group()) {
ev.Unevaluated = true
Expand Down Expand Up @@ -681,11 +671,6 @@ func (s *Schedule) CheckExpr(T miniprofiler.Timer, rh *RunHistory, a *conf.Alert
return nil, nil, true
}
if err != nil {
// Create a alertkey with empty tag set, since the reslut was empty
ak := models.NewAlertKey(a.Name, opentsdb.TagSet{})
event := new(models.Event)
event.Status = models.StUnknown
rh.Events[ak] = event
return
}
Loop:
Expand Down

0 comments on commit c714bc9

Please sign in to comment.