model

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
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 Info

type Info struct {
	Version string
	Mode    Mode
	Spec    string
}

Info is the information of the app and request based for SLO generators.

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.

type Mode

type Mode string

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

type PromRuleGroup struct {
	Interval time.Duration
	Rules    []rulefmt.Rule
}

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 PromSLIEvents struct {
	ErrorQuery string
	TotalQuery string
}

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 PromSLOPluginMetadata struct {
	ID       string
	Config   any
	Priority int
}

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
}

Jump to

Keyboard shortcuts

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