-
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
[Monitoring] Optimizing alerting code #83681
Conversation
Pinging @elastic/stack-monitoring (Team:Monitoring) |
Thanks for putting this up! I'm having a hard time reviewing this, as I'm not really sure what problems we're solving. I see a few changes that maybe make the code easier to read, but it would help me greatly if you could list out what you changed and why, which will help give me context into the review. For example, in the description:
What does this mean exactly? What functionality was moved to the base? |
@chrisronline I added more details to the body, but I'm happy to do a walk-through/zoom if it helps |
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.
The link back from the internalFullMessage
is broken - it just renders like: http://elasticsearch/nodes
? Is that a regression in this PR?
Also, can we separate this into three separate PRs?
I'm finding it hard to understand what code changes contribute to which. |
I think we should keep track of everything we find and compare 'em with master. If it's indeed a regression I'll address it in this branch, otherwise it should go into a separate issue
I agree this should have been broken down into couple of PRs (from the beginning), but at this state it might be too late since all the changes are coupled together. It would take a lot of work decoupling everything, and might require some extra (throw away) work just so they could function independently. I will keep this in mind when doing future PRs similar in nature |
If you want I can go through it all via zoom, would be more than happy to |
@jasonrhodes Curious to your thoughts here. Should we get on a zoom on discuss it more? Or do you think we can discuss everything here? |
My advice is to do the zoom call, and if after that call, it still feels difficult to review, we should split into 2-3 PRs even if it takes some work. That is probably the safest thing to do. If the zoom call can help illuminate the changes sufficiently, we can keep it, but I'd leave that up to Chris as the reviewer. |
This makes sense and sounds like how we should try to treat most code reviews. |
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.
This looks great. Thanks for hoping on a zoom to help talk it through. I only had one small comment for now
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.
There seem to be at least one test removed that should be put back, but once that's done, this LGTM! Great work!
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Distributable file count
History
To update your PR or re-run it, just comment with: |
* [Monitoring] Optimizing alerting code (#83681) * Optimize alerting code * Merged all the branches * resolved conflict * optimizing all branches merged * Fixed tests and resolved conflicts * Fixed jest tests * Resolved merge conflicts with the alerting team's PR # Conflicts: # x-pack/plugins/monitoring/public/components/apm/instance/instance.js # x-pack/plugins/monitoring/public/components/beats/beat/beat.js * Update instance.js
Backport: |
Resolves #80065
Shared threshold/legacy alert functionality is moved into base alert/watches
processData
method is now shared across all none legacy alertsAll "legacy" watches type alerts now share
processData
andfetchData
methodsSome helper methods were also unified
Removed dead code
Mostly code that wasn't used any more due to removal of some features, mainly stack products and resolved functionality
Server/UI shared elements moved into common folder (mostly done in [Monitoring] Thread pool rejections alert #79433)
In some cases we were importing a lot of alerts related code into our frontend app which pretty much imported the whole server app due to other required imports/dependancies
Also moved all the types/helpers shared between
server
andpublic
folder intocommon
folderTest alert triggers with multiple environments primarily CCR/remote features, and with/without security
Fix unit/functional tests