checker

package
v2.4.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OK        = "OK"
	WARN      = "WARN"
	ERROR     = "ERROR"
	NODATA    = "NODATA"
	EXCEPTION = "EXCEPTION"
	DEL       = "DEL"
)

Default moira triggers states

Variables

View Source
var ErrTriggerNotExists = errors.New("trigger does not exists")

ErrTriggerNotExists used if trigger to check does not exists

Functions

func IsInvalidValue

func IsInvalidValue(val float64) bool

IsInvalidValue checks trigger for Inf and NaN. If it is then trigger is not valid

func ToTriggerState

func ToTriggerState(state string) string

ToTriggerState is an auxiliary function to handle trigger state properly.

Types

type Config

type Config struct {
	Enabled                     bool
	NoDataCheckInterval         time.Duration
	CheckInterval               time.Duration
	LazyTriggersCheckInterval   time.Duration
	MetricsTTLSeconds           int64
	StopCheckingIntervalSeconds int64
	MaxParallelChecks           int
	MaxParallelRemoteChecks     int
	LogFile                     string
	LogLevel                    string
}

Config represent checker config

type ErrTriggerHasNoTimeSeries

type ErrTriggerHasNoTimeSeries struct{}

ErrTriggerHasNoTimeSeries used if trigger has no metrics

func (ErrTriggerHasNoTimeSeries) Error

func (err ErrTriggerHasNoTimeSeries) Error() string

ErrTriggerHasNoTimeSeries implementation with constant error message

type ErrTriggerHasOnlyWildcards

type ErrTriggerHasOnlyWildcards struct{}

ErrTriggerHasOnlyWildcards used if trigger has only wildcard metrics

func (ErrTriggerHasOnlyWildcards) Error

func (err ErrTriggerHasOnlyWildcards) Error() string

ErrTriggerHasOnlyWildcards implementation with constant error message

type ErrTriggerHasSameTimeSeriesNames

type ErrTriggerHasSameTimeSeriesNames struct {
	// contains filtered or unexported fields
}

ErrTriggerHasSameTimeSeriesNames used if trigger has two timeseries with same name

func (ErrTriggerHasSameTimeSeriesNames) Error

ErrTriggerHasSameTimeSeriesNames implementation with constant error message

type ErrWrongTriggerTargets

type ErrWrongTriggerTargets []int

ErrWrongTriggerTargets represents targets with inconsistent number of timeseries

func (ErrWrongTriggerTargets) Error

func (err ErrWrongTriggerTargets) Error() string

ErrWrongTriggerTarget implementation for list of invalid targets found

type TriggerChecker

type TriggerChecker struct {
	TriggerID    string
	Database     moira.Database
	Logger       moira.Logger
	Config       *Config
	RemoteConfig *remote.Config
	Metrics      *graphite.CheckerMetrics

	From  int64
	Until int64
	// contains filtered or unexported fields
}

TriggerChecker represents data, used for handling new trigger state

func (*TriggerChecker) Check

func (triggerChecker *TriggerChecker) Check() error

Check handle trigger and last check and write new state of trigger, if state were change then write new NotificationEvent

func (*TriggerChecker) InitTriggerChecker

func (triggerChecker *TriggerChecker) InitTriggerChecker() error

InitTriggerChecker initialize new triggerChecker data, if trigger does not exists then return ErrTriggerNotExists error

type TriggerTimeSeries

type TriggerTimeSeries struct {
	Main       []*target.TimeSeries
	Additional []*target.TimeSeries
}

TriggerTimeSeries represent collection of Main target timeseries and collection of additions targets timeseries

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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