[Security Solution][Telemetry] Refactoring security telemetry task code#114095
Merged
tsouza merged 27 commits intoelastic:masterfrom Oct 12, 2021
Merged
[Security Solution][Telemetry] Refactoring security telemetry task code#114095tsouza merged 27 commits intoelastic:masterfrom
tsouza merged 27 commits intoelastic:masterfrom
Conversation
added 16 commits
October 6, 2021 15:07
Contributor
|
Pinging @elastic/security-solution (Team: SecuritySolution) |
Author
|
@elasticmachine merge upstream |
Contributor
|
@elasticmachine merge upstream |
pjhampton
reviewed
Oct 11, 2021
Contributor
pjhampton
left a comment
There was a problem hiding this comment.
I really like where this is going. Great job! 🚀
Can't really fault it. I pulled down your code and ran it against ES. Tasks still run as expected and opt-in/out functionality working as expected.
Please address my comment and incorporate #113239 when it is to be merged today! ✨
x-pack/plugins/security_solution/server/lib/telemetry/sender.ts
Outdated
Show resolved
Hide resolved
Author
|
@elasticmachine merge upstream |
Contributor
|
merge conflict between base and head |
Author
|
@elasticmachine merge upstream |
Contributor
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
kibanamachine
added a commit
to kibanamachine/kibana
that referenced
this pull request
Oct 12, 2021
…de (elastic#114095) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Contributor
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Over the past releases we've introduced a few Kibana task classes for supporting security solution telemetry. In its current versions there seems to be some code duplication. This PR is an effort for refactoring these classes and simplify things.
Change summary:
tasksand consolidated them in a single task class defined intask.ts. The code that remained withintasksis the logic that is particular to each telemetry task.task.test.tsfor the new reusable task class defined intask.ts. The new test suite uses a dummy task definition and it tests basic capabilities such as being able to register a task and decide if a task should run or not depending if telemetry is opted in or out.tasks. The tests now focus on the specific logic for each class. For now, the tests only verifies if methods that fetches data is being properly called. This is because the telemetry data structure that the telemetry classes work with are fairly complex and it would be time consuming to write sample/fake versions of this data to properly test other method calls. We should revisit and improve tests in a future iteration.To Do:
TelemetryEventsSenderclass still spawns a rogue telemetry channel that runs entirely different from the other task. We should also try to bring this into Kibana task manager.Checklist
Delete any items that are not applicable to this PR.