alert

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const AlertGenerator = generator(false)

AlertGenerator knows how to generate all the required alerts based on an SLO. The generated alerts are generic and don't depend on any specific SLO implementation.

Variables

This section is empty.

Functions

This section is empty.

Types

type MWMBAlert

type MWMBAlert struct {
	ID             string
	ShortWindow    time.Duration
	LongWindow     time.Duration
	BurnRateFactor float64
	ErrorBudget    float64
	Severity       Severity
}

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 SLO

type SLO struct {
	ID         string
	TimeWindow time.Duration
	Objective  float64
}

type Severity

type Severity int

Severity is the type of alert.

const (
	UnknownAlertSeverity Severity = iota
	PageAlertSeverity
	TicketAlertSeverity
)

func (Severity) String

func (s Severity) String() string

type WindowMetadata added in v0.8.0

type WindowMetadata struct {
	WindowPeriod time.Duration

	// Alerting required windows.
	// Its a matrix of values with:
	// - Alert severity: ["page", "ticket"].
	// - Measure period: ["long", "short"].
	WindowPageQuickShort   time.Duration
	WindowPageQuickLong    time.Duration
	WindowPageSlowShort    time.Duration
	WindowPageSlowLong     time.Duration
	WindowTicketQuickShort time.Duration
	WindowTicketQuickLong  time.Duration
	WindowTicketSlowShort  time.Duration
	WindowTicketSlowLong   time.Duration

	// Error budget percent consumed for a full time window.
	// Google gives us some defaults in its SRE workbook that work correctly most of the times:
	// - Page quick:   2%
	// - Page slow:    5%
	// - Ticket quick: 10%
	// - Ticket slow:  10%
	ErrorBudgetPercPageQuick   float64
	ErrorBudgetPercPageSlow    float64
	ErrorBudgetPercTicketQuick float64
	ErrorBudgetPercTicketSlow  float64
}

WindowMetadata has the information required to calculate SLOs.

func (WindowMetadata) GetSpeedPageQuick added in v0.8.0

func (w WindowMetadata) GetSpeedPageQuick() float64

Error budget speeds based on a full time window, however once we have the factor (speed) the value can be used with any time window.

func (WindowMetadata) GetSpeedPageSlow added in v0.8.0

func (w WindowMetadata) GetSpeedPageSlow() float64

func (WindowMetadata) GetSpeedTicketQuick added in v0.8.0

func (w WindowMetadata) GetSpeedTicketQuick() float64

func (WindowMetadata) GetSpeedTicketSlow added in v0.8.0

func (w WindowMetadata) GetSpeedTicketSlow() float64

Jump to

Keyboard shortcuts

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