fix: recovery event tags map split
This commit is contained in:
parent
652439bb85
commit
52b3afbd97
|
@ -527,6 +527,11 @@ func (p *Processor) RecoverAlertCurEventFromDb() {
|
|||
}
|
||||
|
||||
event.DB2Mem()
|
||||
target, exists := p.TargetCache.Get(event.TargetIdent)
|
||||
if exists {
|
||||
event.Target = target
|
||||
}
|
||||
|
||||
fireMap[event.Hash] = event
|
||||
e := *event
|
||||
pendingsUseByRecoverMap[event.Hash] = &e
|
||||
|
|
|
@ -34,7 +34,7 @@ func (rt *Router) pushEventToQueue(c *gin.Context) {
|
|||
continue
|
||||
}
|
||||
|
||||
arr := strings.Split(pair, "=")
|
||||
arr := strings.SplitN(pair, "=", 2)
|
||||
if len(arr) != 2 {
|
||||
continue
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@ func CallIbex(ctx *ctx.Context, id int64, host string,
|
|||
continue
|
||||
}
|
||||
|
||||
arr := strings.Split(pair, "=")
|
||||
arr := strings.SplitN(pair, "=", 2)
|
||||
if len(arr) != 2 {
|
||||
continue
|
||||
}
|
||||
|
|
|
@ -514,7 +514,7 @@ func (rt *Router) relabelTest(c *gin.Context) {
|
|||
|
||||
labels := make([]prompb.Label, len(f.Tags))
|
||||
for i, tag := range f.Tags {
|
||||
label := strings.Split(tag, "=")
|
||||
label := strings.SplitN(tag, "=", 2)
|
||||
if len(label) != 2 {
|
||||
ginx.Bomb(http.StatusBadRequest, "tag:%s format error", tag)
|
||||
}
|
||||
|
|
|
@ -138,7 +138,7 @@ func (rt *Router) notifyTplPreview(c *gin.Context) {
|
|||
continue
|
||||
}
|
||||
|
||||
arr := strings.Split(pair, "=")
|
||||
arr := strings.SplitN(pair, "=", 2)
|
||||
if len(arr) != 2 {
|
||||
continue
|
||||
}
|
||||
|
|
|
@ -342,7 +342,7 @@ func (e *AlertCurEvent) DB2Mem() {
|
|||
continue
|
||||
}
|
||||
|
||||
arr := strings.Split(pair, "=")
|
||||
arr := strings.SplitN(pair, "=", 2)
|
||||
if len(arr) != 2 {
|
||||
continue
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue