add reference channel id to alerting history
This commit is contained in:
parent
174126fa10
commit
522a5361a2
|
@ -42,6 +42,7 @@ type ActionExecutionResult struct {
|
||||||
Message string `json:"message"`
|
Message string `json:"message"`
|
||||||
ChannelName string `json:"channel_name"`
|
ChannelName string `json:"channel_name"`
|
||||||
ChannelType string `json:"channel_type"`
|
ChannelType string `json:"channel_type"`
|
||||||
|
ChannelID string `json:"channel_id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -822,9 +822,6 @@ func (engine *Engine) Do(rule *alerting.Rule) error {
|
||||||
|
|
||||||
if alertMessage == nil || period > periodDuration {
|
if alertMessage == nil || period > periodDuration {
|
||||||
actionResults, _ := performChannels(notifyCfg.Normal, paramsCtx, false)
|
actionResults, _ := performChannels(notifyCfg.Normal, paramsCtx, false)
|
||||||
if rule.ID == "builtin-calaqnh7h710dpnp2bm8" {
|
|
||||||
log.Info(actionResults)
|
|
||||||
}
|
|
||||||
alertItem.ActionExecutionResults = actionResults
|
alertItem.ActionExecutionResults = actionResults
|
||||||
//change and save last notification time in local kv store when action error count equals zero
|
//change and save last notification time in local kv store when action error count equals zero
|
||||||
rule.LastNotificationTime = time.Now()
|
rule.LastNotificationTime = time.Now()
|
||||||
|
@ -1066,6 +1063,7 @@ func performChannels(channels []alerting.Channel, ctx map[string]interface{}, ra
|
||||||
ExecutionTime: int(time.Now().UnixNano()/1e6),
|
ExecutionTime: int(time.Now().UnixNano()/1e6),
|
||||||
ChannelType: channel.SubType,
|
ChannelType: channel.SubType,
|
||||||
ChannelName: channel.Name,
|
ChannelName: channel.Name,
|
||||||
|
ChannelID: channel.ID,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return actionResults, errCount
|
return actionResults, errCount
|
||||||
|
|
Loading…
Reference in New Issue