Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRuleSetValidationFailed = errors.New("rule set validation failed") ErrMissingRulesMsg = "there must be at least 1 rule in a rule set" ErrMissingRuleIDMsg = "rule id cannot be empty" ErrMissingNotificationTemplatesMsg = "missing notification templates" ErrMissingIgnoreSpecsMsg = "missing ignore specs" ErrActionMissingContentMsg = "missing action content" ErrMissingExprMsg = "expression cannot be empty" ErrTemplateNotFoundMsg = "template not found" ErrFailedToCompileMsg = "failed to compile rule" )
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct { *NotifyList `json:"notify,omitempty"` *IgnoreList `json:"ignore,omitempty"` LogMessage `json:"log,omitempty"` }
func (*Action) GetActType ¶
func (at *Action) GetActType() (actType actions.ActionType)
type ActionList ¶
type ActionList []Action
func (ActionList) Clone ¶
func (al ActionList) Clone() (clonedAL ActionList)
type AlertStatus ¶
type AlertStatus string
const ( Alerting AlertStatus = "ALERTING" Resolved AlertStatus = "RESOLVED" )
type IgnoreList ¶
type IgnoreList []IgnoreSpec
type IgnoreSpec ¶
type IgnoreSpec string
type LogMessage ¶
type LogMessage string
type NotifyList ¶
type NotifyList []templates.TemplateID
type Problem ¶
type Problem struct { ID ProblemID `json:"problem_id"` RuleID RuleID `json:"rule_id"` ClientID string `json:"client_id"` ClientName string `json:"client_name"` Actions ActionList `json:"actions"` Active bool `json:"active"` CreatedAt time.Time `json:"created_at"` ResolvedAt types.TimeJSON `json:"resolved_at"` CUID string `json:"client_update_id"` MUID string `json:"measurement_update_id"` }
type ProblemUpdateRequest ¶
type ProblemUpdateRequest struct {
Active bool `json:"active"`
}
type Rule ¶
type Rule struct { ID RuleID `json:"id"` Severity severity.Severity `json:"severity"` Ex string `json:"expr"` Actions ActionList `json:"actions"` }
Click to show internal directories.
Click to hide internal directories.