grafana/pkg/services/ngalert/state/historian
William Wernert 48b5ac779b
Alerting/Annotations: Add annotation backend for Loki alert state history (#78156)
* Move scope type vars to testutil package

* Expose parts of state historian for use in annotation backend

* Implement Loki ASH Annotation store

This store will only implement the `Get` method of a RepositoryImpl since alert state history
writes to Loki elsewhere.

* Use interface for Loki HTTP Client

* Add tests for Loki ASH Annotation store

* Add missing test

* Fix lint

* Organize tests

* Add filter tests

* Improve tests

* Move filter logic into outer function

* Fix lint

* Add comment

* Fix tests

* Fix lint

* Rename historian store + refactor

* Cleanup historian store

* Fix tests

* Minor cleanup

* Use new `ShouldRecordAnnotation` filter

* Fix logic and add tests for this check

* Fix typos, remove unused variables, `< 1` -> `== 0`

* More closely mimic RBAC filter from xorm to ensure correct logic

* Move off weaveworks client

* Address PR comments
2024-01-10 18:42:35 -05:00
..
model Alerting: Capture refID of rule's condition expression in Loki state history entries (#66419) 2023-04-18 14:21:28 -05:00
annotation_store.go Alerting: Refactor annotation historian to isolate dashboard service dependency (#71689) 2023-07-18 08:18:55 -05:00
annotation_test.go Alerting: Fix URL timestamp conversion in historian API in annotation mode (#80026) 2024-01-04 12:40:21 -06:00
annotation.go Alerting/Annotations: Add annotation backend for Loki alert state history (#78156) 2024-01-10 18:42:35 -05:00
backend.go Alerting: Delete stub for SQL alert state history backend (#65667) 2023-03-31 11:15:56 -05:00
core_test.go Alerting/Annotations: Add annotation backend for Loki alert state history (#78156) 2024-01-10 18:42:35 -05:00
core.go Alerting/Annotations: Add annotation backend for Loki alert state history (#78156) 2024-01-10 18:42:35 -05:00
dashboard_test.go Chore: Fix goimports grouping in alerting (#62424) 2023-01-30 09:55:35 +01:00
dashboard.go Chore: Fix goimports grouping in alerting (#62424) 2023-01-30 09:55:35 +01:00
encode.go Alerting: Make alert state history Loki http client public (#78291) 2023-11-27 09:20:50 -05:00
loki_http_test.go Alerting: Add metrics to the remote Alertmanager struct (#79835) 2024-01-10 11:18:24 +01:00
loki_http.go Alerting: Add metrics to the remote Alertmanager struct (#79835) 2024-01-10 11:18:24 +01:00
loki_test.go Alerting/Annotations: Add annotation backend for Loki alert state history (#78156) 2024-01-10 18:42:35 -05:00
loki.go Alerting/Annotations: Add annotation backend for Loki alert state history (#78156) 2024-01-10 18:42:35 -05:00
multiple_test.go Alerting: Create new state history "fanout" backend that dispatches to multiple other backends at once (#64774) 2023-03-17 12:41:18 -05:00
multiple.go Vendor errors.Join from Go standard library to avoid version incompatibilities (#64985) 2023-03-17 14:07:58 -05:00
noop.go Alerting: Create new state history "fanout" backend that dispatches to multiple other backends at once (#64774) 2023-03-17 12:41:18 -05:00
query.go Alerting: Create new state history "fanout" backend that dispatches to multiple other backends at once (#64774) 2023-03-17 12:41:18 -05:00
testing.go Alerting: Expose Prometheus metrics for persisting state history (#63157) 2023-03-06 10:40:37 -06:00