ezgh obs alert-rules list [--search text] [--state s]... [--kind k]... [--contact-point cp] [--label name=value]... [--sort state|name|changed] [flags]List the project’s alert rules, with each one’s condition kind (promql, logs or traces), state and since when, how many instances are firing, when it was last evaluated and its contact points. A state marked (delayed) is being evaluated late because of an EZGH issue: its instances are held as they were, and no one is notified about it.
--search keeps the rules whose name contains it (ignoring case), --state those in these states, --kind those of these kinds, --contact-point (ID, slug or name) those that notify it, and each --label those with that static label (name=value). --sort orders them: state (the default: worst first, then by name), name, or changed (the latest state change first). The list is paged (--limit, default 25; --all reads every page).
Part of ezgh obs alert-rules.
Examples
ezgh obs alert-rules list
ezgh obs alert-rules list --state firing,noData --sort changed
ezgh obs alert-rules list --search latency --kind promql --label team=platformFlags
| Flag | Type | Default | Description |
|---|---|---|---|
--all |
boolean | follow nextCursor through every page | |
--contact-point |
string | only rules that notify this contact point (ID, slug or name) | |
--cursor |
string | start from this page (a previous page’s nextCursor) | |
--kind |
strings, comma-separated or repeated | only rules of these kinds: promql, logs or traces (repeat, or comma-separate) | |
--label |
string, repeatable | only rules with this static label: name=value (repeatable) | |
--limit |
int | 25 |
items per page, 1 to 100 |
--search |
string | only rules whose name contains this (ignoring case) | |
--sort |
string | the order: state (worst first; the default), name or changed | |
--state |
strings, comma-separated or repeated | only rules in these states: ok, pending, firing, noData, error or disabled (repeat, or comma-separate) |
This command also takes the global flags.