Documentation ¶
Index ¶
- Constants
- func Build(confs []*config.Receiver, tmpl *template.Template) map[string]Fanout
- func GroupKey(ctx context.Context) (model.Fingerprint, bool)
- func GroupLabels(ctx context.Context) (model.LabelSet, bool)
- func Now(ctx context.Context) (time.Time, bool)
- func Receiver(ctx context.Context) (string, bool)
- func RepeatInterval(ctx context.Context) (time.Duration, bool)
- func WithGroupKey(ctx context.Context, fp model.Fingerprint) context.Context
- func WithGroupLabels(ctx context.Context, lset model.LabelSet) context.Context
- func WithNow(ctx context.Context, t time.Time) context.Context
- func WithReceiver(ctx context.Context, rcv string) context.Context
- func WithRepeatInterval(ctx context.Context, t time.Duration) context.Context
- type DedupingNotifier
- type Email
- type Fanout
- type InhibitNotifier
- type LogNotifier
- type Notifier
- type NotifierFunc
- type OpsGenie
- type PagerDuty
- type RetryNotifier
- type Router
- type SilenceNotifier
- type Slack
- type Webhook
- type WebhookMessage
Constants ¶
const MinTimeout = 10 * time.Second
MinTimeout is the minimum timeout that is set for the context of a call to a notification pipeline.
Variables ¶
This section is empty.
Functions ¶
func GroupKey ¶
func GroupKey(ctx context.Context) (model.Fingerprint, bool)
GroupKey extracts a group key from the context. Iff none exists, the second argument is false.
func GroupLabels ¶
GroupLabels extracts grouping label set from the context. Iff none exists, the second argument is false.
func Now ¶
Now extracts a now timestamp from the context. Iff none exists, the second argument is false.
func Receiver ¶
Receiver extracts a receiver from the context. Iff none exists, the second argument is false.
func RepeatInterval ¶
RepeatInterval extracts a repeat interval from the context. Iff none exists, the second argument is false.
func WithGroupKey ¶
WithGroupKey populates a context with a group key.
func WithGroupLabels ¶
WithGroupLabels populates a context with grouping labels.
func WithReceiver ¶
WithReceiver populates a context with a receiver.
Types ¶
type DedupingNotifier ¶
type DedupingNotifier struct {
// contains filtered or unexported fields
}
DedupingNotifier filters and forwards alerts to another notifier. Filtering happens based on a provider of NotifyInfos. On successful notification new NotifyInfos are set.
type Email ¶
type Email struct {
// contains filtered or unexported fields
}
Email implements a Notifier for email notifications.
type InhibitNotifier ¶
type InhibitNotifier struct {
// contains filtered or unexported fields
}
InhibitNotifier filters alerts through an inhibition muter before passing it on to the next Notifier
type LogNotifier ¶
type LogNotifier struct {
// contains filtered or unexported fields
}
LogNotifier logs the alerts to be notified about. It forwards to another Notifier afterwards, if any is provided.
type Notifier ¶
A Notifier is a type which notifies about alerts under constraints of the given context.
type NotifierFunc ¶
type OpsGenie ¶
type OpsGenie struct {
// contains filtered or unexported fields
}
OpsGenie implements a Notifier for OpsGenie notifications.
func NewOpsGenie ¶
func NewOpsGenie(c *config.OpsGenieConfig, t *template.Template) *OpsGenie
NewOpsGenieDuty returns a new OpsGenie notifier.
type PagerDuty ¶
type PagerDuty struct {
// contains filtered or unexported fields
}
PagerDuty implements a Notifier for PagerDuty notifications.
func NewPagerDuty ¶
func NewPagerDuty(c *config.PagerdutyConfig, t *template.Template) *PagerDuty
NewPagerDuty returns a new PagerDuty notifier.
type RetryNotifier ¶
type RetryNotifier struct {
// contains filtered or unexported fields
}
RetryNotifier accepts another notifier and retries notifying on error with exponential backoff.
func Retry ¶
func Retry(n Notifier) *RetryNotifier
Retry wraps the given notifier in a RetryNotifier.
type Router ¶
Router dispatches the alerts to one of a set of named notifiers based on the name value provided in the context.
type SilenceNotifier ¶
type SilenceNotifier struct {
// contains filtered or unexported fields
}
SilenceNotifier filters alerts through a silence muter before passing it on to the next Notifier
type Slack ¶
type Slack struct {
// contains filtered or unexported fields
}
Slack implements a Notifier for Slack notifications.
type Webhook ¶
type Webhook struct { // The URL to which notifications are sent. URL string }
Webhook implements a Notifier for generic webhooks.
func NewWebhook ¶
func NewWebhook(conf *config.WebhookConfig) *Webhook
NewWebhook returns a new Webhook.
type WebhookMessage ¶
type WebhookMessage struct { // The protocol version. Version string `json:"version"` // The alert status. It is firing iff any of the alerts is not resolved. Status model.AlertStatus `json:"status"` // A batch of alerts. Alerts model.Alerts `json:"alert"` }
WebhookMessage defines the JSON object send to webhook endpoints.