grafana/pkg
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
..
api Auth: Hide forgot password if grafana auth is disabled (#79895) 2024-01-04 10:46:55 +01:00
apis Storage: Support grafana.app/folder field selector & label selectors (#79816) 2023-12-21 18:08:01 -05:00
build Re-add arm32 builds (#79496) 2023-12-15 16:56:22 +02:00
bus Tracing: Standardize on otel tracing (#75528) 2023-10-03 14:54:20 +02:00
cmd Chore: Bump k8s dependencies to v0.29.0 (#79492) 2023-12-14 10:00:48 -05:00
codegen Chore: use any rather than interface{} (#74066) 2023-08-30 18:46:47 +03:00
components K8s: fix standalone command and add hack scripts (#79052) 2023-12-05 14:31:49 -08:00
cuectx Perf: Disable core kind registry (#78568) 2023-11-28 09:09:54 +01:00
events
expr SSE: Add utility methods for HysteresisCommand (#79157) 2023-12-11 22:40:31 +02:00
extensions Chore: Replace gofpdf (#75805) 2023-10-02 15:32:35 +02:00
ifaces/gcsifaces
infra ServerLock: Fix missing return ID for postgres (#79878) 2023-12-28 11:15:18 +01:00
kinds Transformations: Add frame source picker to allow transforming annotations (#77842) 2024-01-02 23:33:31 -06:00
kindsysreport K8s/Folders: Add folders api service (with legacy storage) (#79413) 2023-12-20 20:28:56 +02:00
login/social Auth: Add basic validation for SSO settings (#79696) 2024-01-03 10:02:03 +02:00
middleware Frontend: Reload the browser when backend configuration/assets change (#79057) 2024-01-04 08:00:07 +01:00
mocks/mock_gcsifaces Chore: use any rather than interface{} (#74066) 2023-08-30 18:46:47 +03:00
models
modules Storage: Unified Storage based on Entity API (#71977) 2023-12-06 15:21:21 -05:00
plugins Dependencies: Bump github.com/grafana/grafana-plugin-sdk-go from v0.197.0 to v0.198.0 (#79928) 2024-01-03 13:36:44 +02:00
registry Storage: Support grafana.app/folder field selector & label selectors (#79816) 2023-12-21 18:08:01 -05:00
server Auth: Use SSO settings service to load social connectors + refactor (#79005) 2023-12-08 11:20:42 +01:00
services Alerting: Support hysteresis command expression (#75189) 2024-01-04 11:47:13 -05:00
setting Auth: Hide forgot password if grafana auth is disabled (#79895) 2024-01-04 10:46:55 +01:00
tests Alerting: Support hysteresis command expression (#75189) 2024-01-04 11:47:13 -05:00
tsdb Pyroscope: Send start/end with profile types query (#77523) 2024-01-04 16:35:47 +01:00
util Chore: Remove mssql driver from xorm (#79930) 2024-01-02 17:11:35 +01:00
web Chore: Upgrade Go to 1.21.3 (#77304) 2023-11-01 09:17:38 -07:00
README.md
ruleguard.rules.go

This directory contains the code for the Grafana backend.

The contributor documentation for Grafana's backend is in /contribute/backend/README.md.