Skip to content
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

Utilise index in log item flyout to prevent scanning of all available indices #57761

Closed
wants to merge 1 commit into from

Conversation

driskell
Copy link

Utilise index in log item flyout to prevent scanning of all available indices on getLogItem which can bring down small clusters

Summary

For more details see #38240

In Logs, when streaming, each item has an icon to display the full log entry in a fly out. However, on a large cluster with many logstash index partitions (we have about 100) this flyout never loads and brings down the Elasticsearch cluster due to memory and CPU going sky high. This is because the request to load the single log item only contains its ID and does not contain the partition/index. As such, all 100 logstash partitions/indices need to be checked for the ID. The debate on correctly sizing ES is a separate issue. Generally speaking there seems to be no reason why the flyout should not specify the partition/index the entry came from, and it indeed resolves the issue in #38240

Unfortunately could not run tests to find out what needs updating as the command ran for 30 minutes and never got past eslint, even though the git pre-commit hook eslint finished in seconds. I also could not use the GraphSQL code generation due to same issue as #46754 (though I was in 7.6 branch initially) so the files were updated manually.

It would be great if someone at Elastic could pick this up to finish if there's changes needed as I've very little time left. Due to restrictions in Elastic License I also can't use this derivative in production to test the issue is resolved so can't confirm whether or not the issue is resolved and makes the flyout instantaneous or not, which it quite possibly would, but I could not say if it does and certainly cannot say if it did as I have not done it, absolutely not.

Hopefully it's a good starting point and can make 7.7!

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@kibanamachine
Copy link
Contributor

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@@ -52,7 +52,7 @@ interface ScrollableLogTextStreamViewProps {
}) => any;
loadNewerItems: () => void;
reloadItems: () => void;
setFlyoutItem: (id: string) => void;
setFlyoutRef: (ref: { id: string; index: string }) => void;
Copy link
Author

Choose a reason for hiding this comment

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

There's two setFlyoutItem in code base so this made sense. One is setting the loaded item. This one setting the one we want to load. So made sense to rename for two reason, it now takes more than just ID and it takes reference not an item

@wylieconlon wylieconlon added Feature:Logs UI Logs UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services labels Feb 19, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui)

@weltenwort
Copy link
Member

Thanks for contributing these changes. ❤️ Unfortunately they collided with a move of the plugin directory (#54583) and therefore exhibit many conflicts. It's a good improvement, but I can't make any promises about when we'll get to it. 🙈

@driskell
Copy link
Author

Aha I did see things were moving. If I get some time I might be able to quickly rebase or reapply the changes as that shouldn’t take too long. If someone could review in the meantime if I get to it and there’s any tweaks needed I could check those too

… indices on getLogItem which can bring down small clusters
@driskell driskell force-pushed the flyout-performance branch from 8544b6c to 284037b Compare April 6, 2020 12:49
@driskell
Copy link
Author

driskell commented Apr 6, 2020

@weltenwort Rebase completed. I haven't been able to test fully yet.
A yarn test and build took over 2 hours and still didn't finished and I cannot allow it to run further.
If I remember I'll try leave it running overnight and get this tested.

@weltenwort
Copy link
Member

Thank you for investing the effort - I'll try to take a look this week. Would you mind me pushing to this branch to resolve the new conflicts?

@driskell
Copy link
Author

@weltenwort sure no problem, thanks!

@weltenwort
Copy link
Member

Unfortunately I was unable to resolve the merge conflicts. It should be easy to re-apply your changes to a clean master, though.

@weltenwort
Copy link
Member

I'll create a new PR, but set you as the author in the respective commits.

@weltenwort
Copy link
Member

ℹ️ the new PR is #67004

@driskell driskell closed this Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💝community Feature:Logs UI Logs UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants