Documentation
¶
Index ¶
- Variables
- type AlertConf
- func (*AlertConf) Descriptor() ([]byte, []int)deprecated
- func (x *AlertConf) GetCondition() *Condition
- func (x *AlertConf) GetDashboardUrlTemplate() string
- func (x *AlertConf) GetDetailsTemplate() string
- func (x *AlertConf) GetName() string
- func (x *AlertConf) GetNotify() *NotifyConfig
- func (x *AlertConf) GetOtherInfo() map[string]string
- func (x *AlertConf) GetPlaybookUrlTemplate() string
- func (x *AlertConf) GetRepeatIntervalSec() int32
- func (x *AlertConf) GetSeverity() AlertConf_Severity
- func (x *AlertConf) GetSummaryTemplate() string
- func (*AlertConf) ProtoMessage()
- func (x *AlertConf) ProtoReflect() protoreflect.Message
- func (x *AlertConf) Reset()
- func (x *AlertConf) String() string
- type AlertConf_Severity
- func (AlertConf_Severity) Descriptor() protoreflect.EnumDescriptor
- func (x AlertConf_Severity) Enum() *AlertConf_Severity
- func (AlertConf_Severity) EnumDescriptor() ([]byte, []int)deprecated
- func (x AlertConf_Severity) Number() protoreflect.EnumNumber
- func (x AlertConf_Severity) String() string
- func (AlertConf_Severity) Type() protoreflect.EnumType
- type Condition
- type Email
- func (*Email) Descriptor() ([]byte, []int)deprecated
- func (x *Email) GetFrom() string
- func (x *Email) GetSmtpPassword() string
- func (x *Email) GetSmtpServer() string
- func (x *Email) GetSmtpUsername() string
- func (x *Email) GetTo() []string
- func (*Email) ProtoMessage()
- func (x *Email) ProtoReflect() protoreflect.Message
- func (x *Email) Reset()
- func (x *Email) String() string
- type NotifyConfig
- func (*NotifyConfig) Descriptor() ([]byte, []int)deprecated
- func (x *NotifyConfig) GetCommand() string
- func (x *NotifyConfig) GetEmail() *Email
- func (x *NotifyConfig) GetHttpNotify() *proto.HTTPRequest
- func (x *NotifyConfig) GetOpsgenie() *Opsgenie
- func (x *NotifyConfig) GetPagerDuty() *PagerDuty
- func (x *NotifyConfig) GetSlack() *Slack
- func (*NotifyConfig) ProtoMessage()
- func (x *NotifyConfig) ProtoReflect() protoreflect.Message
- func (x *NotifyConfig) Reset()
- func (x *NotifyConfig) String() string
- type Opsgenie
- func (*Opsgenie) Descriptor() ([]byte, []int)deprecated
- func (x *Opsgenie) GetApiKey() string
- func (x *Opsgenie) GetApiKeyEnvVar() string
- func (x *Opsgenie) GetApiUrl() string
- func (x *Opsgenie) GetDisableSendResolved() bool
- func (x *Opsgenie) GetResponders() []*Opsgenie_Responder
- func (*Opsgenie) ProtoMessage()
- func (x *Opsgenie) ProtoReflect() protoreflect.Message
- func (x *Opsgenie) Reset()
- func (x *Opsgenie) String() string
- type Opsgenie_Responder
- func (*Opsgenie_Responder) Descriptor() ([]byte, []int)deprecated
- func (x *Opsgenie_Responder) GetId() string
- func (x *Opsgenie_Responder) GetName() string
- func (x *Opsgenie_Responder) GetRef() isOpsgenie_Responder_Ref
- func (x *Opsgenie_Responder) GetType() Opsgenie_Responder_Type
- func (*Opsgenie_Responder) ProtoMessage()
- func (x *Opsgenie_Responder) ProtoReflect() protoreflect.Message
- func (x *Opsgenie_Responder) Reset()
- func (x *Opsgenie_Responder) String() string
- type Opsgenie_Responder_Id
- type Opsgenie_Responder_Name
- type Opsgenie_Responder_Type
- func (Opsgenie_Responder_Type) Descriptor() protoreflect.EnumDescriptor
- func (x Opsgenie_Responder_Type) Enum() *Opsgenie_Responder_Type
- func (Opsgenie_Responder_Type) EnumDescriptor() ([]byte, []int)deprecated
- func (x Opsgenie_Responder_Type) Number() protoreflect.EnumNumber
- func (x Opsgenie_Responder_Type) String() string
- func (Opsgenie_Responder_Type) Type() protoreflect.EnumType
- type PagerDuty
- func (*PagerDuty) Descriptor() ([]byte, []int)deprecated
- func (x *PagerDuty) GetApiUrl() string
- func (x *PagerDuty) GetDisableSendResolved() bool
- func (x *PagerDuty) GetRoutingKey() string
- func (x *PagerDuty) GetRoutingKeyEnvVar() string
- func (*PagerDuty) ProtoMessage()
- func (x *PagerDuty) ProtoReflect() protoreflect.Message
- func (x *PagerDuty) Reset()
- func (x *PagerDuty) String() string
- type Slack
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Opsgenie_Responder_Type_name = map[int32]string{ 0: "UNKNOWN_RESPONDER", 1: "USER", 2: "TEAM", 3: "ESCALATION", 4: "SCHEDULE", } Opsgenie_Responder_Type_value = map[string]int32{ "UNKNOWN_RESPONDER": 0, "USER": 1, "TEAM": 2, "ESCALATION": 3, "SCHEDULE": 4, } )
Enum value maps for Opsgenie_Responder_Type.
View Source
var ( AlertConf_Severity_name = map[int32]string{ 0: "UNKNOWN_SEVERITY", 1: "CRITICAL", 2: "ERROR", 3: "WARNING", 4: "INFO", } AlertConf_Severity_value = map[string]int32{ "UNKNOWN_SEVERITY": 0, "CRITICAL": 1, "ERROR": 2, "WARNING": 3, "INFO": 4, } )
Enum value maps for AlertConf_Severity.
View Source
var File_github_com_cloudprober_cloudprober_internal_alerting_proto_config_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type AlertConf ¶
type AlertConf struct {
// Name of the alert. Default is to use the probe name. If you have multiple
// alerts for the same probe, you must specify a name for each alert.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Condition for the alert. Default is to alert on any failure.
// Example:
// # Alert if 6 out of 10 probes fail.
//
// condition {
// failures: 6
// total: 10
// }
Condition *Condition `protobuf:"bytes,2,opt,name=condition,proto3,oneof" json:"condition,omitempty"`
// How to notify in case of alert.
Notify *NotifyConfig `protobuf:"bytes,3,opt,name=notify,proto3" json:"notify,omitempty"`
// Dashboard URL template.
// Default: http://localhost:9313/status?probe=@probe@
DashboardUrlTemplate string `protobuf:"bytes,4,opt,name=dashboard_url_template,json=dashboardUrlTemplate,proto3" json:"dashboard_url_template,omitempty"` // Default: ""
PlaybookUrlTemplate string `protobuf:"bytes,5,opt,name=playbook_url_template,json=playbookUrlTemplate,proto3" json:"playbook_url_template,omitempty"` // Default: ""
// Default: Cloudprober alert "@alert@" for "@target@"
SummaryTemplate string `protobuf:"bytes,6,opt,name=summary_template,json=summaryTemplate,proto3" json:"summary_template,omitempty"`
// Default:
// Cloudprober alert "@alert@" for "@target@":
// Failures: @failures@ out of @total@ probes
// Failing since: @since@
// Probe: @probe@
// Dashboard: @dashboard_url@
// Playbook: @playbook_url@
DetailsTemplate string `protobuf:"bytes,7,opt,name=details_template,json=detailsTemplate,proto3" json:"details_template,omitempty"` // Default: ""
// Key values to be included in the alert. These fields are expanded
// using the same template expansion rules as summary_template and
// details_template (see above).
OtherInfo map[string]string `` /* 162-byte string literal not displayed */
Severity AlertConf_Severity `protobuf:"varint,10,opt,name=severity,proto3,enum=cloudprober.alerting.AlertConf_Severity" json:"severity,omitempty"`
// How often to repeat notification for the same alert. Default is 1hr.
// To disable any kind of notification throttling, set this to 0.
RepeatIntervalSec *int32 `protobuf:"varint,8,opt,name=repeat_interval_sec,json=repeatIntervalSec,proto3,oneof" json:"repeat_interval_sec,omitempty"` // Default: 1hr
// contains filtered or unexported fields
}
func (*AlertConf) Descriptor
deprecated
func (*AlertConf) GetCondition ¶
func (*AlertConf) GetDashboardUrlTemplate ¶
func (*AlertConf) GetDetailsTemplate ¶
func (*AlertConf) GetNotify ¶
func (x *AlertConf) GetNotify() *NotifyConfig
func (*AlertConf) GetOtherInfo ¶
func (*AlertConf) GetPlaybookUrlTemplate ¶
func (*AlertConf) GetRepeatIntervalSec ¶
func (*AlertConf) GetSeverity ¶
func (x *AlertConf) GetSeverity() AlertConf_Severity
func (*AlertConf) GetSummaryTemplate ¶
func (*AlertConf) ProtoMessage ¶
func (*AlertConf) ProtoMessage()
func (*AlertConf) ProtoReflect ¶
func (x *AlertConf) ProtoReflect() protoreflect.Message
type AlertConf_Severity ¶
type AlertConf_Severity int32
Severity of the alert. If provided it's included in the alert notifications. If severity is not defined, we set it to ERROR for PagerDuty notifications.
const ( AlertConf_UNKNOWN_SEVERITY AlertConf_Severity = 0 AlertConf_CRITICAL AlertConf_Severity = 1 AlertConf_ERROR AlertConf_Severity = 2 AlertConf_WARNING AlertConf_Severity = 3 AlertConf_INFO AlertConf_Severity = 4 )
func (AlertConf_Severity) Descriptor ¶
func (AlertConf_Severity) Descriptor() protoreflect.EnumDescriptor
func (AlertConf_Severity) Enum ¶
func (x AlertConf_Severity) Enum() *AlertConf_Severity
func (AlertConf_Severity) EnumDescriptor
deprecated
func (AlertConf_Severity) EnumDescriptor() ([]byte, []int)
Deprecated: Use AlertConf_Severity.Descriptor instead.
func (AlertConf_Severity) Number ¶
func (x AlertConf_Severity) Number() protoreflect.EnumNumber
func (AlertConf_Severity) String ¶
func (x AlertConf_Severity) String() string
func (AlertConf_Severity) Type ¶
func (AlertConf_Severity) Type() protoreflect.EnumType
type Condition ¶
type Condition struct {
Failures int32 `protobuf:"varint,1,opt,name=failures,proto3" json:"failures,omitempty"`
Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"`
// contains filtered or unexported fields
}
func (*Condition) Descriptor
deprecated
func (*Condition) GetFailures ¶
func (*Condition) ProtoMessage ¶
func (*Condition) ProtoMessage()
func (*Condition) ProtoReflect ¶
func (x *Condition) ProtoReflect() protoreflect.Message
type Email ¶
type Email struct {
// Email addresses to send the alert to.
To []string `protobuf:"bytes,1,rep,name=to,proto3" json:"to,omitempty"`
// From address in the alert email.
// If not set, defaults to the value of smtp_user if smtp_user is set,
// otherwise defaults to cloudprober-alert@<hostname>.
From string `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"`
// Default: Environment variable SMTP_SERVER
SmtpServer string `protobuf:"bytes,3,opt,name=smtp_server,json=smtpServer,proto3" json:"smtp_server,omitempty"`
// Default: Environment variable SMTP_USERNAME
SmtpUsername string `protobuf:"bytes,4,opt,name=smtp_username,json=smtpUsername,proto3" json:"smtp_username,omitempty"`
// Default: Environment variable SMTP_PASSWORD
SmtpPassword string `protobuf:"bytes,5,opt,name=smtp_password,json=smtpPassword,proto3" json:"smtp_password,omitempty"`
// contains filtered or unexported fields
}
func (*Email) Descriptor
deprecated
func (*Email) GetSmtpPassword ¶
func (*Email) GetSmtpServer ¶
func (*Email) GetSmtpUsername ¶
func (*Email) ProtoMessage ¶
func (*Email) ProtoMessage()
func (*Email) ProtoReflect ¶
func (x *Email) ProtoReflect() protoreflect.Message
type NotifyConfig ¶
type NotifyConfig struct {
// Command to run when alert is fired. You can use this command to do
// various things, e.g.:
// - Send a notification using a method not supported by Cloudprober.
// - Collect more information, e.g. send mtr report on ping failures.
// - Attempt fix the issue, e.g. restart a pod or clear cache.
//
// In the command line following fields are substituted:
//
// @alert@: Alert name
// @probe@: Probe name
// @target@: Target name, or target and port if port is specified.
// @target.label.<label>@: Label <label> value, e.g. target.label.role.
// @failures@: Count of failures.
// @total@: Out of.
// @since@: Time since the alert condition started.
// @json@: JSON representation of the alert fields.
//
// For example, if you want to send an email when an alert is fired, you can
// use the following command:
// command: "/usr/bin/mail -s 'Alert @alert@ fired for @target@' manu@a.b"
Command string `protobuf:"bytes,10,opt,name=command,proto3" json:"command,omitempty"`
// Email notification configuration.
Email *Email `protobuf:"bytes,11,opt,name=email,proto3" json:"email,omitempty"`
// PagerDuty configuration.
PagerDuty *PagerDuty `protobuf:"bytes,12,opt,name=pager_duty,json=pagerDuty,proto3" json:"pager_duty,omitempty"`
// Slack configuration.
Slack *Slack `protobuf:"bytes,13,opt,name=slack,proto3" json:"slack,omitempty"`
// Opsgenie configuration.
Opsgenie *Opsgenie `protobuf:"bytes,14,opt,name=opsgenie,proto3" json:"opsgenie,omitempty"`
// Notify using an HTTP request. HTTP request fields are expanded using the
// same template expansion rules as "command" above:
// For example, to send a notification using rest API:
//
// http_notify {
// url: "http://localhost:8080/alert"
// method: POST
// header {
// key: "Authorization"
// value: "Bearer {{env 'AUTH_TOKEN'}}"
// }
// data: "{\"message\": \"@alert@ fired for @target@\", \"details\": \"name\"}"
// }
HttpNotify *proto.HTTPRequest `protobuf:"bytes,3,opt,name=http_notify,json=httpNotify,proto3" json:"http_notify,omitempty"`
// contains filtered or unexported fields
}
func (*NotifyConfig) Descriptor
deprecated
func (*NotifyConfig) Descriptor() ([]byte, []int)
Deprecated: Use NotifyConfig.ProtoReflect.Descriptor instead.
func (*NotifyConfig) GetCommand ¶
func (x *NotifyConfig) GetCommand() string
func (*NotifyConfig) GetEmail ¶
func (x *NotifyConfig) GetEmail() *Email
func (*NotifyConfig) GetHttpNotify ¶
func (x *NotifyConfig) GetHttpNotify() *proto.HTTPRequest
func (*NotifyConfig) GetOpsgenie ¶
func (x *NotifyConfig) GetOpsgenie() *Opsgenie
func (*NotifyConfig) GetPagerDuty ¶
func (x *NotifyConfig) GetPagerDuty() *PagerDuty
func (*NotifyConfig) GetSlack ¶
func (x *NotifyConfig) GetSlack() *Slack
func (*NotifyConfig) ProtoMessage ¶
func (*NotifyConfig) ProtoMessage()
func (*NotifyConfig) ProtoReflect ¶
func (x *NotifyConfig) ProtoReflect() protoreflect.Message
func (*NotifyConfig) Reset ¶
func (x *NotifyConfig) Reset()
func (*NotifyConfig) String ¶
func (x *NotifyConfig) String() string
type Opsgenie ¶
type Opsgenie struct {
// API key to access Opsgenie. It's usually tied to a team and is
// obtained by creating a new API integration or using an existing one.
ApiKey string `protobuf:"bytes,1,opt,name=api_key,json=apiKey,proto3" json:"api_key,omitempty"`
// Environment variable name Default: OPSGENIE_API_KEY
ApiKeyEnvVar string `protobuf:"bytes,2,opt,name=api_key_env_var,json=apiKeyEnvVar,proto3" json:"api_key_env_var,omitempty"`
// Opsgenie responders. Opsgenie uses the responders to route the alerts if
// API key doesn't belong to a team integration.
// Example:
//
// responders {
// id: "4513b7ea-3b91-438f-b7e4-e3e54af9147c"
// type: TEAM
// }
Responders []*Opsgenie_Responder `protobuf:"bytes,3,rep,name=responders,proto3" json:"responders,omitempty"`
// Opsgenie API URL.
// Default: https://api.opsgenie.com/v2/alerts
ApiUrl string `protobuf:"bytes,4,opt,name=api_url,json=apiUrl,proto3" json:"api_url,omitempty"`
// Whether to send resolve notifications or not. Default is to send resolve
// notifications.
DisableSendResolved bool `protobuf:"varint,5,opt,name=disable_send_resolved,json=disableSendResolved,proto3" json:"disable_send_resolved,omitempty"` // Default: false
// contains filtered or unexported fields
}
func (*Opsgenie) Descriptor
deprecated
func (*Opsgenie) GetApiKeyEnvVar ¶
func (*Opsgenie) GetDisableSendResolved ¶
func (*Opsgenie) GetResponders ¶
func (x *Opsgenie) GetResponders() []*Opsgenie_Responder
func (*Opsgenie) ProtoMessage ¶
func (*Opsgenie) ProtoMessage()
func (*Opsgenie) ProtoReflect ¶
func (x *Opsgenie) ProtoReflect() protoreflect.Message
type Opsgenie_Responder ¶
type Opsgenie_Responder struct {
// Types that are valid to be assigned to Ref:
//
// *Opsgenie_Responder_Id
// *Opsgenie_Responder_Name
Ref isOpsgenie_Responder_Ref `protobuf_oneof:"ref"`
Type Opsgenie_Responder_Type `protobuf:"varint,3,opt,name=type,proto3,enum=cloudprober.alerting.Opsgenie_Responder_Type" json:"type,omitempty"`
// contains filtered or unexported fields
}
func (*Opsgenie_Responder) Descriptor
deprecated
func (*Opsgenie_Responder) Descriptor() ([]byte, []int)
Deprecated: Use Opsgenie_Responder.ProtoReflect.Descriptor instead.
func (*Opsgenie_Responder) GetId ¶
func (x *Opsgenie_Responder) GetId() string
func (*Opsgenie_Responder) GetName ¶
func (x *Opsgenie_Responder) GetName() string
func (*Opsgenie_Responder) GetRef ¶
func (x *Opsgenie_Responder) GetRef() isOpsgenie_Responder_Ref
func (*Opsgenie_Responder) GetType ¶
func (x *Opsgenie_Responder) GetType() Opsgenie_Responder_Type
func (*Opsgenie_Responder) ProtoMessage ¶
func (*Opsgenie_Responder) ProtoMessage()
func (*Opsgenie_Responder) ProtoReflect ¶
func (x *Opsgenie_Responder) ProtoReflect() protoreflect.Message
func (*Opsgenie_Responder) Reset ¶
func (x *Opsgenie_Responder) Reset()
func (*Opsgenie_Responder) String ¶
func (x *Opsgenie_Responder) String() string
type Opsgenie_Responder_Id ¶
type Opsgenie_Responder_Id struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3,oneof"`
}
type Opsgenie_Responder_Name ¶
type Opsgenie_Responder_Name struct {
Name string `protobuf:"bytes,2,opt,name=name,proto3,oneof"`
}
type Opsgenie_Responder_Type ¶
type Opsgenie_Responder_Type int32
const ( Opsgenie_Responder_UNKNOWN_RESPONDER Opsgenie_Responder_Type = 0 Opsgenie_Responder_USER Opsgenie_Responder_Type = 1 Opsgenie_Responder_TEAM Opsgenie_Responder_Type = 2 Opsgenie_Responder_ESCALATION Opsgenie_Responder_Type = 3 Opsgenie_Responder_SCHEDULE Opsgenie_Responder_Type = 4 )
func (Opsgenie_Responder_Type) Descriptor ¶
func (Opsgenie_Responder_Type) Descriptor() protoreflect.EnumDescriptor
func (Opsgenie_Responder_Type) Enum ¶
func (x Opsgenie_Responder_Type) Enum() *Opsgenie_Responder_Type
func (Opsgenie_Responder_Type) EnumDescriptor
deprecated
func (Opsgenie_Responder_Type) EnumDescriptor() ([]byte, []int)
Deprecated: Use Opsgenie_Responder_Type.Descriptor instead.
func (Opsgenie_Responder_Type) Number ¶
func (x Opsgenie_Responder_Type) Number() protoreflect.EnumNumber
func (Opsgenie_Responder_Type) String ¶
func (x Opsgenie_Responder_Type) String() string
func (Opsgenie_Responder_Type) Type ¶
func (Opsgenie_Responder_Type) Type() protoreflect.EnumType
type PagerDuty ¶
type PagerDuty struct {
// PagerDuty Routing Key.
// The routing key is used to authenticate to PagerDuty and is tied to a
// service. You can obtain the routing key from the service page, under the
// integrations tab.
// Note: set either routing_key or routing_key_env_var. routing_key
// takes precedence over routing_key_env_var.
RoutingKey string `protobuf:"bytes,1,opt,name=routing_key,json=routingKey,proto3" json:"routing_key,omitempty"`
// The environment variable containing the pagerduty routing key.
// Default: PAGERDUTY_ROUTING_KEY;
RoutingKeyEnvVar string `protobuf:"bytes,2,opt,name=routing_key_env_var,json=routingKeyEnvVar,proto3" json:"routing_key_env_var,omitempty"`
// PagerDuty API URL.
// Used to overwrite the default PagerDuty API URL.
ApiUrl string `protobuf:"bytes,3,opt,name=api_url,json=apiUrl,proto3" json:"api_url,omitempty"` // Default: https://event.pagerduty.com
// Whether to send resolve notifications or not. Default is to send resolve
// notifications.
DisableSendResolved bool `protobuf:"varint,4,opt,name=disable_send_resolved,json=disableSendResolved,proto3" json:"disable_send_resolved,omitempty"` // Default: false
// contains filtered or unexported fields
}
func (*PagerDuty) Descriptor
deprecated
func (*PagerDuty) GetDisableSendResolved ¶
func (*PagerDuty) GetRoutingKey ¶
func (*PagerDuty) GetRoutingKeyEnvVar ¶
func (*PagerDuty) ProtoMessage ¶
func (*PagerDuty) ProtoMessage()
func (*PagerDuty) ProtoReflect ¶
func (x *PagerDuty) ProtoReflect() protoreflect.Message
type Slack ¶
type Slack struct {
// Webhook URL
// The Slack notifications use a webhook URL to send the notifications to
// a Slack channel. The webhook URL can be found in the Slack console under
// the "Incoming Webhooks" section.
// https://api.slack.com/messaging/webhooks
// Note: set either webhook_url or webhook_url_env_var. webhook_url
// takes precedence over webhook_url_env_var.
WebhookUrl string `protobuf:"bytes,1,opt,name=webhook_url,json=webhookUrl,proto3" json:"webhook_url,omitempty"`
// The environment variable that is used to contain the slack webhook URL.
WebhookUrlEnvVar string `protobuf:"bytes,2,opt,name=webhook_url_env_var,json=webhookUrlEnvVar,proto3" json:"webhook_url_env_var,omitempty"` // Default: SLACK_WEBHOOK_URL;
// contains filtered or unexported fields
}
func (*Slack) Descriptor
deprecated
func (*Slack) GetWebhookUrl ¶
func (*Slack) GetWebhookUrlEnvVar ¶
func (*Slack) ProtoMessage ¶
func (*Slack) ProtoMessage()
func (*Slack) ProtoReflect ¶
func (x *Slack) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.