-
Notifications
You must be signed in to change notification settings - Fork 70
Add history/frequency #1098
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 history/frequency #1098
Conversation
4e92b47
to
bc65faf
Compare
Cypress IT failed with: ==================================================================================================== |
Manually run fixed IT (will create another PR): ==================================================================================================== (Run Finished)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐ ==================================================================================================== (Run Finished)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐ ✨ Done in 53.02s. ──────────────────────────────────────────────────────────────────────────────────────────────────── Running: plugins/anomaly-detection-dashboards-plugin/create_detector_spec.js (1 of 1) Why you should do it regularly: Create detector workflow 1 passing (29s) (Results) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ (Video)
(Run Finished)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐ ✨ Done in 117.11s. |
…e Model This PR centralizes operational settings in the model step as we can call suggest API. Suggest API works better when we know features and categorical fields. This PR also adds an assisted setup via suggestions, and corrects documentation links. Specifically - UI - Add SuggestParametersDialog to recommend detection interval, frequency, history, and window delay; apply suggestions to the form. - Introduce Settings panel in Configure Model with Interval, Frequency, Window delay, and History fields. - Validate frequency as a multiple of interval; add validateMultipleOf util. - Move interval/window delay out of Define Detector (remove DefineDetector/Settings and tests). - Show read-only OperationalSettings in Review & Create; remove interval/window delay display from DetectorDefinitionFields. - Replace BASE_DOCS_LINK usages with AD_DOCS_LINK; add ALERTING_DOCS_LINK. - Add error in detector status if any. Otherwise, if a detector is stopped, users won't know why unless they know how to run get detector API with required parameter. - Keep frequency in sync when the interval changes (only when they started equal). This reduces UX friction for users who don't care to tweak frequency while editing interval. - Server/Redux - Add POST /detectors/_suggest/{suggestType}[/{dataSourceId}] route. - Add cluster client method ad.suggestDetector. - Add suggestDetector Redux action. - Models/Helpers - Extend Detector with optional frequency and history. - Map interval/windowDelay/frequency/history in formikToDetector and model helpers (conditionally persisted). - Pass operational settings through preview/sample anomalies flow. - Test - Update snapshots and tests due to UI changes. - public/pages/DetectorConfig/containers/__tests__/Features.test.tsx:33 imports featureQuery1/featureQuery2 straight from ./DetectorConfig.test. That re-evaluates the entire DetectorConfig test module when the Features tests run. This causes the flaky Features test failure when DetectorConfig.test fails. This PR extracts featureQuery1/featureQuery2 into public/pages/DetectorConfig/containers/__tests__/utils/featureQueries.ts and import them from there; this keeps test files isolated and avoids re-running other test suites on import. Testing done: 1. fixed broken IT and UT. Will publish IT fix in functional test repo. 2. manual test. Signed-off-by: kaituo <[email protected]>
Description
This PR adds history and frequency parameters to anomaly detectors.
UI
validateMultipleOf
util.BASE_DOCS_LINK
usages withAD_DOCS_LINK
; addALERTING_DOCS_LINK
.Server/Redux
POST /detectors/_suggest/{suggestType}[/{dataSourceId}]
route.ad.suggestDetector
.suggestDetector
Redux action.Models/Helpers
formikToDetector
and model helpers (conditionally persisted).Test
Testing done
demo:
frequency.mov
show stopped detector error:
Issues Resolved
[List any issues this PR will resolve]
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.