feat(alerting): more output when testing alert

This commit is contained in:
Torkel Ödegaard
2016-07-21 21:54:12 +02:00
parent b073fe0eba
commit 783d697529
11 changed files with 41 additions and 75 deletions
+3 -2
View File
@@ -30,7 +30,7 @@ func (aj *AlertJob) IncRetry() {
type AlertResultContext struct {
Triggered bool
IsTestRun bool
Details []*AlertResultDetail
Events []*AlertEvent
Logs []*AlertResultLogEntry
Error error
Description string
@@ -51,6 +51,7 @@ func NewAlertResultContext(rule *AlertRule) *AlertResultContext {
StartTime: time.Now(),
Rule: rule,
Logs: make([]*AlertResultLogEntry, 0),
Events: make([]*AlertEvent, 0),
DoneChan: make(chan bool, 1),
CancelChan: make(chan bool, 1),
log: log.New("alerting.engine"),
@@ -62,7 +63,7 @@ type AlertResultLogEntry struct {
Data interface{}
}
type AlertResultDetail struct {
type AlertEvent struct {
Value float64
Metric string
State string