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 Hipchat
- type InhibitNotifier
- type LogNotifier
- type Notifier
- type NotifierFunc
- type OpsGenie
- type PagerDuty
- type Pushover
- 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 Hipchat ¶
type Hipchat struct {
// contains filtered or unexported fields
}
Hipchat implements a Notifier for Hipchat notifications.
func NewHipchat ¶
func NewHipchat(conf *config.HipchatConfig, tmpl *template.Template) *Hipchat
NewHipchat returns a new Hipchat notification handler.
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
NewOpsGenie 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 Pushover ¶
type Pushover struct {
// contains filtered or unexported fields
}
Pushover implements a Notifier for Pushover notifications.
func NewPushover ¶
func NewPushover(c *config.PushoverConfig, t *template.Template) *Pushover
NewPushover returns a new Pushover 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 // contains filtered or unexported fields }
Webhook implements a Notifier for generic webhooks.
func NewWebhook ¶
func NewWebhook(conf *config.WebhookConfig, t *template.Template) *Webhook
NewWebhook returns a new Webhook.