Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrTriggerNotExists = fmt.Errorf("trigger does not exists")
ErrTriggerNotExists used if trigger to check does not exists
Functions ¶
This section is empty.
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 ErrTargetHasNoMetrics ¶
type ErrTargetHasNoMetrics struct {
// contains filtered or unexported fields
}
ErrTargetHasNoMetrics used if additional trigger target has not metrics data after fetch from source
func (ErrTargetHasNoMetrics) Error ¶
func (err ErrTargetHasNoMetrics) Error() string
ErrTargetHasNoMetrics implementation with constant error message
type ErrTriggerHasNoMetrics ¶
type ErrTriggerHasNoMetrics struct{}
ErrTriggerHasNoMetrics used if trigger has no metrics
func (ErrTriggerHasNoMetrics) Error ¶
func (err ErrTriggerHasNoMetrics) Error() string
ErrTriggerHasNoMetrics 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 ErrTriggerHasSameMetricNames ¶
type ErrTriggerHasSameMetricNames struct {
// contains filtered or unexported fields
}
ErrTriggerHasSameMetricNames used if trigger has two timeseries with same name
func (ErrTriggerHasSameMetricNames) Error ¶
func (err ErrTriggerHasSameMetricNames) Error() string
ErrTriggerHasSameMetricNames 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 {
// contains filtered or unexported fields
}
TriggerChecker represents data, used for handling new trigger state
func MakeTriggerChecker ¶
func MakeTriggerChecker(triggerID string, dataBase moira.Database, logger moira.Logger, config *Config, sourceProvider *metricSource.SourceProvider, metrics *graphite.CheckerMetrics) (*TriggerChecker, error)
MakeTriggerChecker initialize new triggerChecker data if trigger does not exists then return ErrTriggerNotExists error if trigger metrics source does not configured then return ErrMetricSourceIsNotConfigured error.
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