-
Notifications
You must be signed in to change notification settings - Fork 61
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
Update sample data naming conventions #24
Conversation
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
@@ -73,23 +73,23 @@ export default class SampleDataService { | |||
__dirname, | |||
'../sampleData/rawData/httpResponses.json.gz' | |||
); | |||
indexName = 'opendistro-sample-http-responses'; | |||
indexName = 'sample-http-responses'; |
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.
If user already has index with name sample-http-responses
, will we create sample detector on user's existing index or will throw exception?
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.
We will try to create on the existing index, but if it's some user's created index it will most likely fail since it won't have the same fields & mappings, etc.
Basically we just check for the existence of the sample index name here and create if it doesn't already exist.
This check is added to handle the case of user creating the sample data (both detector and index), and maybe deleting or changing the detector name. In that case, they can recreate the sample detector, and will use the existing sample index if it is still there.
This is admittedly simple; one of the tracked improvements for sample detectors is adding delete buttons on the UI and better handling of edge cases
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.
Sure. Should pay attention when delete sample detectors to avoid delete some user's data index with the same name of sample-http-responses
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.
Agreed. Will have to be careful when introducing deletions here. Same goes for detectors.
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.
LGTM. Thanks for the change!
Description
Current sample detectors and indices include the legacy
opendistro-
prefix. This PR removes that prefix.Example:
eCommerce detector change:
opendistro-sample-ecommerce-detector
=>sample-ecommerce-detector
eCommerce index change:
opendistro-sample-ecommerce
=>sample-ecommerce
In addition:
Screenshots:
Legacy + new sample detectors coexisting:


Details flyout (legacy):

Details flyout (new):

Issues Resolved
Resolves #3
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.