Documentation
¶
Index ¶
Constants ¶
const ( ModeTest = "test" ModeCLIGenPrometheus = "cli-gen-prom" ModeCLIGenKubernetes = "cli-gen-k8s" ModeCLIGenOpenSLO = "cli-gen-openslo" ModeControllerGenKubernetes = "ctrl-gen-k8s" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertSeverity ¶
type AlertSeverity int
AlertSeverity is the type of alert.
const ( UnknownAlertSeverity AlertSeverity = iota PageAlertSeverity TicketAlertSeverity )
func (AlertSeverity) String ¶
func (s AlertSeverity) String() string
type MWMBAlert ¶
type MWMBAlert struct {
ID string
ShortWindow time.Duration
LongWindow time.Duration
BurnRateFactor float64
ErrorBudget float64
Severity AlertSeverity
}
MWMBAlert represents a multiwindow, multi-burn rate alert.
type MWMBAlertGroup ¶
type MWMBAlertGroup struct {
PageQuick MWMBAlert
PageSlow MWMBAlert
TicketQuick MWMBAlert
TicketSlow MWMBAlert
}
MWMBAlertGroup what represents all the alerts of an SLO. ITs divided into two groups that are made of 2 alerts: - Page & quick: Critical alerts that trigger in high rate burn in short term. - Page & slow: Critical alerts that trigger in high-normal rate burn in medium term. - Ticket & slow: Warning alerts that trigger in normal rate burn in medium term. - Ticket & slow: Warning alerts that trigger in slow rate burn in long term.
func (MWMBAlertGroup) TimeDurationWindows ¶ added in v0.14.0
func (m MWMBAlertGroup) TimeDurationWindows() []time.Duration
TimeDurationWindows is a helper method to get the list of unique and sorted time durations windows of the alert group.
type PromAlertMeta ¶
type PromAlertMeta struct {
Disable bool
Name string
Labels map[string]string
Annotations map[string]string
}
AlertMeta is the metadata of an alert settings.
type PromRuleGroup ¶
PromRuleGroup are regular prometheus group of rules.
type PromSLI ¶
type PromSLI struct {
Raw *PromSLIRaw
Events *PromSLIEvents
}
SLI represents an SLI with custom error and total expressions.
type PromSLIEvents ¶
type PromSLIRaw ¶
type PromSLIRaw struct {
ErrorRatioQuery string
}
type PromSLO ¶
type PromSLO struct {
ID string
Name string
Description string
Service string
SLI PromSLI
TimeWindow time.Duration
Objective float64
Labels map[string]string
PageAlertMeta PromAlertMeta
TicketAlertMeta PromAlertMeta
Plugins SLOPlugins
}
PromSLO represents a service level objective configuration.
type PromSLOGroup ¶
type PromSLOGroup struct {
SLOs []PromSLO
OriginalSource PromSLOGroupSource
}
type PromSLOGroupSource ¶
type PromSLOGroupSource struct {
K8sSlothV1 *k8sprometheusv1.PrometheusServiceLevel
SlothV1 *prometheusv1.Spec
OpenSLOV1Alpha *openslov1alpha.SLO
}
Used to store the original source of the SLO group in case we need to make low-level decision based on where the SLOs came from.
type PromSLOPluginMetadata ¶
type PromSLORules ¶
type PromSLORules struct {
SLIErrorRecRules PromRuleGroup
MetadataRecRules PromRuleGroup
AlertRules PromRuleGroup
}
PromSLORules are the prometheus rules required by an SLO.
type SLOPlugins ¶
type SLOPlugins struct {
OverridePlugins bool // If true, the default, app and other declared plugins at other levels will be overridden by the ones declared in this struct.
Plugins []PromSLOPluginMetadata
}