Browse Source

refactor alert process

main
ning 2 years ago
parent
commit
f4336ca5e9
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      alert/process/process.go

+ 5
- 1
alert/process/process.go View File

@@ -233,11 +233,12 @@ func (p *Processor) HandleRecover(alertingKeys map[string]struct{}, now int64) {
}
}

func (p *Processor) RecoverSingle(hash string, now int64, value *string) {
func (p *Processor) RecoverSingle(hash string, now int64, value *string, values ...string) {
cachedRule := p.rule
if cachedRule == nil {
return
}

event, has := p.fires.Get(hash)
if !has {
return
@@ -249,6 +250,9 @@ func (p *Processor) RecoverSingle(hash string, now int64, value *string) {
}
if value != nil {
event.TriggerValue = *value
if len(values) > 0 {
event.TriggerValues = values[0]
}
}

// 没查到触发阈值的vector,姑且就认为这个vector的值恢复了


Loading…
Cancel
Save