grafana/pkg/services/ngalert/state
Alexander Weaver cc8c1380e2
Alerting: Persist annotations from multidimensional rules in batches (#56575)
* Reduce piecemeal state fields

* Read data directly off state instead of rule

* Unify state and context into single struct

* Expose contextual information to layer above setNextState

* Work in terms of ContextualState and call historian in batches

* Call annotations service in batches

* Export format state and reason and remove workaround in unrelated test package

* Add new method to annotation service for batch inserting

* Fix loop variable aliasing bug caught by linter, didn't change behavior

* Incl timerange on annotation tests

* Insert one at a time if tags are present

* Point to rule from ContextualState rather than copy fields

* Build annotations and copy data prior to starting goroutine

* Rename to StateTransition

* Use new bulk-insert utility

* Remove rule from StateTransition and pass in directly to historian

* Simplify annotations logic since we have only one rule

* Fix logs and context, nilcheck, simplify method name

* Regenerate mock
2022-11-04 10:39:26 -05:00
..
historian Alerting: Persist annotations from multidimensional rules in batches (#56575) 2022-11-04 10:39:26 -05:00
cache_test.go Alerting: Refactor state manager's cache (#56197) 2022-10-06 15:30:12 -04:00
cache.go Alerting: Improve logs in state manager and historian (#57374) 2022-10-21 16:16:51 -05:00
manager_private_test.go Alerting: Fix screenshot is not taken for stale series (#57982) 2022-11-02 22:14:22 +00:00
manager_test.go Alerting: Add values to annotations (#57738) 2022-11-03 10:35:34 +01:00
manager.go Alerting: Persist annotations from multidimensional rules in batches (#56575) 2022-11-04 10:39:26 -05:00
persist.go Alerting: Persist annotations from multidimensional rules in batches (#56575) 2022-11-04 10:39:26 -05:00
state_test.go Alerting: Fix screenshot is not taken for stale series (#57982) 2022-11-02 22:14:22 +00:00
state.go Alerting: Persist annotations from multidimensional rules in batches (#56575) 2022-11-04 10:39:26 -05:00
template_test.go Chore: Remove context.TODO (#43458) 2021-12-28 10:26:18 +01:00
template.go Chore: Remove context.TODO (#43458) 2021-12-28 10:26:18 +01:00
testing.go Alerting: Persist annotations from multidimensional rules in batches (#56575) 2022-11-04 10:39:26 -05:00