Skip to content
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

[DataViews] Evaluate switching ML alert rules to make use of DataViewLazy #173996

Closed
Tracked by #187772 ...
kertal opened this issue Dec 27, 2023 · 3 comments · Fixed by #189188
Closed
Tracked by #187772 ...

[DataViews] Evaluate switching ML alert rules to make use of DataViewLazy #173996

kertal opened this issue Dec 27, 2023 · 3 comments · Fixed by #189188
Assignees
Labels
Feature:Data Views Data Views code and UI - index patterns before 8.0 impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:needs-research This issue requires some research before it can be worked on or estimated :ml Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. technical debt Improvement of the software architecture and operational architecture v8.16.0

Comments

@kertal
Copy link
Member

kertal commented Dec 27, 2023

When DataViewLazy is implemented (#167750), ML based alerting rules should be evaluated to consume this new class. The benefit of it is that it's no longer triggering a request for fields (field_caps request to ES) when being initialized. When fields are not needed, this saves a lot of redundant requests to Elasticsearch. At the first sight it seems the DataView service is needed to get the fieldFormatMap. For this the requests for fields should not be necessary:

/**
* Attempts to find a data view based on the index pattern
*/
const getFieldsFormatMap = memoize(
async (indexPattern: string): Promise<Record<string, SerializedFieldFormat> | undefined> => {
try {
const dataViewsService = await getDataViewsService();
const dataViews = await dataViewsService.find(indexPattern);
const dataView = dataViews.find(({ title }) => title === indexPattern);
if (!dataView) return;
return dataView.fieldFormatMap;
} catch (e) {
return;
}
}

@kertal kertal added the Feature:Data Views Data Views code and UI - index patterns before 8.0 label Dec 27, 2023
@botelastic botelastic bot added the needs-team Issues missing a team label label Dec 27, 2023
@kertal kertal added :ml and removed needs-team Issues missing a team label labels Dec 27, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@kertal kertal added the Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. label Dec 27, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@kertal kertal added the technical debt Improvement of the software architecture and operational architecture label Dec 27, 2023
@kertal kertal added impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:needs-research This issue requires some research before it can be worked on or estimated labels Dec 27, 2023
@kertal kertal changed the title [DataViews] Evaluate switching ML alert rules to make use of DataViewLaze [DataViews] Evaluate switching ML alert rules to make use of DataViewLazy Dec 27, 2023
@darnautov darnautov self-assigned this Dec 28, 2023
@darnautov darnautov added v8.13.0 and removed v8.13.0 labels Jan 17, 2024
@kertal
Copy link
Member Author

kertal commented Apr 3, 2024

@darnautov this should be unblocked now since DataViewLazy was merged: #173948

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Data Views Data Views code and UI - index patterns before 8.0 impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:needs-research This issue requires some research before it can be worked on or estimated :ml Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. technical debt Improvement of the software architecture and operational architecture v8.16.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants