methods

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: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NotificationPageSeverity   = NotificationSeverity("page")
	NotificationTicketSeverity = NotificationSeverity("ticket")

	// Severities list of available severities: page and ticket
	Severities = []NotificationSeverity{
		NotificationPageSeverity,
		NotificationTicketSeverity,
	}
)

Functions

This section is empty.

Types

type AlertErrorOptions added in v0.1.11

type AlertErrorOptions struct {
	ServiceName        string
	AvailabilityTarget float64
	SLOWindow          time.Duration

	Windows     []Window
	ShortWindow bool
	BurnRate    float64

	// important for simple algorithm
	AlertWindow string
	AlertWait   string
}

type AlertLatencyOptions added in v0.1.11

type AlertLatencyOptions struct {
	ServiceName string
	Targets     []LatencyTarget
	SLOWindow   time.Duration

	Windows     []Window
	ShortWindow bool
	BurnRate    float64

	// important for simple algorithm
	AlertWindow string
	AlertWait   string
}

type AlertMethod

type AlertMethod interface {
	AlertForError(*AlertErrorOptions) ([]rulefmt.Rule, error)
	AlertForLatency(*AlertLatencyOptions) ([]rulefmt.Rule, error)
}

func Get

func Get(name string) AlertMethod

type LatencyTarget

type LatencyTarget struct {
	LE     string  `yaml:"le"`
	Target float64 `yaml:"target"`
}

type MultiRateErrorOpts

type MultiRateErrorOpts struct {
	Rates  []MultiRateWindow
	Metric string
	Labels labels.Labels
	Value  float64
}

type MultiRateLatencyOpts

type MultiRateLatencyOpts struct {
	Rates   []MultiRateWindow
	Metric  string
	Label   labels.Label
	Buckets []LatencyTarget
}

type MultiRateWindow

type MultiRateWindow struct {
	Multiplier  float64
	LongWindow  string
	ShortWindow string
}

type MultiWindowAlgorithm

type MultiWindowAlgorithm struct{}

func (*MultiWindowAlgorithm) AlertForError

func (*MultiWindowAlgorithm) AlertForError(opts *AlertErrorOptions) ([]rulefmt.Rule, error)

func (*MultiWindowAlgorithm) AlertForLatency

func (*MultiWindowAlgorithm) AlertForLatency(opts *AlertLatencyOptions) ([]rulefmt.Rule, error)

type NotificationSeverity added in v0.2.0

type NotificationSeverity string

type SimpleAlgorithm added in v0.1.11

type SimpleAlgorithm struct{}

func (*SimpleAlgorithm) AlertForError added in v0.1.11

func (*SimpleAlgorithm) AlertForError(opts *AlertErrorOptions) ([]rulefmt.Rule, error)

func (*SimpleAlgorithm) AlertForLatency added in v0.1.11

func (*SimpleAlgorithm) AlertForLatency(opts *AlertLatencyOptions) ([]rulefmt.Rule, error)

type Window added in v0.2.0

type Window struct {
	Duration     model.Duration       `yaml:"duration"`
	Consumption  float64              `yaml:"consumption"`
	Notification NotificationSeverity `yaml:"notification"`
}

Jump to

Keyboard shortcuts

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