[FIX] add recover to event log when monite prometheus get msg error

This commit is contained in:
Bay 2017-12-29 15:50:48 +08:00
parent 87ca1b0397
commit 5aa5eed6b5

View File

@ -113,6 +113,11 @@ var rex *regexp.Regexp
//Format 格式化处理监控数据
func Format(source map[string]gjson.Result) map[string]interface{} {
defer func() {
if r := recover(); r != nil {
logrus.Warnf("error deal with source msg %v",source)
}
}()
if rex == nil {
var err error
rex, err = regexp.Compile(`\d+\.\d{3,}`)