grafana/pkg/services/ngalert/store
Yuri Tseretyan f6a46744a6
Alerting: Support hysteresis command expression (#75189)
Backend: 

* Update the Grafana Alerting engine to provide feedback to HysteresisCommand. The feedback information is stored in state.Manager as a fingerprint of each state. The fingerprint is persisted to the database. Only fingerprints that belong to Pending and Alerting states are considered as "loaded" and provided back to the command.
   - add ResultFingerprint to state.State. It's different from other fingerprints we store in the state because it is calculated from the result labels.
  -  add rule_fingerprint column to alert_instance
   - update alerting evaluator to accept AlertingResultsReader via context, and update scheduler to provide it.
   - add AlertingResultsFromRuleState that implements the new interface in eval package
   - update getExprRequest to patch the hysteresis command.

* Only one "Recovery Threshold" query is allowed to be used in the alert rule and it must be the Condition.


Frontend:

* Add hysteresis option to Threshold in UI. It's called "Recovery Threshold"
* Add test for getUnloadEvaluatorTypeFromCondition
* Hide hysteresis in panel expressions

* Refactor isInvalid and add test for it
* Remove unnecesary React.memo
* Add tests for updateEvaluatorConditions

---------

Co-authored-by: Sonia Aguilar <soniaaguilarpeiron@gmail.com>
2024-01-04 11:47:13 -05:00
..
admin_configuration_store_mock.go Chore: use any rather than interface{} (#74066) 2023-08-30 18:46:47 +03:00
admin_configuration.go chore: remove sqlstore & mockstore dependencies from (most) packages (#57087) 2022-10-19 09:02:15 -04:00
alert_rule_test.go Alerting: Fix deleting rules in a folder with matching UID in another organization (#78258) 2023-12-04 11:34:38 +02:00
alert_rule.go Alerting: Drop NamespaceID from responses on unstable ngalert API endpoints in favor of NamespaceUID (#79359) 2023-12-15 11:06:53 -06:00
alertmanager_test.go Chore: Simplify function signature for GetLatestAlertmanagerConfiguration (#79392) 2023-12-12 13:49:54 +01:00
alertmanager.go Chore: Simplify function signature for GetLatestAlertmanagerConfiguration (#79392) 2023-12-12 13:49:54 +01:00
database.go Chore: Simplify function signature for GetLatestAlertmanagerConfiguration (#79392) 2023-12-12 13:49:54 +01:00
deltas_test.go Chore: Deprecate ID from Folder (#78281) 2023-11-20 15:44:51 -05:00
deltas.go Chore: Remove result fields from ngalert (#65410) 2023-03-28 10:34:35 +02:00
image_test.go Alerting: Use URLs in image annotations (#66804) 2023-04-26 13:06:18 -03:00
image.go Alerting: Bump grafana/alerting and refactor the ImageStore/Provider to provide image URL/bytes (#70182) 2023-06-21 20:53:30 -03:00
instance_database_test.go Alerting: Remove and revert flag alertingBigTransactions (#65976) 2023-04-06 18:06:25 +02:00
instance_database.go Alerting: Support hysteresis command expression (#75189) 2024-01-04 11:47:13 -05:00
org.go chore: remove sqlstore & mockstore dependencies from (most) packages (#57087) 2022-10-19 09:02:15 -04:00
provisioning_store_test.go Chore: Fix goimports grouping in alerting (#62424) 2023-01-30 09:55:35 +01:00
provisioning_store.go chore: remove sqlstore & mockstore dependencies from (most) packages (#57087) 2022-10-19 09:02:15 -04:00
range_to_instant_test.go Alerting: Apply query optimization to eval endpoints (#78566) 2023-11-28 19:44:28 -05:00
range_to_instant.go Alerting: Apply query optimization to eval endpoints (#78566) 2023-11-28 19:44:28 -05:00
testing.go Alerting: Bump grafana/alerting and refactor the ImageStore/Provider to provide image URL/bytes (#70182) 2023-06-21 20:53:30 -03:00
transactions.go Alerting: Provisioning API - Notification Policies (#46755) 2022-04-05 16:48:51 -05:00