prometheus/rules
gotjosh 4daaa59c08
Rule Manager: Only query once per alert rule when restoring alert state
Prometheus restores alert state between restarts and updates. For each rule, it looks at the alerts that are meant to be active and then queries the `ALERTS_FOR_STATE` series for _each_ alert within the rules.

If the alert rule has 120 instances (or series) it'll execute the same query with slightly different labels.

This PR changes the approach so that we only query once per alert rule and then match the corresponding alert that we're about to restore against the series-set. While the approach might use a bit more memory at start-up (if even?) the restore proccess is only ran once per restart so I'd consider this a big win.

This builds on top of #13974

Signed-off-by: gotjosh <josue.abreu@gmail.com>
2024-04-24 18:46:05 +01:00
..
fixtures Block until all rules, both sync & async, have completed evaluating 2024-01-29 10:08:41 +01:00
alerting.go Rule Manager: Only query once per alert rule when restoring alert state 2024-04-24 18:46:05 +01:00
alerting_test.go Support expansion of native histogram values in alert templates 2024-03-26 22:30:01 +01:00
group.go Rule Manager: Only query once per alert rule when restoring alert state 2024-04-24 18:46:05 +01:00
manager.go Allow using alternative PromQL engines for rule evaluation 2024-03-06 14:54:33 +11:00
manager_test.go golangci-lint: enable whitespace linter (#13905) 2024-04-11 09:27:54 +01:00
origin.go Decouple ruler dependency controller from concurrency controller 2024-02-02 10:06:37 +01:00
origin_test.go Decouple ruler dependency controller from concurrency controller 2024-02-02 10:06:37 +01:00
recording.go Decouple ruler dependency controller from concurrency controller 2024-02-02 10:06:37 +01:00
recording_test.go Tests: use replacement DeepEquals using go-cmp 2024-02-08 19:30:20 +00:00
rule.go Decouple ruler dependency controller from concurrency controller 2024-02-02 10:06:37 +01:00