import "bosun.org/models"
alertKey.go errors.go incidents.go silence.go
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
type Action struct { // These are available to users via the template language. Changes here // should be reflected in the documentation User string Message string Time time.Time Type ActionType Deadline *time.Time `json:",omitempty"` Fullfilled bool Cancelled bool }
const ( ActionNone ActionType = iota ActionAcknowledge ActionClose ActionForget ActionForceClose ActionPurge ActionNote ActionDelayedClose ActionCancelClose )
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 (a ActionType) MarshalJSON() ([]byte, error)
func (a ActionType) String() string
func (a *ActionType) UnmarshalJSON(b []byte) error
Group returns the tagset of this alert key. Will panic if a is not a valid AlertKey. OpenTSDB tag validation errors are ignored.
type Computations []Computation
type Event struct { Warn, Crit *Result `json:",omitempty"` Status Status Time time.Time Unevaluated bool }
func (a EventsByTime) Len() int
func (a EventsByTime) Less(i, j int) bool
func (a EventsByTime) Swap(i, j int)
custom float type to support json marshalling of NaN
const ( TypeString FuncType = iota TypePrefix TypeScalar TypeNumberSet TypeSeriesSet TypeESQuery TypeESIndexer TypeNumberExpr TypeSeriesExpr // No implementation yet TypeTable TypeVariantSet TypeAzureResourceList TypeAzureAIApps TypeInfo TypeUnexpected )
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 (s *IncidentState) Group() opentsdb.TagSet
func (s *IncidentState) IsActive() bool
func (s *IncidentState) Last() Event
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 struct { Subject string Body string EmailBody []byte EmailSubject []byte Custom map[string]string Attachments []*Attachment }
func (r *RenderedTemplates) Get(name string) string
func (r *RenderedTemplates) GetDefault(name string, defaultName string) string
type Result struct { Computations `json:",omitempty"` Value Float Expr string }
type Silence struct { Start, End time.Time Alert string Tags opentsdb.TagSet TagString string Forget bool User string Message string }
Package models imports 9 packages (graph) and is imported by 12 packages. Updated 2018-10-23. Refresh now. Tools for package owners.