Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ActionShortNames = map[string]ActionType{ "Ack": ActionAcknowledge, "Close": ActionClose, "Forget": ActionForget, "ForceClose": ActionForceClose, "Purge": ActionPurge, "Note": ActionNote, "DelayedClose": ActionDelayedClose, "CancelClose": ActionCancelClose, }
ActionShortNames is a map of keys we use in config file (notifications mostly) to reference action types
Functions ¶
This section is empty.
Types ¶
type ActionType ¶
type ActionType int // Available to users in templates, document changes in Bosun docs
const ( ActionNone ActionType = iota ActionAcknowledge ActionClose ActionForget ActionForceClose ActionPurge ActionNote ActionDelayedClose ActionCancelClose )
func (ActionType) HumanString ¶
func (a ActionType) HumanString() string
HumanString gives a better human readable form than the default stringer, which we can't change due to marshalling compatibility now
func (ActionType) MarshalJSON ¶
func (a ActionType) MarshalJSON() ([]byte, error)
func (ActionType) String ¶
func (a ActionType) String() string
func (*ActionType) UnmarshalJSON ¶
func (a *ActionType) UnmarshalJSON(b []byte) error
type AlertKey ¶
type AlertKey string
func ParseAlertKey ¶
type Attachment ¶
type Computation ¶
type Computation struct { Text string Value interface{} }
type Computations ¶
type Computations []Computation
type EventsByTime ¶
type EventsByTime []Event
func (EventsByTime) Len ¶
func (a EventsByTime) Len() int
func (EventsByTime) Less ¶
func (a EventsByTime) Less(i, j int) bool
func (EventsByTime) Swap ¶
func (a EventsByTime) Swap(i, j int)
type Float ¶
type Float float64
custom float type to support json marshalling of NaN
func (Float) MarshalJSON ¶
func (*Float) UnmarshalJSON ¶
type IncidentState ¶
type IncidentState struct { // Since IncidentState is embedded into a template's Context these fields // are available to users. Changes to this object should be reflected // in Bosun's documentation and changes that might break user's teamplates. // need to be considered. Id int64 Start time.Time End *time.Time AlertKey AlertKey Alert string // helper data since AlertKeys don't serialize to JSON well Tags string // string representation of Group *Result // Most recent last. Events []Event `json:",omitempty"` Actions []Action `json:",omitempty"` Subject string NeedAck bool Open bool Unevaluated bool CurrentStatus Status WorstStatus Status LastAbnormalStatus Status LastAbnormalTime Epoch PreviousIds []int64 // A list to the previous IncidentIds for the same alert key (alertname+tagset) NextId int64 // The id of the next Incident Id for the same alert key, only added once a future incident has been created // set of notifications we have already sent alerts to during the lifetime of the incident Notifications []string }
func (*IncidentState) Group ¶
func (s *IncidentState) Group() opentsdb.TagSet
func (*IncidentState) IsActive ¶
func (s *IncidentState) IsActive() bool
func (*IncidentState) Last ¶
func (s *IncidentState) Last() Event
func (*IncidentState) SetNotified ¶
func (i *IncidentState) SetNotified(not string) bool
SetNotified marks the notification name as "active" for this incident. All future actions and unknown notifications will go to all "active" notifications it returns true if the set was changed (and needs resaving)
type RenderedTemplates ¶
type RenderedTemplates struct { Subject string Body string EmailBody []byte EmailSubject []byte Custom map[string]string Attachments []*Attachment }
func (*RenderedTemplates) Get ¶
func (r *RenderedTemplates) Get(name string) string
func (*RenderedTemplates) GetDefault ¶
func (r *RenderedTemplates) GetDefault(name string, defaultName string) string
type Result ¶
type Result struct { Computations `json:",omitempty"` Value Float Expr string }
type Silence ¶
type Status ¶
type Status int
func (Status) IsCritical ¶
func (Status) MarshalJSON ¶
func (*Status) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.