diff --git a/views.go b/views.go index 50929042c..81897730c 100644 --- a/views.go +++ b/views.go @@ -7,6 +7,7 @@ import ( "io" "net/http" "sort" + "strconv" "strings" "time" @@ -165,6 +166,8 @@ func alerts(c *gin.Context) { countLabel(counters, "@silenced", "false") } + countLabel(counters, "@inhibited", strconv.FormatBool(alert.Inhibited)) + for key, value := range alert.Labels { if keyMap, foundKey := store.Store.Colors[key]; foundKey { if color, foundColor := keyMap[value]; foundColor { diff --git a/views_test.go b/views_test.go index 88ac6f92e..d8695dde1 100644 --- a/views_test.go +++ b/views_test.go @@ -142,7 +142,7 @@ func TestAlerts(t *testing.T) { if ur.Status != "success" { t.Errorf("[%s] Invalid status in response: %s", version, ur.Status) } - if len(ur.Counters) != 5 { + if len(ur.Counters) != 6 { t.Errorf("[%s] Invalid number of counters in response (%d): %v", version, len(ur.Counters), ur.Counters) } for _, ag := range ur.AlertGroups {