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

[ML] AIOps: Tweak function API for fetchTopCategories/fetchTopTerms #189863

Conversation

walterra
Copy link
Contributor

@walterra walterra commented Aug 5, 2024

Summary

Follow up to #187669.
Part of #187684.
Fixes #176387. (Ran the flaky test runner on AIOps functional tests)

  • Fixes the size: 0 option to be properly nested for createCategoryRequest().
  • Changes the arguments structure for fetchTopCategories and fetchTopTerms from individual arguments to an options object to be more in line with the other functions used for log rate analysis.
  • Adds jest unit test for fetchTopCategories and fetchTopTerms.

Checklist

@walterra walterra added :ml release_note:skip Skip the PR/issue when compiling release notes Feature:ML/AIOps ML AIOps features: Change Point Detection, Log Pattern Analysis, Log Rate Analysis v8.16.0 labels Aug 5, 2024
@walterra walterra self-assigned this Aug 5, 2024
@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#6680

[✅] x-pack/test/api_integration/apis/aiops/config.ts: 25/25 tests passed.
[✅] x-pack/test/functional/apps/aiops/config.ts: 25/25 tests passed.

see run history

@walterra walterra changed the title [ML] AIOps: Tweak function API for topItemsHandler/fetchTopCategories [ML] AIOps: Tweak function API for fetchTopCategories/fetchTopItems Aug 5, 2024
@walterra walterra marked this pull request as ready for review August 5, 2024 11:52
@walterra walterra requested a review from a team as a code owner August 5, 2024 11:52
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@walterra walterra added the bug Fixes for quality problems that affect the customer experience label Aug 5, 2024
@walterra walterra changed the title [ML] AIOps: Tweak function API for fetchTopCategories/fetchTopItems [ML] AIOps: Tweak function API for fetchTopCategories/fetchTopTerms Aug 5, 2024
@@ -183,15 +185,17 @@ export const topItemsHandlerFactory =
} else if (isTextFieldCandidates(payload)) {
const { textFieldCandidates: fieldNames } = payload;

const topCategoriesForField = await await fetchTopCategories(
const topCategoriesForField = await await fetchTopCategories({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this double await still needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for spotting this!! Fixed in 014746c.

@alvarezmelissa87
Copy link
Contributor

Code LGTM ✅ - just left a small question.

Copy link
Member

@jgowdyelastic jgowdyelastic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, LGTM.
Not related to this PR, but I noticed when testing that we could now update the icon for the View in Log Pattern Analysis link to be logPatternAnalysis

image

@walterra
Copy link
Contributor Author

walterra commented Aug 6, 2024

@jgowdyelastic 👍 added an item to the meta issue about updating the icon: #187684

@walterra
Copy link
Contributor Author

walterra commented Aug 7, 2024

I had to revert the change to only get 10 top items back to 100. Turned out it would no longer be able to come up with groups for one of the example datasets (large_arrays). I'll revisit this in a separate PR.

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @walterra

@walterra walterra merged commit 0a01fdd into elastic:main Aug 7, 2024
20 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Aug 7, 2024
@walterra walterra deleted the ml-aiops-log-rate-analysis-tweak-top-categories branch August 7, 2024 18:52
@walterra walterra restored the ml-aiops-log-rate-analysis-tweak-top-categories branch August 7, 2024 18:52
@walterra walterra deleted the ml-aiops-log-rate-analysis-tweak-top-categories branch August 7, 2024 18:52
walterra added a commit that referenced this pull request Oct 25, 2024
…197760)

## Summary

Follow up to #189863 and #196585.
Related to #176387.

This updates asserting the url state for log rate analysis with a query
and reenables the functional tests.

### 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#_add_your_labels)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 25, 2024
…lastic#197760)

## Summary

Follow up to elastic#189863 and elastic#196585.
Related to elastic#176387.

This updates asserting the url state for log rate analysis with a query
and reenables the functional tests.

### 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#_add_your_labels)

(cherry picked from commit 6ef0369)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 25, 2024
…lastic#197760)

## Summary

Follow up to elastic#189863 and elastic#196585.
Related to elastic#176387.

This updates asserting the url state for log rate analysis with a query
and reenables the functional tests.

### 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#_add_your_labels)

(cherry picked from commit 6ef0369)
kibanamachine added a commit that referenced this pull request Oct 25, 2024
…lysis (#197760) (#197795)

# Backport

This will backport the following commits from `main` to `8.16`:
- [[ML] AIOps: Fix and reenable functional tests for log rate analysis
(#197760)](#197760)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Walter
Rafelsberger","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-25T10:18:24Z","message":"[ML]
AIOps: Fix and reenable functional tests for log rate analysis
(#197760)\n\n## Summary\r\n\r\nFollow up to #189863 and
#196585.\r\nRelated to #176387.\r\n\r\nThis updates asserting the url
state for log rate analysis with a query\r\nand reenables the functional
tests.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [x] This was checked for breaking
API changes and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)","sha":"6ef03697460aba0d3774c0c03fb7fb58c76c00bd","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":[":ml","release_note:skip","v9.0.0","Feature:ML/AIOps","v8.16.0","backport:version","v8.17.0"],"title":"[ML]
AIOps: Fix and reenable functional tests for log rate
analysis","number":197760,"url":"https://github.com/elastic/kibana/pull/197760","mergeCommit":{"message":"[ML]
AIOps: Fix and reenable functional tests for log rate analysis
(#197760)\n\n## Summary\r\n\r\nFollow up to #189863 and
#196585.\r\nRelated to #176387.\r\n\r\nThis updates asserting the url
state for log rate analysis with a query\r\nand reenables the functional
tests.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [x] This was checked for breaking
API changes and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)","sha":"6ef03697460aba0d3774c0c03fb7fb58c76c00bd"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197760","number":197760,"mergeCommit":{"message":"[ML]
AIOps: Fix and reenable functional tests for log rate analysis
(#197760)\n\n## Summary\r\n\r\nFollow up to #189863 and
#196585.\r\nRelated to #176387.\r\n\r\nThis updates asserting the url
state for log rate analysis with a query\r\nand reenables the functional
tests.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [x] This was checked for breaking
API changes and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)","sha":"6ef03697460aba0d3774c0c03fb7fb58c76c00bd"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Walter Rafelsberger <[email protected]>
kibanamachine added a commit that referenced this pull request Oct 25, 2024
…ysis (#197760) (#197796)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[ML] AIOps: Fix and reenable functional tests for log rate analysis
(#197760)](#197760)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Walter
Rafelsberger","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-25T10:18:24Z","message":"[ML]
AIOps: Fix and reenable functional tests for log rate analysis
(#197760)\n\n## Summary\r\n\r\nFollow up to #189863 and
#196585.\r\nRelated to #176387.\r\n\r\nThis updates asserting the url
state for log rate analysis with a query\r\nand reenables the functional
tests.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [x] This was checked for breaking
API changes and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)","sha":"6ef03697460aba0d3774c0c03fb7fb58c76c00bd","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":[":ml","release_note:skip","v9.0.0","Feature:ML/AIOps","v8.16.0","backport:version","v8.17.0"],"title":"[ML]
AIOps: Fix and reenable functional tests for log rate
analysis","number":197760,"url":"https://github.com/elastic/kibana/pull/197760","mergeCommit":{"message":"[ML]
AIOps: Fix and reenable functional tests for log rate analysis
(#197760)\n\n## Summary\r\n\r\nFollow up to #189863 and
#196585.\r\nRelated to #176387.\r\n\r\nThis updates asserting the url
state for log rate analysis with a query\r\nand reenables the functional
tests.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [x] This was checked for breaking
API changes and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)","sha":"6ef03697460aba0d3774c0c03fb7fb58c76c00bd"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197760","number":197760,"mergeCommit":{"message":"[ML]
AIOps: Fix and reenable functional tests for log rate analysis
(#197760)\n\n## Summary\r\n\r\nFollow up to #189863 and
#196585.\r\nRelated to #176387.\r\n\r\nThis updates asserting the url
state for log rate analysis with a query\r\nand reenables the functional
tests.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [x] This was checked for breaking
API changes and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)","sha":"6ef03697460aba0d3774c0c03fb7fb58c76c00bd"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Walter Rafelsberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting bug Fixes for quality problems that affect the customer experience Feature:ML/AIOps ML AIOps features: Change Point Detection, Log Pattern Analysis, Log Rate Analysis :ml release_note:skip Skip the PR/issue when compiling release notes v8.16.0
Projects
None yet
6 participants