config

package
v0.0.0-...-6081c8a Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidType = fmt.Errorf("invalid type")
)

Functions

func Defaults

func Defaults(in interface{}) error

func Factory

func Factory() interface{}

func LoadSatellite

func LoadSatellite(config string, strict bool) (cfg interface{}, err error)

func Marshal

func Marshal(cfg interface{}) ([]byte, error)

func NewDefaultConfig

func NewDefaultConfig() (interface{}, error)

NewDefaultConfig returns a new instance of the current config struct, with all defaults filled in.

Types

type Alerting

type Alerting struct {
	PagerDutyRoutingKey string              `json:"pagerdutyRoutingKey,omitempty"`
	SlackOAuthToken     string              `json:"slackOAuthToken"`
	GenericSlackChannel string              `json:"genericSlackChannel"`
	TeamRoutes          []TeamAlertingRoute `json:"teamRoutes,omitempty"`
}

type AlertmanagerConfig

type AlertmanagerConfig struct {
	Global            *GlobalConfig       `yaml:"global,omitempty" json:"global,omitempty"`
	Route             *Route              `yaml:"route,omitempty" json:"route,omitempty"`
	InhibitRules      []*InhibitRule      `yaml:"inhibit_rules,omitempty" json:"inhibit_rules,omitempty"`
	Receivers         []*Receiver         `yaml:"receivers,omitempty" json:"receivers,omitempty"`
	MuteTimeIntervals []*muteTimeInterval `yaml:"mute_time_intervals,omitempty" json:"mute_time_intervals,omitempty"`
	Templates         []string            `yaml:"templates" json:"templates"`
}

Customization of Config type from alertmanager repo: https://github.com/prometheus/alertmanager/blob/main/config/config.go

Custom global type to get around obfuscation of secret values when marshalling. See the following issue for details: https://github.com/prometheus/alertmanager/issues/1985

func (AlertmanagerConfig) String

func (ac AlertmanagerConfig) String() string

type Authorization

type Authorization struct {
	Type            string `yaml:"type,omitempty"`
	Credentials     string `yaml:"credentials,omitempty"`
	CredentialsFile string `yaml:"credentials_file,omitempty"`
}

type Certmanager

type Certmanager struct {
	InstallServiceMonitors bool   `json:"installServiceMonitors"`
	Namespace              string `json:"namespace,omitempty"`
}

type Config

type Config struct {
	Namespace    string              `json:"namespace"`
	Tracing      *Tracing            `json:"tracing,omitempty"`
	Alerting     *Alerting           `json:"alerting,omitempty"`
	NodeSelector map[string]string   `json:"nodeSelector,omitempty"`
	Tolerations  []corev1.Toleration `json:"tolerations,omitempty"`
	Prometheus   *Prometheus         `json:"prometheus,omitempty"`
	Pyrra        *Pyrra              `json:"pyrra,omitempty"`
	Prober       *Prober             `json:"prober,omitempty"`
	Werft        *Werft              `json:"werft,omitempty"`
	Gitpod       *Gitpod             `json:"gitpod,omitempty"`
	Grafana      *Grafana            `json:"grafana,omitempty"`
	Certmanager  *Certmanager        `json:"certmanager,omitempty"`
	Imports      *Imports            `json:"imports,omitempty"`
}

Config defines the structure of the observability config file

type Gitpod

type Gitpod struct {
	InstallServiceMonitors bool `json:"installServiceMonitors"`
}

type GlobalConfig

type GlobalConfig struct {
	// ResolveTimeout is the time after which an alert is declared resolved
	// if it has not been updated.
	ResolveTimeout *model.Duration `yaml:"resolve_timeout,omitempty" json:"resolve_timeout,omitempty"`

	HTTPConfig *HTTPClientConfig `yaml:"http_config,omitempty" json:"http_config,omitempty"`

	SMTPFrom           string          `yaml:"smtp_from,omitempty" json:"smtp_from,omitempty"`
	SMTPHello          string          `yaml:"smtp_hello,omitempty" json:"smtp_hello,omitempty"`
	SMTPSmarthost      config.HostPort `yaml:"smtp_smarthost,omitempty" json:"smtp_smarthost,omitempty"`
	SMTPAuthUsername   string          `yaml:"smtp_auth_username,omitempty" json:"smtp_auth_username,omitempty"`
	SMTPAuthPassword   string          `yaml:"smtp_auth_password,omitempty" json:"smtp_auth_password,omitempty"`
	SMTPAuthSecret     string          `yaml:"smtp_auth_secret,omitempty" json:"smtp_auth_secret,omitempty"`
	SMTPAuthIdentity   string          `yaml:"smtp_auth_identity,omitempty" json:"smtp_auth_identity,omitempty"`
	SMTPRequireTLS     *bool           `yaml:"smtp_require_tls,omitempty" json:"smtp_require_tls,omitempty"`
	SlackAPIURL        *config.URL     `yaml:"slack_api_url,omitempty" json:"slack_api_url,omitempty"`
	SlackAPIURLFile    string          `yaml:"slack_api_url_file,omitempty" json:"slack_api_url_file,omitempty"`
	PagerdutyURL       *config.URL     `yaml:"pagerduty_url,omitempty" json:"pagerduty_url,omitempty"`
	HipchatAPIURL      *config.URL     `yaml:"hipchat_api_url,omitempty" json:"hipchat_api_url,omitempty"`
	HipchatAuthToken   string          `yaml:"hipchat_auth_token,omitempty" json:"hipchat_auth_token,omitempty"`
	OpsGenieAPIURL     *config.URL     `yaml:"opsgenie_api_url,omitempty" json:"opsgenie_api_url,omitempty"`
	OpsGenieAPIKey     string          `yaml:"opsgenie_api_key,omitempty" json:"opsgenie_api_key,omitempty"`
	OpsGenieAPIKeyFile string          `yaml:"opsgenie_api_key_file,omitempty" json:"opsgenie_api_key_file,omitempty"`
	WeChatAPIURL       *config.URL     `yaml:"wechat_api_url,omitempty" json:"wechat_api_url,omitempty"`
	WeChatAPISecret    string          `yaml:"wechat_api_secret,omitempty" json:"wechat_api_secret,omitempty"`
	WeChatAPICorpID    string          `yaml:"wechat_api_corp_id,omitempty" json:"wechat_api_corp_id,omitempty"`
	VictorOpsAPIURL    *config.URL     `yaml:"victorops_api_url,omitempty" json:"victorops_api_url,omitempty"`
	VictorOpsAPIKey    string          `yaml:"victorops_api_key,omitempty" json:"victorops_api_key,omitempty"`
	TelegramAPIURL     *config.URL     `yaml:"telegram_api_url,omitempty" json:"telegram_api_url,omitempty"`
}

type GoogleIAPBasedIngress

type GoogleIAPBasedIngress struct {
	DNS                  string
	GCPExternalIPAddress string
	IAPClientID          string
	IAPClientSecret      string
}

type Grafana

type Grafana struct {
	Install bool `json:"install"`
}

type HTTPClientConfig

type HTTPClientConfig struct {
	Authorization   *Authorization `yaml:"authorization,omitempty"`
	BasicAuth       *basicAuth     `yaml:"basic_auth,omitempty"`
	OAuth2          *oauth2        `yaml:"oauth2,omitempty"`
	BearerToken     string         `yaml:"bearer_token,omitempty"`
	BearerTokenFile string         `yaml:"bearer_token_file,omitempty"`
	ProxyURL        string         `yaml:"proxy_url,omitempty"`
	TLSConfig       tlsConfig      `yaml:"tls_config,omitempty"`
	FollowRedirects *bool          `yaml:"follow_redirects,omitempty"`
}

type Imports

type Imports struct {
	YAML      []importer.YAMLImporter      `json:"yaml,omitempty"`
	Kustomize []importer.KustomizeImporter `json:"kustomize,omitempty"`
}

type InhibitRule

type InhibitRule struct {
	TargetMatch    map[string]string `yaml:"target_match,omitempty" json:"target_match,omitempty"`
	TargetMatchRE  map[string]string `yaml:"target_match_re,omitempty" json:"target_match_re,omitempty"`
	TargetMatchers []string          `yaml:"target_matchers,omitempty" json:"target_matchers,omitempty"`
	SourceMatch    map[string]string `yaml:"source_match,omitempty" json:"source_match,omitempty"`
	SourceMatchRE  map[string]string `yaml:"source_match_re,omitempty" json:"source_match_re,omitempty"`
	SourceMatchers []string          `yaml:"source_matchers,omitempty" json:"source_matchers,omitempty"`
	Equal          []string          `yaml:"equal,omitempty" json:"equal,omitempty"`
}

type PagerdutyConfig

type PagerdutyConfig struct {
	VSendResolved *bool             `yaml:"send_resolved,omitempty" json:"send_resolved,omitempty"`
	HTTPConfig    *HTTPClientConfig `yaml:"http_config,omitempty" json:"http_config,omitempty"`
	ServiceKey    string            `yaml:"service_key,omitempty" json:"service_key,omitempty"`
	RoutingKey    string            `yaml:"routing_key,omitempty" json:"routing_key,omitempty"`
	URL           string            `yaml:"url,omitempty" json:"url,omitempty"`
	Client        string            `yaml:"client,omitempty" json:"client,omitempty"`
	ClientURL     string            `yaml:"client_url,omitempty" json:"client_url,omitempty"`
	Description   string            `yaml:"description,omitempty" json:"description,omitempty"`
	Details       map[string]string `yaml:"details,omitempty" json:"details,omitempty"`
	Images        []pagerdutyImage  `yaml:"images,omitempty" json:"images,omitempty"`
	Links         []PagerdutyLink   `yaml:"links,omitempty" json:"links,omitempty"`
	Severity      string            `yaml:"severity,omitempty" json:"severity,omitempty"`
	Class         string            `yaml:"class,omitempty" json:"class,omitempty"`
	Component     string            `yaml:"component,omitempty" json:"component,omitempty"`
	Group         string            `yaml:"group,omitempty" json:"group,omitempty"`
}
type PagerdutyLink struct {
	Href string `yaml:"href,omitempty" json:"href,omitempty"`
	Text string `yaml:"text,omitempty" json:"text,omitempty"`
}

type Prober

type Prober struct {
	Install bool `json:"install"`
}

type Prometheus

type Prometheus struct {
	ExternalLabels map[string]string           `json:"externalLabels,omitempty"`
	EnableFeatures []string                    `json:"enableFeatures,omitempty"`
	MetricsToDrop  []string                    `json:"metricsToDrop,omitempty"`
	Ingress        *GoogleIAPBasedIngress      `json:"ingress,omitempty"`
	Resources      corev1.ResourceRequirements `json:"resources,omitempty"`
	RemoteWrite    []*RemoteWrite              `json:"remoteWrite,omitempty"`
}

type Pyrra

type Pyrra struct {
	Install bool                   `json:"install"`
	Ingress *GoogleIAPBasedIngress `json:"ingress,omitempty"`
}

type Receiver

type Receiver struct {
	Name             string             `yaml:"name" json:"name"`
	OpsgenieConfigs  []*opsgenieConfig  `yaml:"opsgenie_configs,omitempty" json:"opsgenie_configs,omitempty"`
	PagerdutyConfigs []*PagerdutyConfig `yaml:"pagerduty_configs,omitempty" json:"pagerduty_configs,omitempty"`
	SlackConfigs     []*SlackConfig     `yaml:"slack_configs,omitempty" json:"slack_configs,omitempty"`
	WebhookConfigs   []*webhookConfig   `yaml:"webhook_configs,omitempty" json:"webhook_configs,omitempty"`
	WeChatConfigs    []*weChatConfig    `yaml:"wechat_configs,omitempty" json:"wechat_config,omitempty"`
	EmailConfigs     []*emailConfig     `yaml:"email_configs,omitempty" json:"email_configs,omitempty"`
	PushoverConfigs  []*pushoverConfig  `yaml:"pushover_configs,omitempty" json:"pushover_configs,omitempty"`
	VictorOpsConfigs []*victorOpsConfig `yaml:"victorops_configs,omitempty" json:"victorops_configs,omitempty"`
	SNSConfigs       []*snsConfig       `yaml:"sns_configs,omitempty" json:"sns_configs,omitempty"`
	TelegramConfigs  []*telegramConfig  `yaml:"telegram_configs,omitempty" json:"telegram_configs,omitempty"`
}

type RemoteWrite

type RemoteWrite struct {
	monitoringv1.RemoteWriteSpec
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
}

type Route

type Route struct {
	Receiver          string            `yaml:"receiver,omitempty" json:"receiver,omitempty"`
	GroupByStr        []string          `yaml:"group_by,omitempty" json:"group_by,omitempty"`
	Match             map[string]string `yaml:"match,omitempty" json:"match,omitempty"`
	MatchRE           map[string]string `yaml:"match_re,omitempty" json:"match_re,omitempty"`
	Matchers          []string          `yaml:"matchers,omitempty" json:"matchers,omitempty"`
	Continue          bool              `yaml:"continue,omitempty" json:"continue,omitempty"`
	Routes            []*Route          `yaml:"routes,omitempty" json:"routes,omitempty"`
	GroupWait         string            `yaml:"group_wait,omitempty" json:"group_wait,omitempty"`
	GroupInterval     string            `yaml:"group_interval,omitempty" json:"group_interval,omitempty"`
	RepeatInterval    string            `yaml:"repeat_interval,omitempty" json:"repeat_interval,omitempty"`
	MuteTimeIntervals []string          `yaml:"mute_time_intervals,omitempty" json:"mute_time_intervals,omitempty"`
}

type SlackAction

type SlackAction struct {
	Type         string                  `yaml:"type,omitempty"  json:"type,omitempty"`
	Text         string                  `yaml:"text,omitempty"  json:"text,omitempty"`
	URL          string                  `yaml:"url,omitempty"   json:"url,omitempty"`
	Style        string                  `yaml:"style,omitempty" json:"style,omitempty"`
	Name         string                  `yaml:"name,omitempty"  json:"name,omitempty"`
	Value        string                  `yaml:"value,omitempty"  json:"value,omitempty"`
	ConfirmField *slackConfirmationField `yaml:"confirm,omitempty"  json:"confirm,omitempty"`
}

type SlackConfig

type SlackConfig struct {
	VSendResolved *bool             `yaml:"send_resolved,omitempty" json:"send_resolved,omitempty"`
	HTTPConfig    *HTTPClientConfig `yaml:"http_config,omitempty" json:"http_config,omitempty"`
	APIURL        string            `yaml:"api_url,omitempty" json:"api_url,omitempty"`
	APIURLFile    string            `yaml:"api_url_file,omitempty" json:"api_url_file,omitempty"`
	Channel       string            `yaml:"channel,omitempty" json:"channel,omitempty"`
	Username      string            `yaml:"username,omitempty" json:"username,omitempty"`
	Color         string            `yaml:"color,omitempty" json:"color,omitempty"`
	Title         string            `yaml:"title,omitempty" json:"title,omitempty"`
	TitleLink     string            `yaml:"title_link,omitempty" json:"title_link,omitempty"`
	Pretext       string            `yaml:"pretext,omitempty" json:"pretext,omitempty"`
	Text          string            `yaml:"text,omitempty" json:"text,omitempty"`
	Fields        []slackField      `yaml:"fields,omitempty" json:"fields,omitempty"`
	ShortFields   bool              `yaml:"short_fields,omitempty" json:"short_fields,omitempty"`
	Footer        string            `yaml:"footer,omitempty" json:"footer,omitempty"`
	Fallback      string            `yaml:"fallback,omitempty" json:"fallback,omitempty"`
	CallbackID    string            `yaml:"callback_id,omitempty" json:"callback_id,omitempty"`
	IconEmoji     string            `yaml:"icon_emoji,omitempty" json:"icon_emoji,omitempty"`
	IconURL       string            `yaml:"icon_url,omitempty" json:"icon_url,omitempty"`
	ImageURL      string            `yaml:"image_url,omitempty" json:"image_url,omitempty"`
	ThumbURL      string            `yaml:"thumb_url,omitempty" json:"thumb_url,omitempty"`
	LinkNames     bool              `yaml:"link_names,omitempty" json:"link_names,omitempty"`
	MrkdwnIn      []string          `yaml:"mrkdwn_in,omitempty" json:"mrkdwn_in,omitempty"`
	Actions       []SlackAction     `yaml:"actions,omitempty" json:"actions,omitempty"`
}

type TeamAlertingRoute

type TeamAlertingRoute struct {
	TeamLabel    string `json:"teamLabel,omitempty"`
	SlackChannel string `json:"slackChannel,omitempty"`
}

type Tracing

type Tracing struct {
	Install             bool              `json:"install"`
	HoneycombAPIKey     string            `json:"honeycombAPIKey,omitempty"`
	HoneycombDataset    string            `json:"honeycombDataset,omitempty"`
	TempoBasicUser      string            `json:"tempoBasicUser,omitempty"`
	TempoBasicPassword  string            `json:"tempoBasicPassword,omitempty"`
	ExtraSpanAttributes map[string]string `json:"extraSpanAttributes,omitempty"`
}

type Werft

type Werft struct {
	InstallServiceMonitors bool `json:"installServiceMonitors"`
}

Jump to

Keyboard shortcuts

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