-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Various bug fixes We display the error message "No features have been added to this anomaly detector. A feature is a metric used for anomaly detection. A detector can detect anomalies across one or more features" when the preview API fails to complete the preview request due to one of the following reasons: * The preview API cannot locate sufficient data to show sample anomaly results, as it requires more than 400 data points within the preview date range (from 5 days ago to the present time). * The preview API fails with an error (e.g., 5xx error). * No features have been added to the anomaly detector. * No features have been enabled in the anomaly detector. This pull request (PR) fixes the issue by displaying errors on a case-by-case basis. Additionally, this PR adds Prettier to the repository as it is used by Dashboards and other plugins (https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/DEVELOPER_GUIDE.md#prettier-and-linting). Furthermore, this PR standardizes the preview range to 7 days. Previously, we attempted to use 7 days but had to override it to 5 days due to two startTime fields in the parameters (refer to AnomalyDetectorData.js). This PR also resolves a bug where we show two links to the detector configuration (refer to getOverviewStats.js). This PR addresses a warning when displaying a detector URL on the monitor overview page (OverviewStat/OverviewStat). As the following error trace indicates, we only supported string or number as a value in Overview stats. This PR introduces a React element as another supported type. checkPropTypes.js:20 Warning: Failed prop type: Invalid prop `value` supplied to `OverviewStat`, expected one of type [string, number]. in OverviewStat (created by MonitorOverview) in MonitorOverview (created by MonitorDetails) in div (created by MonitorDetails) in MonitorDetails (created by Context.Consumer) in Route (created by Context.Consumer) in Switch (created by Context.Consumer) in div (created by Context.Consumer) in Main (created by Context.Consumer) in Route in Router (created by HashRouter) in HashRouter This PR also removes the unused file AnomalyHistory.js. Testing done: * Manually tested each preview failure scenario. * Manually tested alerting workflow of both HC and single stream detectors still works. * Added unit tests for new code. Signed-off-by: Kaituo Li <[email protected]> * add missing period Signed-off-by: Kaituo Li <[email protected]> * Don't block trigger creation when preview fails Creating/editing a monitor without setting a trigger means no alert is ever raised. This commit fixed the issue. Signed-off-by: Kaituo Li <[email protected]> --------- Signed-off-by: Kaituo Li <[email protected]> (cherry picked from commit 6dc848e) Co-authored-by: Kaituo Li <[email protected]>
- Loading branch information
1 parent
89026fc
commit 91785d7
Showing
14 changed files
with
571 additions
and
191 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
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.