Skip to content

ezgh obs alert-rules test

Evaluate a rule file once, without saving it.

Updated View as Markdown
ezgh obs alert-rules test -f <file.json> [--at RFC3339] [flags]

Evaluate a rule file once, as obs-alerts would, and save nothing: it prints the instances the rule would have (each as if it had just become active: pending, or firing when for is 0m), how many rows and bytes the evaluation read, and any warnings. --at evaluates at another time (RFC 3339) instead of now. The file is a rule document, as apply takes it.

A rule that would read more than an evaluation may is refused with rule_too_expensive, with what it read and the budget it went over; narrow its condition (fewer series, a shorter window). Each problem with the document is printed as path: message. It needs read access to what the condition reads, as apply does.

Part of ezgh obs alert-rules.

Examples

ezgh obs alert-rules test -f alerts/high-latency.json
ezgh obs alert-rules test -f rule.json --at 2026-10-13T09:00:00Z

Flags

Flag Type Default Description
--at string evaluate at this time (RFC 3339; default now)
-f, --file string the rule’s JSON file, or - for stdin

This command also takes the global flags.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close