feat(api): expose alert.inhibitedBy in the API

This commit is contained in:
Łukasz Mierzwa
2019-03-05 11:00:54 +00:00
parent 5d9a563479
commit 7a0a587ddb
2 changed files with 11 additions and 10 deletions

View File

@@ -310,14 +310,15 @@ func (am *Alertmanager) pullAlerts(version string) error {
alert.Alertmanager = []models.AlertmanagerInstance{
models.AlertmanagerInstance{
Name: am.Name,
Cluster: am.ClusterID(),
State: alert.State,
StartsAt: alert.StartsAt,
EndsAt: alert.EndsAt,
Source: alert.GeneratorURL,
Silences: silences,
SilencedBy: alert.SilencedBy,
Name: am.Name,
Cluster: am.ClusterID(),
State: alert.State,
StartsAt: alert.StartsAt,
EndsAt: alert.EndsAt,
Source: alert.GeneratorURL,
Silences: silences,
SilencedBy: alert.SilencedBy,
InhibitedBy: alert.InhibitedBy,
},
}

View File

@@ -19,8 +19,8 @@ type AlertmanagerInstance struct {
// in api responses, this is used internally
Silences map[string]*Silence `json:"-"`
// export list of silenced IDs in api response
SilencedBy []string `json:"silencedBy"`
// TODO also export InhibitedBy here if it ever becomes needed
SilencedBy []string `json:"silencedBy"`
InhibitedBy []string `json:"inhibitedBy"`
}
// AlertmanagerAPIStatus describes the Alertmanager instance overall health