fix(backend): ignore alerts without alertmanager

This commit is contained in:
Łukasz Mierzwa
2020-06-12 17:43:30 +01:00
committed by Łukasz Mierzwa
parent ee718cff23
commit fe6d5746ab

View File

@@ -243,7 +243,6 @@ func alerts(c *gin.Context) {
}
}
if !validFilters || (slices.BoolInSlice(results, true) && !slices.BoolInSlice(results, false)) {
matches++
blockedAMs := map[string]bool{}
for _, am := range alert.Alertmanager {
@@ -263,6 +262,11 @@ func alerts(c *gin.Context) {
}
alert.Alertmanager = ams
}
if len(alert.Alertmanager) == 0 {
continue
}
matches++
alertGridLabelValues := map[string]bool{}
switch gridLabel {