mirror of
https://github.com/prometheus/alertmanager
synced 2025-01-29 17:52:53 +00:00
Update alerts argument order, rename expired to inhibited (#1360)
Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
This commit is contained in:
parent
998984d8d6
commit
1c0c24b300
@ -15,8 +15,8 @@ import (
|
||||
)
|
||||
|
||||
type alertQueryCmd struct {
|
||||
expired, silenced bool
|
||||
matcherGroups []string
|
||||
inhibited, silenced bool
|
||||
matcherGroups []string
|
||||
}
|
||||
|
||||
const alertHelp = `View and search through current alerts.
|
||||
@ -49,7 +49,7 @@ func configureAlertCmd(app *kingpin.Application) {
|
||||
alertCmd = app.Command("alert", alertHelp).PreAction(requireAlertManagerURL)
|
||||
queryCmd = alertCmd.Command("query", alertHelp).Default()
|
||||
)
|
||||
queryCmd.Flag("expired", "Show expired alerts as well as active").BoolVar(&a.expired)
|
||||
queryCmd.Flag("inhibited", "Show inhibited alerts").Short('i').BoolVar(&a.inhibited)
|
||||
queryCmd.Flag("silenced", "Show silenced alerts").Short('s').BoolVar(&a.silenced)
|
||||
queryCmd.Arg("matcher-groups", "Query filter").StringsVar(&a.matcherGroups)
|
||||
queryCmd.Action(a.queryAlerts)
|
||||
@ -76,7 +76,7 @@ func (a *alertQueryCmd) queryAlerts(ctx *kingpin.ParseContext) error {
|
||||
return err
|
||||
}
|
||||
alertAPI := client.NewAlertAPI(c)
|
||||
fetchedAlerts, err := alertAPI.List(context.Background(), filterString, a.expired, a.silenced)
|
||||
fetchedAlerts, err := alertAPI.List(context.Background(), filterString, a.silenced, a.inhibited)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user