Documentation ¶
Index ¶
- Constants
- Variables
- func AggregationTrack(c *Condition, e *event.Event) bool
- func LoadFactory(name string, f Factory)
- func SimpleTrack(c *Condition, e *event.Event) bool
- type Aggregation
- type Condition
- type Escalation
- type EscalationCollection
- type EscalationPolicy
- type Factory
- type MatchSet
- type Matcher
- type Policy
- func (p *Policy) ActionCrit(e *event.Event) (bool, int)
- func (p *Policy) ActionWarn(e *event.Event) (bool, int)
- func (p *Policy) CheckMatch(e *event.Event) bool
- func (p *Policy) CheckNotMatch(e *event.Event) bool
- func (p *Policy) Compile(next event.IncidentPasser)
- func (p *Policy) Matches(e *event.Event) bool
- func (p *Policy) PassEvent(e *event.Event)
- func (p *Policy) Stop()
- type TrackFunc
Constants ¶
const ( DEFAULT_WINDOW_SIZE = 2 // The default size of the dataframe used in window operations STATUS_SIZE = 10 // The default size of the dataframe used to count statuses MIN_STD_DEV_WINDOW_SIZE = 5 // the smallets a window size can be for a standard deviation check )
Variables ¶
var (
DEFAULT_GROUP_BY = &event.TagSet{
{"host", "^(.*)$"},
{"service", "^(.*)$"},
{"sub_service", "^(.*)$"},
}
)
var ( Escalations = &EscalationCollection{ factories: make(map[string]Factory), } )
Functions ¶
func LoadFactory ¶
LoadFactory loads an Factory into the globaly available map of EscalationFactories
Types ¶
type Aggregation ¶
type Aggregation struct {
WindowLength int `json:"window_length"`
}
Config for checks based on the aggrigation of data over a time window, instead of individual data points
type Condition ¶
type Condition struct { Greater *float64 `json:"greater"` Less *float64 `json:"less"` Exactly *float64 `json:"exactly"` StdDev bool `json:"std_dev"` Derivative bool `json:"derivative"` HoltWinters bool `json:"holt_winters"` Simple bool `json:"simple"` Occurences int `json:"occurences"` WindowSize int `json:"window_size"` ModifierFuncs []string `json:"modifier_funcs"` Aggregation *Aggregation `json:"agregation"` sync.Mutex // contains filtered or unexported fields }
Condition holds conditional information to check events against
func (*Condition) DoOnTracker ¶
func (*Condition) OccurencesHit ¶
check to see if an event has hit the occurences level
func (*Condition) StateChanged ¶
StateChanged returns true if the state of the incoming event is not the same as the last event
type Escalation ¶
type Escalation interface { Send(i *event.Incident) error ConfigStruct() interface{} Init(interface{}) error }
Escalation is the basic interface which provides a way to communicate incidents to the outside world
type EscalationCollection ¶
type EscalationPolicy ¶
type EscalationPolicy struct { Match *event.TagSet `json:"match"` NotMatch *event.TagSet `json:"not_match"` Warn bool `json:"warn"` Crit bool `json:"crit"` Ok bool `json:"ok"` Name string `json:"name"` Comment string `json:"comment"` Configs []json.RawMessage `json:"configs"` // Escalations to forward incidents to Escalations []Escalation `json:"-"` // contains filtered or unexported fields }
EscalationPolicy is the collection of Escalations that are subscribed to by the policy
func (*EscalationPolicy) Compile ¶
func (e *EscalationPolicy) Compile() (err error)
Compile sets up all the regex matches for the subscriptions and starts all of the Escalations held by the policy
func (*EscalationPolicy) PassIncident ¶
func (e *EscalationPolicy) PassIncident(i *event.Incident)
PassIncident takes an incident into the escalation for processing
type Factory ¶
type Factory func() Escalation
Factory returns a new Escalation
func GetFactory ¶
GetFactory returns the Factory associated with the given name
type Matcher ¶
type Matcher []MatchSet
func (Matcher) MatchesAll ¶
MatchesAll returns true if the TagSet satisfies the entire matcher
type Policy ¶
type Policy struct { Match *event.TagSet `json:"match"` NotMatch *event.TagSet `json:"not_match"` GroupBy *event.TagSet `json:"group_by"` Crit *Condition `json:"crit"` Warn *Condition `json:"warn"` Name string `json:"name"` Comment string `json:"comment"` // contains filtered or unexported fields }
func (*Policy) ActionCrit ¶
ActionCrit returns the state change and the current status of the event
func (*Policy) ActionWarn ¶
ActionWarn returns the state change and the current status of the event
func (*Policy) CheckMatch ¶
CheckMatch returns true if all of match's are satisfied by the event's TagSet
func (*Policy) CheckNotMatch ¶
CheckNotMatch returns true if any of the not_match's are satisfied by the TagSet
func (*Policy) Compile ¶
func (p *Policy) Compile(next event.IncidentPasser)
compile the regex patterns for this policy