-
Notifications
You must be signed in to change notification settings - Fork 11.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alerting: Add smart type selection when creating a new alert rule #71071
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a4e3ae4
to
aebdf20
Compare
aebdf20
to
26857af
Compare
...lerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx
Outdated
Show resolved
Hide resolved
VikaCep
reviewed
Jul 5, 2023
...lerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx
Outdated
Show resolved
Hide resolved
...lerting/unified/components/rule-editor/query-and-alert-condition/CloudDataSourceSelector.tsx
Outdated
Show resolved
Hide resolved
...lerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx
Outdated
Show resolved
Hide resolved
ab9d664
to
4d5ffc1
Compare
konrad147
reviewed
Jul 12, 2023
...lerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx
Outdated
Show resolved
Hide resolved
...alerting/unified/components/rule-editor/query-and-alert-condition/SmartAlertTypeDetector.tsx
Outdated
Show resolved
Hide resolved
...alerting/unified/components/rule-editor/query-and-alert-condition/SmartAlertTypeDetector.tsx
Outdated
Show resolved
Hide resolved
...alerting/unified/components/rule-editor/query-and-alert-condition/SmartAlertTypeDetector.tsx
Outdated
Show resolved
Hide resolved
konrad147
reviewed
Jul 12, 2023
...alerting/unified/components/rule-editor/query-and-alert-condition/SmartAlertTypeDetector.tsx
Outdated
Show resolved
Hide resolved
gillesdemey
reviewed
Jul 12, 2023
...alerting/unified/components/rule-editor/query-and-alert-condition/SmartAlertTypeDetector.tsx
Outdated
Show resolved
Hide resolved
...alerting/unified/components/rule-editor/query-and-alert-condition/SmartAlertTypeDetector.tsx
Outdated
Show resolved
Hide resolved
...alerting/unified/components/rule-editor/query-and-alert-condition/SmartAlertTypeDetector.tsx
Outdated
Show resolved
Hide resolved
...alerting/unified/components/rule-editor/query-and-alert-condition/SmartAlertTypeDetector.tsx
Show resolved
Hide resolved
...alerting/unified/components/rule-editor/query-and-alert-condition/SmartAlertTypeDetector.tsx
Outdated
Show resolved
Hide resolved
...lerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx
Outdated
Show resolved
Hide resolved
...lerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx
Outdated
Show resolved
Hide resolved
...lerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx
Outdated
Show resolved
Hide resolved
...lerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx
Show resolved
Hide resolved
...lerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx
Outdated
Show resolved
Hide resolved
gillesdemey
reviewed
Jul 12, 2023
...lerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx
Show resolved
Hide resolved
gillesdemey
approved these changes
Jul 12, 2023
dhalachliyski
approved these changes
Jul 13, 2023
polibb
pushed a commit
that referenced
this pull request
Jul 14, 2023
…1071) * Add smart type selection when creating a new alert rule * Auto switch when switch button has not been clicked yet * remove unnecessay code after the last refacgtor * Refactor * Remove unneeded prop * Move SmartAlertTypeDetector to its own file * Fix tests * Refactor: new useSetExpressionAndDataSource hook * Fix expressions not been propagated when switching from one type to another * Change texts * Update tests * Update text in switch button * Update texts and tests * Refactor: move code to getCanSwitch new method * Move smart alert after queries and remove auto-switch * Remove expressions and restore them when switching between grafana and cloud type * Rename previous expression state * Fix tests * Add data source name for data source-managed alert selection * Update reducer when changing cloud data source * PR review suggestions * PR review suggestions 2nd part * PR review suggestions 3th part * Fix canSwitch * Update texts on smart alert --------- Co-authored-by: Virginia Cepeda <virginia.cepeda@grafana.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
add to changelog
add to what's new
area/alerting
Grafana Alerting
area/frontend
kata:alert-rule-creation
no-backport
Skip backport of PR
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is this feature?
This pull request introduces a switch button for rule type based on the user's selected queries.
In order to accomplish this, it is necessary to ensure that the cloud alert data (currently managed by the form data) and the grafana-managed alert data (currently managed by the reducer) remain synchronized.
Why do we need this feature?
We aim to simplify the user experience by letting the user be focused on the query or queries they want to use to create the alert, and afterwards, allowing or not to switch the alert rule type.
Who is this feature for?
All users
Which issue(s) does this PR fix?:
Fixes #68099
Special notes for your reviewer:
When creating a new alert rule:
new-smart.mov
When editing existing one:
editing-smart.mp4
(updated texts in last commit)
When editing existing rule:
When creating a new alert rule
Please check that: