Documentation ¶
Index ¶
- Constants
- func GenerateSlackBody(file string, token string, recipient string) (map[string]string, bytes.Buffer, error)
- func NewAlertmanagerNotifier(model *m.AlertNotification) (alerting.Notifier, error)
- func NewDingDingNotifier(model *m.AlertNotification) (alerting.Notifier, error)
- func NewDiscordNotifier(model *m.AlertNotification) (alerting.Notifier, error)
- func NewEmailNotifier(model *m.AlertNotification) (alerting.Notifier, error)
- func NewHipChatNotifier(model *models.AlertNotification) (alerting.Notifier, error)
- func NewKafkaNotifier(model *m.AlertNotification) (alerting.Notifier, error)
- func NewLINENotifier(model *m.AlertNotification) (alerting.Notifier, error)
- func NewOpsGenieNotifier(model *m.AlertNotification) (alerting.Notifier, error)
- func NewPagerdutyNotifier(model *m.AlertNotification) (alerting.Notifier, error)
- func NewPushoverNotifier(model *m.AlertNotification) (alerting.Notifier, error)
- func NewSensuNotifier(model *m.AlertNotification) (alerting.Notifier, error)
- func NewSlackNotifier(model *m.AlertNotification) (alerting.Notifier, error)
- func NewTeamsNotifier(model *m.AlertNotification) (alerting.Notifier, error)
- func NewTelegramNotifier(model *m.AlertNotification) (alerting.Notifier, error)
- func NewThreemaNotifier(model *m.AlertNotification) (alerting.Notifier, error)
- func NewVictoropsNotifier(model *models.AlertNotification) (alerting.Notifier, error)
- func NewWebHookNotifier(model *m.AlertNotification) (alerting.Notifier, error)
- func SlackFileUpload(evalContext *alerting.EvalContext, log log.Logger, url string, ...) error
- type AlertmanagerNotifier
- type DingDingNotifier
- type DiscordNotifier
- type EmailNotifier
- type HipChatNotifier
- type KafkaNotifier
- type LineNotifier
- type NotifierBase
- func (n *NotifierBase) GetFrequency() time.Duration
- func (n *NotifierBase) GetIsDefault() bool
- func (n *NotifierBase) GetNotifierId() int64
- func (n *NotifierBase) GetSendReminder() bool
- func (n *NotifierBase) GetType() string
- func (n *NotifierBase) NeedsImage() bool
- func (n *NotifierBase) ShouldNotify(ctx context.Context, c *alerting.EvalContext) bool
- type OpsGenieNotifier
- type PagerdutyNotifier
- type PushoverNotifier
- type SensuNotifier
- type SlackNotifier
- type TeamsNotifier
- type TelegramNotifier
- type ThreemaNotifier
- type VictoropsNotifier
- type WebhookNotifier
Constants ¶
View Source
const AlertStateCritical = "CRITICAL"
AlertStateCritical - Victorops uses "CRITICAL" string to indicate "Alerting" state
View Source
const AlertStateRecovery = "RECOVERY"
View Source
const PUSHOVER_ENDPOINT = "https://api.pushover.net/1/messages.json"
Variables ¶
This section is empty.
Functions ¶
func GenerateSlackBody ¶
func NewAlertmanagerNotifier ¶
func NewAlertmanagerNotifier(model *m.AlertNotification) (alerting.Notifier, error)
func NewDingDingNotifier ¶
func NewDingDingNotifier(model *m.AlertNotification) (alerting.Notifier, error)
func NewDiscordNotifier ¶
func NewDiscordNotifier(model *m.AlertNotification) (alerting.Notifier, error)
func NewEmailNotifier ¶
func NewEmailNotifier(model *m.AlertNotification) (alerting.Notifier, error)
func NewHipChatNotifier ¶
func NewHipChatNotifier(model *models.AlertNotification) (alerting.Notifier, error)
func NewKafkaNotifier ¶
func NewKafkaNotifier(model *m.AlertNotification) (alerting.Notifier, error)
func NewLINENotifier ¶
func NewLINENotifier(model *m.AlertNotification) (alerting.Notifier, error)
func NewOpsGenieNotifier ¶
func NewOpsGenieNotifier(model *m.AlertNotification) (alerting.Notifier, error)
func NewPagerdutyNotifier ¶
func NewPagerdutyNotifier(model *m.AlertNotification) (alerting.Notifier, error)
func NewPushoverNotifier ¶
func NewPushoverNotifier(model *m.AlertNotification) (alerting.Notifier, error)
func NewSensuNotifier ¶
func NewSensuNotifier(model *m.AlertNotification) (alerting.Notifier, error)
func NewSlackNotifier ¶
func NewSlackNotifier(model *m.AlertNotification) (alerting.Notifier, error)
func NewTeamsNotifier ¶
func NewTeamsNotifier(model *m.AlertNotification) (alerting.Notifier, error)
func NewTelegramNotifier ¶
func NewTelegramNotifier(model *m.AlertNotification) (alerting.Notifier, error)
func NewThreemaNotifier ¶
func NewThreemaNotifier(model *m.AlertNotification) (alerting.Notifier, error)
func NewVictoropsNotifier ¶
func NewVictoropsNotifier(model *models.AlertNotification) (alerting.Notifier, error)
NewVictoropsNotifier creates an instance of VictoropsNotifier that handles posting notifications to Victorops REST API
func NewWebHookNotifier ¶
func NewWebHookNotifier(model *m.AlertNotification) (alerting.Notifier, error)
func SlackFileUpload ¶
Types ¶
type AlertmanagerNotifier ¶
type AlertmanagerNotifier struct { NotifierBase Url string // contains filtered or unexported fields }
func (*AlertmanagerNotifier) Notify ¶
func (this *AlertmanagerNotifier) Notify(evalContext *alerting.EvalContext) error
func (*AlertmanagerNotifier) ShouldNotify ¶
func (this *AlertmanagerNotifier) ShouldNotify(ctx context.Context, evalContext *alerting.EvalContext) bool
type DingDingNotifier ¶
type DingDingNotifier struct { NotifierBase Url string // contains filtered or unexported fields }
func (*DingDingNotifier) Notify ¶
func (this *DingDingNotifier) Notify(evalContext *alerting.EvalContext) error
type DiscordNotifier ¶
type DiscordNotifier struct { NotifierBase WebhookURL string // contains filtered or unexported fields }
func (*DiscordNotifier) Notify ¶
func (this *DiscordNotifier) Notify(evalContext *alerting.EvalContext) error
type EmailNotifier ¶
type EmailNotifier struct { NotifierBase Addresses []string // contains filtered or unexported fields }
func (*EmailNotifier) Notify ¶
func (this *EmailNotifier) Notify(evalContext *alerting.EvalContext) error
type HipChatNotifier ¶
type HipChatNotifier struct { NotifierBase Url string ApiKey string RoomId string // contains filtered or unexported fields }
func (*HipChatNotifier) Notify ¶
func (this *HipChatNotifier) Notify(evalContext *alerting.EvalContext) error
type KafkaNotifier ¶
type KafkaNotifier struct { NotifierBase Endpoint string Topic string // contains filtered or unexported fields }
func (*KafkaNotifier) Notify ¶
func (this *KafkaNotifier) Notify(evalContext *alerting.EvalContext) error
type LineNotifier ¶
type LineNotifier struct { NotifierBase Token string // contains filtered or unexported fields }
func (*LineNotifier) Notify ¶
func (this *LineNotifier) Notify(evalContext *alerting.EvalContext) error
type NotifierBase ¶
type NotifierBase struct { Name string Type string Id int64 IsDeault bool UploadImage bool SendReminder bool Frequency time.Duration // contains filtered or unexported fields }
func NewNotifierBase ¶
func NewNotifierBase(model *models.AlertNotification) NotifierBase
func (*NotifierBase) GetFrequency ¶
func (n *NotifierBase) GetFrequency() time.Duration
func (*NotifierBase) GetIsDefault ¶
func (n *NotifierBase) GetIsDefault() bool
func (*NotifierBase) GetNotifierId ¶
func (n *NotifierBase) GetNotifierId() int64
func (*NotifierBase) GetSendReminder ¶
func (n *NotifierBase) GetSendReminder() bool
func (*NotifierBase) GetType ¶
func (n *NotifierBase) GetType() string
func (*NotifierBase) NeedsImage ¶
func (n *NotifierBase) NeedsImage() bool
func (*NotifierBase) ShouldNotify ¶
func (n *NotifierBase) ShouldNotify(ctx context.Context, c *alerting.EvalContext) bool
ShouldNotify checks this evaluation should send an alert notification
type OpsGenieNotifier ¶
type OpsGenieNotifier struct { NotifierBase ApiKey string ApiUrl string AutoClose bool // contains filtered or unexported fields }
func (*OpsGenieNotifier) Notify ¶
func (this *OpsGenieNotifier) Notify(evalContext *alerting.EvalContext) error
type PagerdutyNotifier ¶
type PagerdutyNotifier struct { NotifierBase Key string AutoResolve bool // contains filtered or unexported fields }
func (*PagerdutyNotifier) Notify ¶
func (this *PagerdutyNotifier) Notify(evalContext *alerting.EvalContext) error
type PushoverNotifier ¶
type PushoverNotifier struct { NotifierBase UserKey string ApiToken string Priority int Retry int Expire int Device string Sound string // contains filtered or unexported fields }
func (*PushoverNotifier) Notify ¶
func (this *PushoverNotifier) Notify(evalContext *alerting.EvalContext) error
type SensuNotifier ¶
type SensuNotifier struct { NotifierBase Url string Source string User string Password string Handler string // contains filtered or unexported fields }
func (*SensuNotifier) Notify ¶
func (this *SensuNotifier) Notify(evalContext *alerting.EvalContext) error
type SlackNotifier ¶
type SlackNotifier struct { NotifierBase Url string Recipient string Mention string Token string Upload bool // contains filtered or unexported fields }
func (*SlackNotifier) Notify ¶
func (this *SlackNotifier) Notify(evalContext *alerting.EvalContext) error
type TeamsNotifier ¶
type TeamsNotifier struct { NotifierBase Url string // contains filtered or unexported fields }
func (*TeamsNotifier) Notify ¶
func (this *TeamsNotifier) Notify(evalContext *alerting.EvalContext) error
type TelegramNotifier ¶
type TelegramNotifier struct { NotifierBase BotToken string ChatID string UploadImage bool // contains filtered or unexported fields }
func (*TelegramNotifier) Notify ¶
func (this *TelegramNotifier) Notify(evalContext *alerting.EvalContext) error
type ThreemaNotifier ¶
type ThreemaNotifier struct { NotifierBase GatewayID string RecipientID string APISecret string // contains filtered or unexported fields }
func (*ThreemaNotifier) Notify ¶
func (notifier *ThreemaNotifier) Notify(evalContext *alerting.EvalContext) error
type VictoropsNotifier ¶
type VictoropsNotifier struct { NotifierBase URL string AutoResolve bool // contains filtered or unexported fields }
VictoropsNotifier defines URL property for Victorops REST API and handles notification process by formatting POST body according to Victorops specifications (http://victorops.force.com/knowledgebase/articles/Integration/Alert-Ingestion-API-Documentation/)
func (*VictoropsNotifier) Notify ¶
func (this *VictoropsNotifier) Notify(evalContext *alerting.EvalContext) error
Notify sends notification to Victorops via POST to URL endpoint
type WebhookNotifier ¶
type WebhookNotifier struct { NotifierBase Url string User string Password string HttpMethod string // contains filtered or unexported fields }
func (*WebhookNotifier) Notify ¶
func (this *WebhookNotifier) Notify(evalContext *alerting.EvalContext) error
Click to show internal directories.
Click to hide internal directories.