mirror of
https://github.com/prymitive/karma
synced 2026-05-07 03:26:52 +00:00
fix(api): color @cluster label
This commit is contained in:
committed by
Łukasz Mierzwa
parent
685317842e
commit
d07c56d3d8
@@ -309,6 +309,17 @@ func alerts(c *gin.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
if ck, foundKey := dedupedColors["@cluster"]; foundKey {
|
||||
for _, am := range alert.Alertmanager {
|
||||
if cv, foundVal := ck[am.Cluster]; foundVal {
|
||||
if _, found := colors["@cluster"]; !found {
|
||||
colors["@cluster"] = map[string]models.LabelColors{}
|
||||
}
|
||||
colors["@cluster"][am.Cluster] = cv
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
agCopy.StateCount[alert.State]++
|
||||
|
||||
for _, am := range alert.Alertmanager {
|
||||
|
||||
@@ -261,6 +261,7 @@ func (am *Alertmanager) pullAlerts(version string) error {
|
||||
transform.ColorLabel(colors, "@receiver", alert.Receiver)
|
||||
for _, am := range alert.Alertmanager {
|
||||
transform.ColorLabel(colors, "@alertmanager", am.Name)
|
||||
transform.ColorLabel(colors, "@cluster", am.Cluster)
|
||||
}
|
||||
for k, v := range alert.Labels {
|
||||
transform.ColorLabel(colors, k, v)
|
||||
|
||||
Reference in New Issue
Block a user