diff --git a/pkg/services/ngalert/README.md b/pkg/services/ngalert/README.md index 7a44cae37a7..1f872989466 100644 --- a/pkg/services/ngalert/README.md +++ b/pkg/services/ngalert/README.md @@ -27,13 +27,13 @@ The scheduler runs at a fixed interval, called its heartbeat, in which it does a 1. Fetch the alert rules for all organizations (excluding disabled) 2. Start a goroutine (if this is a new alert rule or the scheduler has just started) to evaluate the alert rule -3. Send an `*evalContext` event to the goroutine for each alert rule if its interval has elapsed +3. Send an `*evaluation` event to the goroutine for each alert rule if its interval has elapsed 4. Stop the goroutines for all alert rules that have been deleted since the last heartbeat -The function that evaluates each alert rule is called `ruleRoutine`. It waits for an `*evalContext` event (sent each +The function that evaluates each alert rule is called `ruleRoutine`. It waits for an `*evaluation` event (sent each interval seconds elapsed and is configurable per alert rule) and then evaluates the alert rule. To ensure that the scheduler is evaluating the latest version of the alert rule it compares its local version of the alert rule with that -in the `*evalContext` event, fetching the latest version of the alert rule from the database if the version numbers +in the `*evaluation` event, fetching the latest version of the alert rule from the database if the version numbers mismatch. It then invokes the Evaluator which evaluates any queries, classic conditions or expressions in alert rule and passes the results of this evaluation to the State Manager. An evaluation can return no results in the case of NoData or Error, a single result in the case of classic conditions, or more than one result if the alert rule is