grafana/pkg/services/ngalert/models
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_test.go Alerting: Remove url based external alertmanagers config (#57918) 2022-11-10 16:34:13 +01:00
admin_configuration.go Alerting: Remove url based external alertmanagers config (#57918) 2022-11-10 16:34:13 +01:00
alert_query_test.go Alerting: Support hysteresis command expression (#75189) 2024-01-04 11:47:13 -05:00
alert_query.go Alerting: Support hysteresis command expression (#75189) 2024-01-04 11:47:13 -05:00
alert_rule_test.go Chore: use any rather than interface{} (#74066) 2023-08-30 18:46:47 +03:00
alert_rule.go Alerting: In migration, create one label per channel (#76527) 2023-12-19 13:25:13 -05:00
alertmanager.go Chore: Simplify function signature for GetLatestAlertmanagerConfiguration (#79392) 2023-12-12 13:49:54 +01:00
constants.go Plugins: Automatically forward plugin request HTTP headers in outgoing HTTP requests (#60417) 2022-12-21 13:25:58 +01:00
history.go NGAlerting: Use identity.Requester interface instead of SignedInUser (#76360) 2023-11-14 14:47:34 +00:00
image_test.go Alerting: Fix test fails in some environments (#58251) 2022-11-07 16:34:37 +00:00
image.go Alerting: Fix test fails in some environments (#58251) 2022-11-07 16:34:37 +00:00
instance_labels.go Alerting: Write and Delete multiple alert instances. (#55350) 2022-10-06 14:22:58 +08:00
instance_test.go Alerting: Add alert pausing feature (#60734) 2023-01-26 18:29:10 +01:00
instance.go Alerting: Support hysteresis command expression (#75189) 2024-01-04 11:47:13 -05:00
provisioning.go Drop ProvenanceOrgAdapter and build into store API instead (#48137) 2022-04-26 10:30:57 -05:00
testing.go Alerting: Support hysteresis command expression (#75189) 2024-01-04 11:47:13 -05:00
time.go Alerting: Fix test fails in some environments (#58251) 2022-11-07 16:34:37 +00:00