-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ML] AIOps: Fix grouping for fields with large arrays. (#177438)
## Summary Fixes edge cases for datasets with large arrays within single fields: - Deduplicates groups as a final step of creating groups. - Limits how many values (50) to use per field for the `frequent_item_sets` aggregations. - Fixes the `should` clauses for the query for `frequent_item_sets`, the previous version of the query could be too narrow for fields with arrays and return no results. - For the fallback analysis when either deviation or baseline returns no docs, increases the limit from 10 to 100 docs. - It turned out the grouping for array values of fields had another bug: Because we treated the field/values of a group as a dictionary/record like structure, this didn't hold multiple values for a single field. The code was changed in this PR so it is an array of field/value pairs which now supports multiple values per field. - On the client side, fixes unique keys for the group item badges if there's multiple items for the same field. Adds API integration tests for a dataset with large arrays. This dataset also triggers slowness of the `frequent_item_sets` agg and can be used for a performance journey in a follow up. Without the new limit for how many values per field to use, these new tests would fail because the agg cases a timeout. The assertions for chunk and action lengths were removed because they are flaky for longer running requests (because of how we implemented flush fix and keep alive behavior). Dataset to test behavior: [aiops-lra-frequent-items-array.ndjson.zip](https://github.com/elastic/kibana/files/14362105/aiops-lra-frequent-items-array.ndjson.zip) Without this PR, the dataset would cause the grouping part of log rate analysis to time out. With this PR, it's still slow for just 18 docs, but it is able to return results. Video to replicate the test: Upload via ML File Upload, Adjust the date picker in Log Rate Analysis, then run the analysis. [aiops-log-rate-analysis-arrays-0001.webm](https://github.com/elastic/kibana/assets/230104/5d5ce34b-37ef-4e9f-81ae-f8002c194f88) ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [x] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- Loading branch information
Showing
22 changed files
with
2,780 additions
and
199 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
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.