Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultHandler ¶
DefaultHandler for any HTTP requests not matching a configured alertmanager webhook handler.
Types ¶
type Action ¶
type Action interface { // Act on the alertmanager webhook payload. Act(AlermanagerWebhookPayload) error }
Action which can be taken when an alertmanager payload is sent to a handler.
func CommandAction ¶
CommandAction executes a command in response to an alertmanager payload.
type AlermanagerWebhookPayload ¶
type AlermanagerWebhookPayload struct { Version string `json:"version"` GroupKey string `json:"groupKey"` TruncatedAlerts int `json:"truncatedAlerts"` Status AlertStatus `json:"status"` Receiver string `json:"receiver"` GroupLabels map[LabelKey]LabelValue `json:"groupLabels"` CommonLabels map[LabelKey]LabelValue `json:"commonLabels"` CommonAnnotations map[string]string `json:"commonAnnotations"` Alertmanager string `json:"externalURL"` Alerts []Alert `json:"alerts"` }
type AlertStatus ¶
type AlertStatus string
const ( AlertStatusFiring AlertStatus = "firing" AlertStatusResolved AlertStatus = "resolved" )
type LabelValue ¶
type LabelValue string
Click to show internal directories.
Click to hide internal directories.