[Discover] Enable threshold alerts #117532
Labels
Feature:Alerting
Feature:Discover
Discover Application
Meta
Team:DataDiscovery
Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph)
We want to enable threshold alerts in Discover. Those should be able to take a configured search (filter/query) in Discover and allow to setup an alert that will trigger if the value of found documents is above or below a configured threshold.
We want to approach the implementation in 3 phases:
Phase 1 - POC
It's done, here's the POC #117830
Phase 2 - RFC
To enable the creation of an alert rule in Discover we will extend the given
Elasticsearch query rule
. This rule will be extended by the use of searchSource for data fetching (This means it's using data view, query, and filters). It allows us to link back to Discover, showing the document that triggered the alert notification. The alert rule can’t be edited in Discover, but in Stack management. In the MVP it’s not possible to edit searchSource parameters (data view, query, filter) once they are displayed in the flyout, due to the complexity of implementing filter editing in the user interface. This for sure should be provided in a follow up iteration.Alert rule parameters
We will extend the
Elasticsearch query rule
by 2 parametersUI in Discover
There will be a new top navigation link, called "Alerts". This should open a popover containing 2 links
When the user selects Create threshold rule, a searchSource object containing the current data view, query, and filters is serialized and used to initialize the flyout containing the form to create the rule. Editing those parameters in the background is no longer propagated to the flyout. There’s also no link to a saved search stored. Of the original Elasticsearch query rule the selection of INDEX and Elasticsearch query should not be displayed in the UI since they are not needed. Once opening the flyout, the user cannot edit Data View, Query, Filter. With a click on “Save” the new rule is persisted, and can be viewed in “Stack Management / Rules and Connectors”.
UI in Stack Management
In Stack Management / Rules and Connectors users can view and edit the rule (but not data view, query and filters). When showing the details page of the rule, the “View in app” link should link back to Discover using the query, filters, data view of the rule in the current time range (when searchType is searchSource).
An Elasticsearch query rule of searchType esQuery should look like before.
Server side: Alert rule executor
The rule alert executor needs to be extended to also work with
searchSource
.Linking back to Discover
If the rule was based on searchSource, users could add a link to Discover, in the other case for the esQuery rule type it should link to the rule details page.
Internally the link contains the ruleId, the absolute time range (from, to) and a checksum of the actual rule configuration (searchSource + threshold settings). It will look like this:
{publicUrlOfDiscover}#/viewAlert/{$ruleId}?from={$from}&to={$to}&checksum={$checksum}
We will add a new route to the Discover plugin that’s taking care of handling this link.
This route fetches the rule by ruleId. The checksum is used to determine if there were changes in the meantime. The viewAlert route would use the rule’s configuration and the given time range to forward to the main view that should show the documents that triggered the alert notification. In the case the checksum indicates that the rule params has been changed, there should be a warning displayed that the documents displayed might not match the documents triggering the notification since there have been changes to the rule configuration in the meantime.
If the checksum matches a different notification should be displayed, because the displayed documents might also be different to the documents that triggered the alert due to more ingested, indexed or deleted documents
Phase 3 - Implementation
#124534
Phase 4 - Add editing capability
Note: As of March 23, the likely plan is to ship V1 in 8.3 where we also discussed addressing the lack of support for editing.
The text was updated successfully, but these errors were encountered: