-
Notifications
You must be signed in to change notification settings - Fork 58
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
Add suggest anomaly detector action to discover page #849
Add suggest anomaly detector action to discover page #849
Conversation
This PR depends on the PR in core which is still in reviewing, I'll add more tests for this PR during the reviewing process, @ohltyler @kaituo @jackiehanyang @owaiskazi19 @joshpalis @SuZhou-Joe @ruanyl could you help to review this PR? Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the change! Here's my first pass of the review, I raised some minor issues and will review it again once there are more tests.
My main concern here is that the flyout code is exactly the same as the one used in the feature anywhere detector creation flyout. Can we reuse the feature anywhere detector creation flyout here instead of copying the code into a different folder? This would help avoid adding duplicate code and the need to maintain two sets of code
Signed-off-by: gaobinlong <gbinlong@amazon.com>
55f2410
to
6bee0ae
Compare
@jackiehanyang Thanks for your review, I meant to leverage the existing feature anywhere flyout, but failed to do that because there're many difference between this case and the feature anywhere:
|
Thanks, Jackie. Can we get one more maintainer help review this PR? We plan to release it in 2.17. |
Signed-off-by: gaobinlong <gbinlong@amazon.com>
Signed-off-by: gaobinlong <gbinlong@amazon.com>
public/pages/ConfigureModel/components/FeatureAccordion/FeatureAccordion.tsx
Show resolved
Hide resolved
Signed-off-by: gaobinlong <gbinlong@amazon.com>
Signed-off-by: gaobinlong <gbinlong@amazon.com>
The code change looks good to me, just I see failed CI. Could you please fix that? |
Thank you, this PR is waiting a PR in OSD core repo to be merged, I'll get all checks passed after that PR is merged. |
b35019c
to
f9bdcfb
Compare
Signed-off-by: gaobinlong <gbinlong@amazon.com>
f9bdcfb
to
bc2228d
Compare
@gaobinlong is this pr still tracking 2.17 release? |
Actually yes, I know today is the code freeze day, but the two PRs in other repos that this PR depends on have not been merged yet(still have some UI change), so please be lenient with this PR, thank you! |
Could you link the dependency PRs here. Also please address the conflicts on this pr so that we could quickly merge in this one after the dependency PRs are merged and CI all passed. The first RC build is on 11:00am PST, Sept 5th |
This PR depends on opensearch-project/OpenSearch-Dashboards#7936 and opensearch-project/dashboards-assistant#265. |
Refactor unit test code Signed-off-by: gaobinlong <gbinlong@amazon.com>
Signed-off-by: gaobinlong <gbinlong@amazon.com>
Signed-off-by: gaobinlong <gbinlong@amazon.com>
Signed-off-by: gaobinlong <gbinlong@amazon.com>
@jackiehanyang thanks, I've resolved the conflicts and linked the dependency PRs yet, and also made some change for this PR, that includes:
, now the implementation is simplified, please help to take a look, thank you! |
Signed-off-by: gaobinlong <gbinlong@amazon.com>
@jackiehanyang the direct dependency PR has been merged, so now all checks have passed yet in this PR, please help to approve and merge if no issue exists, thank you! |
* Add generate anomaly detector action to discover page Signed-off-by: gaobinlong <gbinlong@amazon.com> * Add more test code and rename the file Signed-off-by: gaobinlong <gbinlong@amazon.com> * Modify flyout header Signed-off-by: gaobinlong <gbinlong@amazon.com> * Make the detectorName follow the convention Signed-off-by: gaobinlong <gbinlong@amazon.com> * Truncate the index pattern name if it's too long Signed-off-by: gaobinlong <gbinlong@amazon.com> * Move entry point to query editor Signed-off-by: gaobinlong <gbinlong@amazon.com> * Call the node API in dashboard-assistant plugin to generate parameters Refactor unit test code Signed-off-by: gaobinlong <gbinlong@amazon.com> * Fix test failure Signed-off-by: gaobinlong <gbinlong@amazon.com> * Revert the code format Signed-off-by: gaobinlong <gbinlong@amazon.com> * Remove some empty lines Signed-off-by: gaobinlong <gbinlong@amazon.com> --------- Signed-off-by: gaobinlong <gbinlong@amazon.com> (cherry picked from commit ec02b63)
* Add generate anomaly detector action to discover page Signed-off-by: gaobinlong <gbinlong@amazon.com> * Add more test code and rename the file Signed-off-by: gaobinlong <gbinlong@amazon.com> * Modify flyout header Signed-off-by: gaobinlong <gbinlong@amazon.com> * Make the detectorName follow the convention Signed-off-by: gaobinlong <gbinlong@amazon.com> * Truncate the index pattern name if it's too long Signed-off-by: gaobinlong <gbinlong@amazon.com> * Move entry point to query editor Signed-off-by: gaobinlong <gbinlong@amazon.com> * Call the node API in dashboard-assistant plugin to generate parameters Refactor unit test code Signed-off-by: gaobinlong <gbinlong@amazon.com> * Fix test failure Signed-off-by: gaobinlong <gbinlong@amazon.com> * Revert the code format Signed-off-by: gaobinlong <gbinlong@amazon.com> * Remove some empty lines Signed-off-by: gaobinlong <gbinlong@amazon.com> --------- Signed-off-by: gaobinlong <gbinlong@amazon.com> (cherry picked from commit ec02b63)
* Add generate anomaly detector action to discover page Signed-off-by: gaobinlong <gbinlong@amazon.com> * Add more test code and rename the file Signed-off-by: gaobinlong <gbinlong@amazon.com> * Modify flyout header Signed-off-by: gaobinlong <gbinlong@amazon.com> * Make the detectorName follow the convention Signed-off-by: gaobinlong <gbinlong@amazon.com> * Truncate the index pattern name if it's too long Signed-off-by: gaobinlong <gbinlong@amazon.com> * Move entry point to query editor Signed-off-by: gaobinlong <gbinlong@amazon.com> * Call the node API in dashboard-assistant plugin to generate parameters Refactor unit test code Signed-off-by: gaobinlong <gbinlong@amazon.com> * Fix test failure Signed-off-by: gaobinlong <gbinlong@amazon.com> * Revert the code format Signed-off-by: gaobinlong <gbinlong@amazon.com> * Remove some empty lines Signed-off-by: gaobinlong <gbinlong@amazon.com> --------- Signed-off-by: gaobinlong <gbinlong@amazon.com> (cherry picked from commit ec02b63) Co-authored-by: gaobinlong <gbinlong@amazon.com>
* Add generate anomaly detector action to discover page Signed-off-by: gaobinlong <gbinlong@amazon.com> * Add more test code and rename the file Signed-off-by: gaobinlong <gbinlong@amazon.com> * Modify flyout header Signed-off-by: gaobinlong <gbinlong@amazon.com> * Make the detectorName follow the convention Signed-off-by: gaobinlong <gbinlong@amazon.com> * Truncate the index pattern name if it's too long Signed-off-by: gaobinlong <gbinlong@amazon.com> * Move entry point to query editor Signed-off-by: gaobinlong <gbinlong@amazon.com> * Call the node API in dashboard-assistant plugin to generate parameters Refactor unit test code Signed-off-by: gaobinlong <gbinlong@amazon.com> * Fix test failure Signed-off-by: gaobinlong <gbinlong@amazon.com> * Revert the code format Signed-off-by: gaobinlong <gbinlong@amazon.com> * Remove some empty lines Signed-off-by: gaobinlong <gbinlong@amazon.com> --------- Signed-off-by: gaobinlong <gbinlong@amazon.com> (cherry picked from commit ec02b63) Co-authored-by: gaobinlong <gbinlong@amazon.com>
…ect#849) (opensearch-project#872) * Add generate anomaly detector action to discover page Signed-off-by: gaobinlong <gbinlong@amazon.com> * Add more test code and rename the file Signed-off-by: gaobinlong <gbinlong@amazon.com> * Modify flyout header Signed-off-by: gaobinlong <gbinlong@amazon.com> * Make the detectorName follow the convention Signed-off-by: gaobinlong <gbinlong@amazon.com> * Truncate the index pattern name if it's too long Signed-off-by: gaobinlong <gbinlong@amazon.com> * Move entry point to query editor Signed-off-by: gaobinlong <gbinlong@amazon.com> * Call the node API in dashboard-assistant plugin to generate parameters Refactor unit test code Signed-off-by: gaobinlong <gbinlong@amazon.com> * Fix test failure Signed-off-by: gaobinlong <gbinlong@amazon.com> * Revert the code format Signed-off-by: gaobinlong <gbinlong@amazon.com> * Remove some empty lines Signed-off-by: gaobinlong <gbinlong@amazon.com> --------- Signed-off-by: gaobinlong <gbinlong@amazon.com> (cherry picked from commit ec02b63) Co-authored-by: gaobinlong <gbinlong@amazon.com>
* Add suggest anomaly detector action to discover page (#849) (#872) * Add generate anomaly detector action to discover page Signed-off-by: gaobinlong <gbinlong@amazon.com> * Add more test code and rename the file Signed-off-by: gaobinlong <gbinlong@amazon.com> * Modify flyout header Signed-off-by: gaobinlong <gbinlong@amazon.com> * Make the detectorName follow the convention Signed-off-by: gaobinlong <gbinlong@amazon.com> * Truncate the index pattern name if it's too long Signed-off-by: gaobinlong <gbinlong@amazon.com> * Move entry point to query editor Signed-off-by: gaobinlong <gbinlong@amazon.com> * Call the node API in dashboard-assistant plugin to generate parameters Refactor unit test code Signed-off-by: gaobinlong <gbinlong@amazon.com> * Fix test failure Signed-off-by: gaobinlong <gbinlong@amazon.com> * Revert the code format Signed-off-by: gaobinlong <gbinlong@amazon.com> * Remove some empty lines Signed-off-by: gaobinlong <gbinlong@amazon.com> --------- Signed-off-by: gaobinlong <gbinlong@amazon.com> (cherry picked from commit ec02b63) Co-authored-by: gaobinlong <gbinlong@amazon.com> * Report metrics for suggest anomaly detector (#876) (#878) * Add feedback button to the flyout of suggest anomaly detector Signed-off-by: gaobinlong <gbinlong@amazon.com> * Check feature flag before registering action to Discover page Signed-off-by: gaobinlong <gbinlong@amazon.com> * Fix url bug Signed-off-by: gaobinlong <gbinlong@amazon.com> * Remove unused dependency Signed-off-by: gaobinlong <gbinlong@amazon.com> * Fix e2e test failure Signed-off-by: gaobinlong <gbinlong@amazon.com> --------- Signed-off-by: gaobinlong <gbinlong@amazon.com> (cherry picked from commit 26b12d1) Co-authored-by: gaobinlong <gbinlong@amazon.com> * feat: update category (#883) (#884) (cherry picked from commit 9402888) Co-authored-by: SuZhou-Joe <suzhou@amazon.com> * Revert "Increment version to 2.17.1.0 (#881)" This reverts commit 33dfe2f. Signed-off-by: SuZhou-Joe <suzhou@amazon.com> --------- Signed-off-by: SuZhou-Joe <suzhou@amazon.com> Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Co-authored-by: gaobinlong <gbinlong@amazon.com> Co-authored-by: Zhou Su <>
Description
This PR adds a
suggest anomaly detector
button to the discover page, when users click the button, a flyout pops up, and the index pattern extracted from the discover page is sent to a backend API which will return some suggested parameters from LLM, the suggested parameters contain features list and a optional category field used for creating anomaly detector, users can click thecreate detector
button to create a new detector after they confirm the suggested parameters or update that if need.The code change include:
DiscoverAction
intoDiscover
, the register function is provided by OSD core, in this PR:Add registrable DiscoverActions to discover page OpenSearch-Dashboards#7793_generate_parameters
which calls some backend APIs in the ml-commons plugin...${BASE_NODE_API_PATH}/_mappings
, which is not available for this feature, because the URI of the discover page isapp/data-explorer/discover#
, different from the URI in anomaly detection plugin:app/anomaly-detection-dashboards#
, so I changed it to${BASE_NODE_API_PATH}/_mappings
to avoid 404 error.Some screenshots:
A demo video:
generate_anomaly_detector_480.mov
Issues Resolved
#816
Check List
--signoff
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.