mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Add exported API to scheduler to access currently loaded rules (#82031)
* Add exported API to fetch rule definitions from scheduler * Add comment
This commit is contained in:
parent
9fb04be7ff
commit
843c477899
@ -155,6 +155,13 @@ func (sch *schedule) Run(ctx context.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Rules fetches the entire set of rules considered for evaluation by the scheduler on the next tick.
|
||||
// Such rules are not guaranteed to have been evaluated by the scheduler.
|
||||
// Rules returns all supplementary metadata for the rules that is stored by the scheduler - namely, the set of folder titles.
|
||||
func (sch *schedule) Rules() ([]*ngmodels.AlertRule, map[ngmodels.FolderKey]string) {
|
||||
return sch.schedulableAlertRules.all()
|
||||
}
|
||||
|
||||
// deleteAlertRule stops evaluation of the rule, deletes it from active rules, and cleans up state cache.
|
||||
func (sch *schedule) deleteAlertRule(keys ...ngmodels.AlertRuleKey) {
|
||||
for _, key := range keys {
|
||||
|
Loading…
Reference in New Issue
Block a user