slo

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Class added in v0.1.8

type Class struct {
	Name       string     `yaml:"name"`
	Objectives Objectives `yaml:"objectives"`
}

Class represents a template of objectives this is important to achieve scalable SLO policies read more at: https://landing.google.com/sre/workbook/chapters/alerting-on-slos/#alerting_at_scale

type Classes added in v0.3.0

type Classes []Class

func (Classes) FindClass added in v0.3.0

func (c Classes) FindClass(name string) (*Class, error)

FindClass finds for a given name, if not found return an error

type ClassesDefinition added in v0.1.8

type ClassesDefinition struct {
	Classes Classes `yaml:"classes"`
}

type ExprBlock

type ExprBlock struct {
	AlertMethod string           `yaml:"alertMethod"`
	AlertWindow string           `yaml:"alertWindow"`
	BurnRate    float64          `yaml:"burnRate"`
	AlertWait   string           `yaml:"alertWait"`
	Windows     []methods.Window `yaml:"windows"`
	ShortWindow *bool            `yaml:"shortWindow"`
	Buckets     []string         `yaml:"buckets"` // used to define buckets of histogram when using latency expression
	Expr        string           `yaml:"expr"`
}

func (*ExprBlock) ComputeExpr

func (block *ExprBlock) ComputeExpr(window, le string) string

func (*ExprBlock) ComputeQuantile added in v0.1.5

func (block *ExprBlock) ComputeQuantile(window string, quantile float64) string

func (*ExprBlock) GetShortWindow added in v0.2.0

func (block *ExprBlock) GetShortWindow() bool

type Objectives

type Objectives struct {
	Availability float64                 `yaml:"availability"`
	Latency      []methods.LatencyTarget `yaml:"latency"`
	Window       model.Duration          `yaml:"window"`
}

func (*Objectives) LatencyBuckets added in v0.1.8

func (o *Objectives) LatencyBuckets() []string

LatencyBuckets returns all boundaries of latencies is the same boundaries of a prometheus histogram (aka: le) used to calculate latency SLOs

type SLO

type SLO struct {
	Name       string `yaml:"name"`
	Class      string `yaml:"class"`
	Objectives Objectives

	HonorLabels bool `yaml:"honorLabels"`

	TrafficRateRecord     ExprBlock         `yaml:"trafficRateRecord"`
	ErrorRateRecord       ExprBlock         `yaml:"errorRateRecord"`
	LatencyRecord         ExprBlock         `yaml:"latencyRecord"`
	LatencyQuantileRecord ExprBlock         `yaml:"latencyQuantileRecord"`
	Labels                map[string]string `yaml:"labels"`
	Annotations           map[string]string `yaml:"annotations"`
}

func (*SLO) GenerateAlertRules

func (slo *SLO) GenerateAlertRules(sloClass *Class, disableTicket bool) []rulefmt.RuleNode

func (*SLO) GenerateGroupRules

func (slo *SLO) GenerateGroupRules(sloClass *Class, disableTicket bool) []rulefmt.RuleGroup

type SLOSpec

type SLOSpec struct {
	SLOS    []SLO   `yaml:"slos"`
	Classes Classes `yaml:"classes"`
}

Jump to

Keyboard shortcuts

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