Documentation
¶
Index ¶
Constants ¶
const ( OK = "OK" WARN = "WARN" ERROR = "ERROR" NODATA = "NODATA" EXCEPTION = "EXCEPTION" DEL = "DEL" )
Default moira triggers states
Variables ¶
var ErrTriggerNotExists = errors.New("trigger does not exists")
ErrTriggerNotExists used if trigger to check does not exists
Functions ¶
func IsInvalidValue ¶
IsInvalidValue checks trigger for Inf and NaN. If it is then trigger is not valid
func ToTriggerState ¶
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 ¶
func (err ErrTriggerHasSameTimeSeriesNames) Error() string
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