proto

package
v0.13.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

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  `` /* 176-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) Descriptor() ([]byte, []int)

Deprecated: Use AlertConf.ProtoReflect.Descriptor instead.

func (*AlertConf) GetCondition

func (x *AlertConf) GetCondition() *Condition

func (*AlertConf) GetDashboardUrlTemplate

func (x *AlertConf) GetDashboardUrlTemplate() string

func (*AlertConf) GetDetailsTemplate

func (x *AlertConf) GetDetailsTemplate() string

func (*AlertConf) GetName

func (x *AlertConf) GetName() string

func (*AlertConf) GetNotify

func (x *AlertConf) GetNotify() *NotifyConfig

func (*AlertConf) GetOtherInfo

func (x *AlertConf) GetOtherInfo() map[string]string

func (*AlertConf) GetPlaybookUrlTemplate

func (x *AlertConf) GetPlaybookUrlTemplate() string

func (*AlertConf) GetRepeatIntervalSec

func (x *AlertConf) GetRepeatIntervalSec() int32

func (*AlertConf) GetSeverity

func (x *AlertConf) GetSeverity() AlertConf_Severity

func (*AlertConf) GetSummaryTemplate

func (x *AlertConf) GetSummaryTemplate() string

func (*AlertConf) ProtoMessage

func (*AlertConf) ProtoMessage()

func (*AlertConf) ProtoReflect

func (x *AlertConf) ProtoReflect() protoreflect.Message

func (*AlertConf) Reset

func (x *AlertConf) Reset()

func (*AlertConf) String

func (x *AlertConf) String() string

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) Enum

func (AlertConf_Severity) EnumDescriptor deprecated

func (AlertConf_Severity) EnumDescriptor() ([]byte, []int)

Deprecated: Use AlertConf_Severity.Descriptor instead.

func (AlertConf_Severity) Number

func (AlertConf_Severity) String

func (x AlertConf_Severity) String() string

func (AlertConf_Severity) Type

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) Descriptor() ([]byte, []int)

Deprecated: Use Condition.ProtoReflect.Descriptor instead.

func (*Condition) GetFailures

func (x *Condition) GetFailures() int32

func (*Condition) GetTotal

func (x *Condition) GetTotal() int32

func (*Condition) ProtoMessage

func (*Condition) ProtoMessage()

func (*Condition) ProtoReflect

func (x *Condition) ProtoReflect() protoreflect.Message

func (*Condition) Reset

func (x *Condition) Reset()

func (*Condition) String

func (x *Condition) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Email.ProtoReflect.Descriptor instead.

func (*Email) GetFrom

func (x *Email) GetFrom() string

func (*Email) GetSmtpPassword

func (x *Email) GetSmtpPassword() string

func (*Email) GetSmtpServer

func (x *Email) GetSmtpServer() string

func (*Email) GetSmtpUsername

func (x *Email) GetSmtpUsername() string

func (*Email) GetTo

func (x *Email) GetTo() []string

func (*Email) ProtoMessage

func (*Email) ProtoMessage()

func (*Email) ProtoReflect

func (x *Email) ProtoReflect() protoreflect.Message

func (*Email) Reset

func (x *Email) Reset()

func (*Email) String

func (x *Email) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Opsgenie.ProtoReflect.Descriptor instead.

func (*Opsgenie) GetApiKey

func (x *Opsgenie) GetApiKey() string

func (*Opsgenie) GetApiKeyEnvVar

func (x *Opsgenie) GetApiKeyEnvVar() string

func (*Opsgenie) GetApiUrl

func (x *Opsgenie) GetApiUrl() string

func (*Opsgenie) GetDisableSendResolved

func (x *Opsgenie) GetDisableSendResolved() bool

func (*Opsgenie) GetResponders

func (x *Opsgenie) GetResponders() []*Opsgenie_Responder

func (*Opsgenie) ProtoMessage

func (*Opsgenie) ProtoMessage()

func (*Opsgenie) ProtoReflect

func (x *Opsgenie) ProtoReflect() protoreflect.Message

func (*Opsgenie) Reset

func (x *Opsgenie) Reset()

func (*Opsgenie) String

func (x *Opsgenie) String() string

type Opsgenie_Responder

type Opsgenie_Responder struct {

	// Types that are assignable 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 (m *Opsgenie_Responder) GetRef() isOpsgenie_Responder_Ref

func (*Opsgenie_Responder) GetType

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) Enum

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 (Opsgenie_Responder_Type) String

func (x Opsgenie_Responder_Type) String() string

func (Opsgenie_Responder_Type) Type

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) Descriptor() ([]byte, []int)

Deprecated: Use PagerDuty.ProtoReflect.Descriptor instead.

func (*PagerDuty) GetApiUrl

func (x *PagerDuty) GetApiUrl() string

func (*PagerDuty) GetDisableSendResolved

func (x *PagerDuty) GetDisableSendResolved() bool

func (*PagerDuty) GetRoutingKey

func (x *PagerDuty) GetRoutingKey() string

func (*PagerDuty) GetRoutingKeyEnvVar

func (x *PagerDuty) GetRoutingKeyEnvVar() string

func (*PagerDuty) ProtoMessage

func (*PagerDuty) ProtoMessage()

func (*PagerDuty) ProtoReflect

func (x *PagerDuty) ProtoReflect() protoreflect.Message

func (*PagerDuty) Reset

func (x *PagerDuty) Reset()

func (*PagerDuty) String

func (x *PagerDuty) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Slack.ProtoReflect.Descriptor instead.

func (*Slack) GetWebhookUrl

func (x *Slack) GetWebhookUrl() string

func (*Slack) GetWebhookUrlEnvVar

func (x *Slack) GetWebhookUrlEnvVar() string

func (*Slack) ProtoMessage

func (*Slack) ProtoMessage()

func (*Slack) ProtoReflect

func (x *Slack) ProtoReflect() protoreflect.Message

func (*Slack) Reset

func (x *Slack) Reset()

func (*Slack) String

func (x *Slack) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL