Alerting: Matching instances preview for notification policies (#68882)
* Basic implementation in web worker * Move instances discovery to the worker * Remove filtering from the worker * Use normalized routes, use rtk query for alert groups fetching * Reorganize matchers utilities to be available for web workers * Move object matchers to the machers util file, rename worker * Move worker code to a separate hook, add perf logging * Add a mock for the web worker code, fix tests * Fix tests warnings * Remove notification policy feature flag * Add normalizeRoute tests, change the regex match to test for label matching * Move worker init to the file scope * Simplify useAsyncFn hook * Use CorsWorker as a workaround for web workers loading from CDN * Use a feature flag to enable/disable worker-based preview, add worker error handling * Add POC for react-enable working with grafana feature toggles * Code cleanup * Remove console error, add useRouteGroupsMatcher tests * Fix tests mock
This commit is contained in:
@@ -435,6 +435,14 @@ var (
|
||||
State: FeatureStateAlpha,
|
||||
Owner: grafanaAlertingSquad,
|
||||
},
|
||||
{
|
||||
Name: "alertingNotificationsPoliciesMatchingInstances",
|
||||
Description: "Enables the preview of matching instances for notification policies",
|
||||
State: FeatureStateStable,
|
||||
FrontendOnly: true,
|
||||
Expression: "true", // enabled by default
|
||||
Owner: grafanaAlertingSquad,
|
||||
},
|
||||
{
|
||||
Name: "alertStateHistoryLokiPrimary",
|
||||
Description: "Enable a remote Loki instance as the primary source for state history reads.",
|
||||
|
||||
@@ -63,6 +63,7 @@ lokiMetricDataplane,stable,@grafana/observability-logs,false,false,false,false
|
||||
dataplaneFrontendFallback,stable,@grafana/observability-metrics,false,false,false,true
|
||||
disableSSEDataplane,alpha,@grafana/observability-metrics,false,false,false,false
|
||||
alertStateHistoryLokiSecondary,alpha,@grafana/alerting-squad,false,false,false,false
|
||||
alertingNotificationsPoliciesMatchingInstances,stable,@grafana/alerting-squad,false,false,false,true
|
||||
alertStateHistoryLokiPrimary,alpha,@grafana/alerting-squad,false,false,false,false
|
||||
alertStateHistoryLokiOnly,alpha,@grafana/alerting-squad,false,false,false,false
|
||||
unifiedRequestLog,alpha,@grafana/backend-platform,false,false,false,false
|
||||
|
||||
|
@@ -263,6 +263,10 @@ const (
|
||||
// Enable Grafana to write alert state history to an external Loki instance in addition to Grafana annotations.
|
||||
FlagAlertStateHistoryLokiSecondary = "alertStateHistoryLokiSecondary"
|
||||
|
||||
// FlagAlertingNotificationsPoliciesMatchingInstances
|
||||
// Enables the preview of matching instances for notification policies
|
||||
FlagAlertingNotificationsPoliciesMatchingInstances = "alertingNotificationsPoliciesMatchingInstances"
|
||||
|
||||
// FlagAlertStateHistoryLokiPrimary
|
||||
// Enable a remote Loki instance as the primary source for state history reads.
|
||||
FlagAlertStateHistoryLokiPrimary = "alertStateHistoryLokiPrimary"
|
||||
|
||||
Reference in New Issue
Block a user