slo

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// PropagationLabelsPrefix provides a way to propagate labels from the
	// ObjectMeta to the PrometheusRule.
	PropagationLabelsPrefix = "pyrra.dev/"
)

Variables

View Source
var ErrGroupingUnsupported = errors.New("objective with grouping not supported in generic rules")

Functions

This section is empty.

Types

type Alerting added in v0.5.0

type Alerting struct {
	Disabled  bool // deprecated, use Burnrates instead
	Burnrates bool
	Absent    bool
	Name      string
}

type BoolGaugeIndicator added in v0.6.0

type BoolGaugeIndicator struct {
	Metric
	Grouping []string
}

type Indicator

type Indicator struct {
	Ratio         *RatioIndicator
	Latency       *LatencyIndicator
	LatencyNative *LatencyNativeIndicator
	BoolGauge     *BoolGaugeIndicator
}

type IndicatorType added in v0.6.0

type IndicatorType int
const (
	Unknown       IndicatorType = iota
	Ratio         IndicatorType = iota
	Latency       IndicatorType = iota
	LatencyNative IndicatorType = iota
	BoolGauge     IndicatorType = iota
)

type LatencyIndicator

type LatencyIndicator struct {
	Success  Metric
	Total    Metric
	Grouping []string
}

type LatencyNativeIndicator added in v0.7.0

type LatencyNativeIndicator struct {
	Latency  model.Duration
	Total    Metric
	Grouping []string
}

type Metric

type Metric struct {
	Name          string
	LabelMatchers []*labels.Matcher
}

func (Metric) Metric

func (m Metric) Metric() string

type MultiBurnRateAlert

type MultiBurnRateAlert struct {
	Severity string
	Short    time.Duration
	Long     time.Duration
	For      time.Duration
	Factor   float64

	QueryShort string
	QueryLong  string
}

type Objective

type Objective struct {
	Labels      labels.Labels
	Annotations map[string]string
	Description string
	Target      float64
	Window      model.Duration
	Config      string

	Alerting  Alerting
	Indicator Indicator
}

func (Objective) AlertName added in v0.5.0

func (o Objective) AlertName() string

func (Objective) Alerts

func (o Objective) Alerts() ([]MultiBurnRateAlert, error)

func (Objective) Burnrate

func (o Objective) Burnrate(timerange time.Duration) string

func (Objective) BurnrateName added in v0.4.3

func (o Objective) BurnrateName(rate time.Duration) string

func (Objective) Burnrates

func (o Objective) Burnrates() (monitoringv1.RuleGroup, error)

func (Objective) DurationRange added in v0.5.0

func (o Objective) DurationRange(timerange time.Duration, percentile float64) string

func (Objective) ErrorsRange

func (o Objective) ErrorsRange(timerange time.Duration) string

func (Objective) Exhausts added in v0.7.0

func (o Objective) Exhausts(factor float64) model.Duration

func (Objective) GenericRules added in v0.5.0

func (o Objective) GenericRules() (monitoringv1.RuleGroup, error)

func (Objective) Grouping added in v0.4.1

func (o Objective) Grouping() []string

func (Objective) HasWindows added in v0.4.0

func (o Objective) HasWindows(short, long model.Duration) (Window, bool)

func (Objective) IncreaseRules added in v0.3.0

func (o Objective) IncreaseRules() (monitoringv1.RuleGroup, error)

func (Objective) IndicatorType added in v0.6.0

func (o Objective) IndicatorType() IndicatorType

func (Objective) Name

func (o Objective) Name() string

func (Objective) QueryBurnrate added in v0.4.3

func (o Objective) QueryBurnrate(timerange time.Duration, groupingMatchers []*labels.Matcher) (string, error)

func (Objective) QueryErrorBudget

func (o Objective) QueryErrorBudget() string

func (Objective) QueryErrors

func (o Objective) QueryErrors(window model.Duration) string

QueryErrors returns a PromQL query to get the amount of request errors during the window.

func (Objective) QueryTotal

func (o Objective) QueryTotal(window model.Duration) string

QueryTotal returns a PromQL query to get the total amount of requests served during the window.

func (Objective) RequestRange

func (o Objective) RequestRange(timerange time.Duration) string

func (Objective) Windows added in v0.4.0

func (o Objective) Windows() []Window

type RatioIndicator

type RatioIndicator struct {
	Errors   Metric
	Total    Metric
	Grouping []string
}

type Window added in v0.4.0

type Window struct {
	Severity severity
	For      time.Duration
	Long     time.Duration
	Short    time.Duration
	Factor   float64
}

func Windows added in v0.4.0

func Windows(sloWindow time.Duration) []Window

Jump to

Keyboard shortcuts

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