-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[ML] Anomaly Detection: Fix anomaly marker click in Single Metric Viewer embeddable #176788
Merged
walterra
merged 25 commits into
elastic:main
from
walterra:176651-ml-smv-embeddable-click
Mar 5, 2024
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
c07d8d7
fix anomaly marker click in SMV embeddable
walterra 85dc3f2
remove console.logs
walterra c84fedc
dependencies
walterra 9ff3807
simplify anomaly explorer context
walterra 4abe2a9
add comment
walterra 0ce7c8a
fix dependencies
walterra 5e479f4
fix jest tests
walterra 1512c2f
fix embeddable anomaly chart
walterra 2fcc8b6
fix jest test
walterra 02b1dfc
remove unused dependency cache items
walterra ac060ae
Merge branch 'main' into 176651-ml-smv-embeddable-click
walterra 5508ae2
adds deprecation notices
walterra 70ab770
cleanup
walterra ea30406
move mlIndexUtils out of global context
walterra ad49b54
add comments about services
walterra 42e89c1
move loadDataViewListItems to mlIndexUtils
walterra f57c08d
destructure mlIndexUtils
walterra bccd244
don't return mlIndexUtils
walterra 1a4f9b6
Merge branch 'main' into 176651-ml-smv-embeddable-click
walterra 3ee830d
fix mlJobService
walterra 9333edc
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine 3f40ece
Merge branch 'main' into 176651-ml-smv-embeddable-click
walterra bcda568
Merge branch '176651-ml-smv-embeddable-click' of github.com:walterra/…
walterra d4e6b66
Merge branch 'main' into 176651-ml-smv-embeddable-click
walterra cef71e5
Merge branch 'main' into 176651-ml-smv-embeddable-click
walterra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
To prevent bloat of the context, perhaps the
mlFieldFormatService
should be created in the component as needed and then passed/made available to it's children?For example, we already have
mlApiServices
anddataViews
in context, I believe.fieldFormatServiceFactory
requiresmlApiServices
andmlIndexUtils
- which, in turn, only requires the dataViewsService.From that, fieldFormatService could be instantiated once in the component in which it is needed instead of adding more to the context.
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.
Not sure it's bloat? Prior to this PR the service was only instantiated once too, it's just that with the dependency cache under the hood it could be imported everywhere without being passed around via context. So this variant felt closer to the original then instantiating multiple times. Note the factory doesn't have any costly side effects, for example it doesn't call any requests, that's only happening once you call one of its methods.
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.
I tend to agree that it would be better to keep
mlIndexUtils
andmlFieldFormatService
out of this context as they are used so rarely throughout our plugin. It sets a precedence that all utils and services we have should go in here too.Instantiating them when needed in each file would be better IMO.
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.
As discussed offline, I'm leaving
mlFieldFormatService
here as a global service for now because of its internal state.mlIndexUtils
will not be passed on to global services, instead it can be accessed within components viauseMlIndexUtils()
.I added the following comment to each place where the services are set up (the main ML app, the anomaly charts embeddable and the single metric viewer embeddable):
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.
Does this still require a code change?
mlIndexUtils
is still being added to the context.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.
Oh yes, overlooked that one, thanks! Fixed in bccd244.