Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Rule ¶
type Rule struct {
Version string
Namespace string
Name string
Database string
Interval time.Duration
Query string
AutoMitigateAfter time.Duration
Destination string
// Criteria is a map of key-value pairs that are used to determine where an alert can execute.
Criteria map[string][]string
// CriteriaExpression is an optional CEL expression used for richer execution control.
CriteriaExpression string
// Management queries (starts with a dot) have to call a different
// query API in the Kusto Go SDK.
IsMgmtQuery bool
// Stmt specifies the underlayEtcdPeersQuery to execute.
Stmt kusto.Stmt
// LastQueryTime from the AlertRule status, used for smart scheduling
LastQueryTime time.Time
}
Rule is analogous to a kusto-to-metric configuration, containing definitions and using the parlance found in the k2m UI.
func (*Rule) Matches ¶ added in v0.2.0
Matches evaluates whether this rule should execute based on simple Criteria AND the CEL CriteriaExpression. It returns true if both the map criteria matches and the expression evaluates to true. Errors are returned for invalid criteria keys (referencing tags that don't exist) or CEL compilation issues.
Click to show internal directories.
Click to hide internal directories.