Documentation ¶
Index ¶
- Constants
- func ContainsString(slice []string, contains string) bool
- func PodByName(listOfPods []*kapiv1.Pod, exclusionFunc func(*kapiv1.Pod) (bool, error)) (allPods, excludeFromComparison map[string]*kapiv1.Pod, err error)
- type AnomalyDetector
- type Config
- type ConfigPrometheusAnomalyDetector
- type ContinuousValueDeviationAnalyser
- type ContinuousValueDeviationConfig
- type CustomAnomalyDetector
- type DiscreteValueOutOfListAnalyser
- type DiscreteValueOutOfListConfig
- type Factory
- type FactoryConfig
- type Fake
- type ValueInRangeAnalyser
- type ValueInRangeConfig
Constants ¶
const (
GlobalQueryKey = "__**GlobalKeyQuery**__"
)
Variables ¶
This section is empty.
Functions ¶
func ContainsString ¶
ContainsString checks if the slice has the contains value in it.
Types ¶
type AnomalyDetector ¶
AnomalyDetector returns the list of pods that do not behave correctly according to the configuration
type Config ¶
type Config struct { Selector labels.Selector PodLister kv1.PodNamespaceLister Logger logr.Logger ExclusionFunc func(*kapiv1.Pod) (bool, error) }
Config generic part of the configuration for anomalyDetector
type ConfigPrometheusAnomalyDetector ¶
type ConfigPrometheusAnomalyDetector struct { PrometheusService string PodNameKey string AllPodsQuery bool Query string // contains filtered or unexported fields }
ConfigPrometheusAnomalyDetector configuration to connect to prometheus
type ContinuousValueDeviationAnalyser ¶
type ContinuousValueDeviationAnalyser struct { ConfigSpecific ContinuousValueDeviationConfig ConfigAnalyser Config // contains filtered or unexported fields }
ContinuousValueDeviationAnalyser anomalyDetector that check the deviation of a continous value compare to average
func (*ContinuousValueDeviationAnalyser) GetPodsOutOfBounds ¶
func (d *ContinuousValueDeviationAnalyser) GetPodsOutOfBounds() ([]*kapiv1.Pod, error)
GetPodsOutOfBounds implements interface AnomalyDetector
type ContinuousValueDeviationConfig ¶
type ContinuousValueDeviationConfig struct {
MaxDeviationPercent float64
}
ContinuousValueDeviationConfig Configuration for ContinuousValueDeviationAnalyser
type CustomAnomalyDetector ¶
type CustomAnomalyDetector struct {
// contains filtered or unexported fields
}
CustomAnomalyDetector call an external service to get the list of faulty pods
func (*CustomAnomalyDetector) GetPodsOutOfBounds ¶
func (c *CustomAnomalyDetector) GetPodsOutOfBounds() ([]*kapiv1.Pod, error)
GetPodsOutOfBounds implements the anomaly detector interface
type DiscreteValueOutOfListAnalyser ¶
type DiscreteValueOutOfListAnalyser struct { ConfigSpecific DiscreteValueOutOfListConfig ConfigAnalyser Config // contains filtered or unexported fields }
DiscreteValueOutOfListAnalyser anomalyDetector that check the ratio of good/bad value and return the pods that exceed a given threshold for that ratio
func (*DiscreteValueOutOfListAnalyser) GetPodsOutOfBounds ¶
func (d *DiscreteValueOutOfListAnalyser) GetPodsOutOfBounds() ([]*kapiv1.Pod, error)
GetPodsOutOfBounds implements interface AnomalyDetector
type DiscreteValueOutOfListConfig ¶
type DiscreteValueOutOfListConfig struct { Key string // Key for the metrics. For the previous example it will be "code" GoodValues []string // Good Values ["200","201"]. If empty means that BadValues should be used to do exclusion instead of inclusion. BadValues []string // Bad Values ["500","404"]. TolerancePercent uint // contains filtered or unexported fields }
DiscreteValueOutOfListConfig configuration for DiscreteValueOutOfListAnalyser
type Factory ¶
type Factory func(cfg FactoryConfig) (AnomalyDetector, error)
Factory functor for AnomalyDetection
type FactoryConfig ¶
type FactoryConfig struct { Config DiscreteValueOutOfListConfig *DiscreteValueOutOfListConfig ContinuousValueDeviationConfig *ContinuousValueDeviationConfig ValueInRangeConfig *ValueInRangeConfig PromConfig *ConfigPrometheusAnomalyDetector CustomService string // contains filtered or unexported fields }
FactoryConfig parameters extended with factory features
type ValueInRangeAnalyser ¶
type ValueInRangeAnalyser struct { ConfigSpecific ValueInRangeConfig ConfigAnalyser Config // contains filtered or unexported fields }
ValueInRangeAnalyser anomalyDetector that check the deviation of a continous value compare to average
func (*ValueInRangeAnalyser) GetPodsOutOfBounds ¶
func (d *ValueInRangeAnalyser) GetPodsOutOfBounds() ([]*kapiv1.Pod, error)
GetPodsOutOfBounds implements interface AnomalyDetector
type ValueInRangeConfig ¶
ValueInRangeConfig Configuration for ValueInRangeAnalyser