Documentation
¶
Index ¶
- Variables
- func AlertFiringInNamespace(alertName, namespace string) monitorapi.EventIntervalMatchesFunc
- func AlertPendingInNamespace(alertName, namespace string) monitorapi.EventIntervalMatchesFunc
- func GetEstimatedNumberOfRevisionsForEtcdOperator(ctx context.Context, kubeClient kubernetes.Interface, duration time.Duration) (int, error)
- func GetHistoricalData() *historicaldata.AlertBestMatcher
- func InNamespace(namespace string) func(event monitorapi.Interval) bool
- func IsWatchdogAlert(eventInterval monitorapi.Interval) bool
- func NewAllowedWhenEtcdRevisionChange(ctx context.Context, kubeClient kubernetes.Interface, duration time.Duration) (*etcdRevisionChangeAllowance, error)
- type AlertState
- type AlertTest
- type AlertTestAllowanceCalculator
Constants ¶
This section is empty.
Variables ¶
var AllowedAlertNames = []string{
"Watchdog",
"AlertmanagerReceiversNotConfigured",
"PrometheusRemoteWriteDesiredShards",
"KubeJobFailingSRE",
"TelemeterClientFailures",
"CDIDefaultStorageClassDegraded",
"VirtHandlerRESTErrorsHigh",
"VirtControllerRESTErrorsHigh",
}
AllowedAlertNames is a list of alerts we do not test against.
var DefaultAllowances = &percentileAllowances{}
Functions ¶
func AlertFiringInNamespace ¶
func AlertFiringInNamespace(alertName, namespace string) monitorapi.EventIntervalMatchesFunc
func AlertPendingInNamespace ¶
func AlertPendingInNamespace(alertName, namespace string) monitorapi.EventIntervalMatchesFunc
func GetEstimatedNumberOfRevisionsForEtcdOperator ¶
func GetEstimatedNumberOfRevisionsForEtcdOperator(ctx context.Context, kubeClient kubernetes.Interface, duration time.Duration) (int, error)
GetEstimatedNumberOfRevisionsForEtcdOperator calculates the number of revisions that have occurred between now and duration
func GetHistoricalData ¶
func GetHistoricalData() *historicaldata.AlertBestMatcher
func InNamespace ¶
func InNamespace(namespace string) func(event monitorapi.Interval) bool
InNamespace if namespace == "", then every event matches, same as kube-api
func IsWatchdogAlert ¶
func IsWatchdogAlert(eventInterval monitorapi.Interval) bool
Types ¶
type AlertState ¶
type AlertState string
AlertState is the state of the alert. They are logically ordered, so if a test says it limits on "pending", then any state above pending (like info or warning) will cause the test to fail. TODO this looks wrong, AlertState (pending|firing) and AlertLevel (info|warning|critical) are different things, but they seem lumped together here.
const ( AlertPending AlertState = "pending" AlertInfo AlertState = "info" AlertWarning AlertState = "warning" AlertCritical AlertState = "critical" AlertUnknown AlertState = "unknown" )
type AlertTest ¶
type AlertTest interface {
// InvariantTestName is name for this as an invariant test
InvariantTestName() string
// AlertName is the name of the alert
AlertName() string
// AlertState is the threshold this test applies to.
AlertState() AlertState
InvariantCheck(intervals monitorapi.Intervals, r monitorapi.ResourcesMap) ([]*junitapi.JUnitTestCase, error)
}
func AllAlertTests ¶
func AllAlertTests(jobType *platformidentification.JobType, clusterStability *monitortestframework.ClusterStabilityDuringTest, etcdAllowance AlertTestAllowanceCalculator) []AlertTest
AllAlertTests returns the list of AlertTests with independent tests instead of relying on a backstop test. etcdAllowance can be the DefaultAllowances, but the quality of testing will be better if it is set. Some callers do not intend to run these tests (rather only to list alerts which have a test), in which case JobType can be an empty struct.
type AlertTestAllowanceCalculator ¶
type AlertTestAllowanceCalculator interface {
// FailAfter returns a duration an alert can be at or above the required state before failing.
FailAfter(key historicaldata2.AlertDataKey) (time.Duration, error)
// FlakeAfter returns a duration an alert can be at or above the required state before flaking.
FlakeAfter(key historicaldata2.AlertDataKey) time.Duration
}
AlertTestAllowanceCalculator provides the duration after which an alert test should flake and fail. For instance, for if the alert test is checking pending, and the alert is pending for 4s and the FailAfter returns 6s and the FlakeAfter returns 2s, then test will flake.