Documentation ¶
Overview ¶
The alerter package is responsible for receiving alert messages generated by monitors and dispatching them via the appropriate alerter type such as Slack, PagerDuty and so forth.
While the alerter does not utilize etcd watch functionality, it loads the appropriate alerter config on each message it receives. Due to this, it is important that the alerter is managed by the overwatch package (ie. gets shutdown/restarted during backend problems).
Index ¶
Constants ¶
View Source
const ( DEFAULT_EMAIL_FROM = "9volt-alerter@example.com" DEFAULT_EMAIL_AUTH = "plain" )
View Source
const ( EVENT_TYPE_TRIGGER = "trigger" EVENT_TYPE_RESOLVE = "resolve" )
View Source
const ( RESOLVE_COLOR = "#36a64f" // green WARNING_COLOR = "#ff9400" // orange CRITICAL_COLOR = "#ff0000" // red DEFAULT_SLACK_USERNAME = "9volt-bot" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alerter ¶
type AlerterConfig ¶
type Email ¶
func (*Email) ValidateConfig ¶
func (e *Email) ValidateConfig(alerterConfig *AlerterConfig) error
type IAlerter ¶
type IAlerter interface { Send(*Message, *AlerterConfig) error Identify() string ValidateConfig(*AlerterConfig) error }
type Message ¶
type Message struct { Type string // "resolve", "warning", "critical" Key []string // Keys coming from the monitor config for Critical or WarningAlerters Title string // Short description of the alert Text string // In-depth description of the alert state Source string // Origin of the alert Description string // Original check description so we can be verbose about what we are alerting on Count int // How many check attempts were made Contents map[string]string // Set checker-specific data (ensuring alerters know how to use the data) // contains filtered or unexported fields }
type Pagerduty ¶
func NewPagerduty ¶
func (*Pagerduty) ValidateConfig ¶
func (p *Pagerduty) ValidateConfig(alerterConfig *AlerterConfig) error
type Slack ¶
func (*Slack) ValidateConfig ¶
func (s *Slack) ValidateConfig(alerterConfig *AlerterConfig) error
Ensure that our alerter config contains all of the necessary information
Click to show internal directories.
Click to hide internal directories.