List open incidents #1764

Merged
merged 14 commits into from Jun 8, 2016

Projects

None yet

2 participants

@kylebrandt
Member

No description provided.

@kylebrandt
Member

Still needs docs.

kylebrandt added some commits Jun 3, 2016
@kylebrandt kylebrandt add events
cc7e262
@kylebrandt kylebrandt include event list in incident summary
8238332
@kylebrandt kylebrandt Make events have epoch time
d3c3f9a
@kylebrandt kylebrandt s/silence/silenced 3f3b4c3
@captncraig captncraig commented on an outdated diff Jun 7, 2016
cmd/bosun/conf/conf.go
@@ -295,6 +295,31 @@ func (ns *Notifications) Get(c *Conf, tags opentsdb.TagSet) map[string]*Notifica
return nots
}
+func GetNotificationChains(c *Conf, n map[string]*Notification) ([][]string) {
@captncraig
captncraig Jun 7, 2016 Contributor

this needs a comments about exactly what it returns. I'm kinda confused on the myself. A list of lists of chains for a single alert? With no duplicates. Maybe writing it out will help.

@captncraig captncraig commented on an outdated diff Jun 7, 2016
cmd/bosun/conf/conf.go
@@ -340,9 +365,9 @@ type Notification struct {
body string
}
-func (n *Notification) MarshalJSON() ([]byte, error) {
- return nil, fmt.Errorf("conf: cannot json marshal notifications")
-}
+// func (n *Notification) MarshalJSON() ([]byte, error) {
@captncraig
captncraig Jun 7, 2016 Contributor

delete rather than comment.

@captncraig captncraig commented on an outdated diff Jun 7, 2016
cmd/bosun/sched/sched.go
@@ -22,6 +22,8 @@ import (
"github.com/MiniProfiler/go/miniprofiler"
"github.com/boltdb/bolt"
"github.com/bradfitz/slice"
+ "github.com/kylebrandt/boolq"
+ "github.com/kylebrandt/boolq/parse"
@captncraig
captncraig Jun 7, 2016 Contributor

can we alias this reference please. We have way too many things called parse. Better yet, maybe it should just be boolq.Parse and nobody else needs to know about the internal parse package.

@captncraig captncraig commented on an outdated diff Jun 7, 2016
cmd/bosun/sched/sched.go
@@ -391,7 +396,18 @@ func (s *Schedule) MarshalGroups(T miniprofiler.Timer, filter string) (*StateGro
}
continue
}
- if matches(s.Conf, a, v) {
+ if parsedExpr == nil {
@captncraig
captncraig Jun 7, 2016 edited Contributor

I feel like the logic here is a bit odd. I would like to see the status[k] = v bit only once, and continue if it doesn't match the filter.
Something like if filter and !filter.Matches(is) { continue} status[k] = v. If that makes any sense.

kylebrandt added some commits Jun 8, 2016
@kylebrandt kylebrandt document GetNotificationChains, update boolq
b3d7c22
@kylebrandt kylebrandt simplify filter logic, update boolq
2847542
@kylebrandt kylebrandt fmt
c1a4d48
@kylebrandt kylebrandt merged commit bdab335 into master Jun 8, 2016

2 checks passed

bosun All checks Passed!
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@kylebrandt kylebrandt deleted the listOpenIncidents branch Jun 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment