forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Logs Explorer] Add ability to create alerts within the Explorer app (e…
…lastic#175777) ## Summary Users in Logs Explorer should be able to define rules that will create alerts when the number of logs passes a certain threshold. As part of this issue, support for the new custom threshold rule will be added in the header. ## Screenshot <img width="1266" alt="Screenshot 2024-01-29 at 12 48 28" src="https://github.com/elastic/kibana/assets/190132/0a141fa9-726c-4a15-a085-f124d39071f2"> ## Notes for reviewers Apologies for the noise across multiple plugins but I tried to update the `RuleAddProps` type since it offered no type safety making it incredibly difficult and error prone to understand what properties are required for the selected rule type. The lack of type safety in the exposed alerting/rules related public APIs caused various bugs during integration, each dependant on specific conditions and requiring a lot of manual testing. I have tried to fix as many of these bugs as possible but had to base it mainly on trial and error due to the lack of correct typing with too many optional (but in reality required) properties. An example of this are filter badges in the universal search component. These were not displayed correctly due to missing props on the `FilterMeta` interface which are all marked as optional but somehow assumed to be there by the UI components that render them. Another issue was caused by implicit service dependencies with no validation in place by consuming components. An example of this is the `triggersActionsUi.getAddRuleFlyout` method which requires `unifiedSearch`, `dataViews`, `dataViewEditor` and `lens` services in React context but for the majority silently fails causing bugs only under specific conditions or when trying to carry out specific actions. Integration is made even more difficult since these can differ between different rule types. It would be great if these are made either explicit or if validation is put in place to warn developers of integration issues. There is also an existing bug in that filters displayed by the universal search component provide the ability to edit the filter but when attempting to do so and clicking "Update filter" to confirm nothing happens despite the `SearchBar.onFiltersUpdated` being defined. I have tested this behaviour in other integrations which all have the same bugs so am treating these as existing issues. ## Acceptance criteria - Add an `Alerts` item to the header that will include two options: - `Create rule` that will open the custom threshold rule flyout - `Manage rules` that will link to the observability rules management page (`app/observability/alerts/rules`) - Set default configuration that will be used in the flyout - The Ad Hoc data view that is created as part of the selector - The query from the KQL bar - Role visibility should be hidden --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Maryam Saeidi <[email protected]>
- Loading branch information
1 parent
5ab0240
commit 239b957
Showing
34 changed files
with
650 additions
and
153 deletions.
There are no files selected for viewing
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
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
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
95 changes: 95 additions & 0 deletions
95
...erver/integration_tests/__snapshots__/serverless_upgrade_and_rollback_checks.test.ts.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
8 changes: 7 additions & 1 deletion
8
...omponents/alert_details_app_section/__snapshots__/alert_details_app_section.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
Oops, something went wrong.