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

Add detector state page #65

Conversation

yizheliu-amazon
Copy link
Contributor

Issue #, if available:
#46
Description of changes:
Add detector state page; fix minor issue that renderTime is not exported

Detector stopped:
Detector never started:
Screen Shot 2020-04-29 at 8 24 52 PM
Detector is manually stopped:
Screen Shot 2020-04-29 at 8 24 19 PM

Detector is initializing:
Screen Shot 2020-04-29 at 8 25 18 PM

Detector initialization failure:
Screen Shot 2020-04-29 at 8 23 43 PM

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

Comment on lines 23 to 28
if (!failureDetail) {
return {
cause: 'unknown error',
actionItem: DEFAULT_ACTION_ITEM,
};
}
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 the case where the detector has an unexpected failure (DETECTOR_STATE.UNEXPECTED_FAILURE)?

Copy link
Contributor

Choose a reason for hiding this comment

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

could maybe add this as a DETECTOR_UNEXPECTED_FAILURE const in the constants file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will add 'We might have bugs' case to the DETECTOR_INIT_FAILURES, but may keep this piece of code just in case of not handled exception from AD backend.

Copy link
Contributor

Choose a reason for hiding this comment

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

cool, sounds good

Copy link
Contributor

@ylwu-amzn ylwu-amzn left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the change

...(detectorState !== undefined ? { curState: detectorState.state } : {}),
...(detectorState !== undefined
? //@ts-ignore
{ initializationError: detectorState.error }
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe only assign initializationError when the detector state is DETECTOR_STATE.INIT_FAILURE. I'm just thinking that with the current code could assign an unexpected failure error to initializationError. Although I see this is a small thing since the state is handled in the switch statement in DetectorStateDetails

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guessed it is okay to assign error to initializationError . During initializing, detector.error does return message like "No full shingle in current detection window" or "No data in current detection window", which can be helpful if we want to show details about initialization.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I see. Actually, that probably makes more sense. Sounds good to leave

Copy link
Contributor

@ohltyler ohltyler left a comment

Choose a reason for hiding this comment

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

LGTM, just minor things. Nice!

keyword: 'Exceeded memory limit',
cause: 'lack of memory',
actionItem:
"Try deleting or stop other detectors that you don't actively use, increase your cluster size, or reduce the number of features in this detector.",
Copy link
Member

Choose a reason for hiding this comment

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

another action item: scale up with an instance type of more memory

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@yizheliu-amazon yizheliu-amazon changed the title Add detector state page; fix minor issue that renderTime is not exported Add detector state page Apr 30, 2020
@yizheliu-amazon yizheliu-amazon merged commit b1238a6 into opendistro-for-elasticsearch:development Apr 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants