Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Simplify historical detector failure states #368

Merged

Conversation

ohltyler
Copy link
Contributor

@ohltyler ohltyler commented Jan 29, 2021

Issue #, if available:

Description of changes:

This PR simplifies and organizes the failure states for historical detectors. Currently, all failures are grouped into the Unexpected failure state, except for the No data state. Since there are other handled failures (e.g., "Not enough data to initialize"), these should also not be ignored, and we should provide some useful information to the user. However, creating more states similar to No data state introduces a lot of extra code, and makes it difficult to maintain compatibility on the frontend with all of the possible backend/ES failures.

To simplify this, we group the failures into (1) Unexpected failure and (2) Failed states by parsing out the backend error message. If the message is a stack trace: we consider it unexpected, with no readable error message. If the message is anything else, we consider it handled, and propagate that error message to the frontend via a callout on the historical detector details page.

Details & examples on the 4 possible types of error messages that need to be handled can be found in the function here and the corresponding unit test here.

Added unit tests & confirmed all are passing.

Screenshots:

Failed state with propagated ES error message:
image

Unexpected failure state:
image

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ohltyler ohltyler changed the title Simplify historical detector failure states [WIP] Simplify historical detector failure states Jan 29, 2021
@ohltyler ohltyler marked this pull request as ready for review February 1, 2021 23:35
@ohltyler ohltyler changed the title [WIP] Simplify historical detector failure states Simplify historical detector failure states Feb 1, 2021
@ohltyler ohltyler added the enhancement Enhance current feature for better performance, user experience, etc label Feb 1, 2021
@ohltyler ohltyler merged commit 34d1567 into opendistro-for-elasticsearch:master Feb 3, 2021
@ohltyler ohltyler deleted the add-failed-state branch February 3, 2021 21:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Enhance current feature for better performance, user experience, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants