Documentation
¶
Index ¶
Constants ¶
View Source
const JITTER_FACTOR = 7000
7 seconds jitter factor for evaluation among different rules
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AlertEvaluator ¶
type AlertEvaluator struct { DB *metrics.TimeSeriesDB Rules []config.AlertRule // contains filtered or unexported fields }
AlertEvaluator send new or resolved alerts to alertmanager use alertmanager to implement deduplication, notification it connect TSDB, evaluate all rules to with its own interval for each rule, the query result should contains fields that can be compared with threshold, and other fields which are used to generate alert labelSet and description The query and description can use Go templates with the rule data and query results
func NewAlertEvaluator ¶
func NewAlertEvaluator(ctx context.Context, db *metrics.TimeSeriesDB, rules []config.AlertRule, alertManagerURL string) *AlertEvaluator
func (*AlertEvaluator) StartEvaluate ¶
func (e *AlertEvaluator) StartEvaluate() error
func (*AlertEvaluator) StopEvaluate ¶
func (e *AlertEvaluator) StopEvaluate() error
func (*AlertEvaluator) UpdateAlertRules ¶
func (e *AlertEvaluator) UpdateAlertRules(rules []config.AlertRule) error
type AlertStatus ¶
type GettableAlert ¶
type GettableAlert struct { config.Alert Annotations LabelSet `json:"annotations"` Receivers []Receiver `json:"receivers"` Fingerprint string `json:"fingerprint"` StartsAt time.Time `json:"startsAt"` UpdatedAt time.Time `json:"updatedAt"` EndsAt time.Time `json:"endsAt"` Status AlertStatus `json:"status"` }
Click to show internal directories.
Click to hide internal directories.