-
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
[Logs UI] Prevent summary request from piling up #148670
[Logs UI] Prevent summary request from piling up #148670
Conversation
Ha, nice! Do you think it would be possible to get a backport of this to We are suffering from this quite a bit. A single user enabling log streaming without filters can overload the entire cluster for us. |
@StephanErb it would be pretty easy to backport to earlier 8.x versions. There are no releases for 6.x planned, so I'd prefer not to touch that branch. |
Oh. I meant 8.6.x :) |
hehe, ok. sure, I'll backport it to 8.6 |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: cc @weltenwort |
Pinging @elastic/infra-monitoring-ui (Team:Infra Monitoring UI) |
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, work as expected on my cluster, nice usage of exhaustMap
👏
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
Co-authored-by: kibanamachine <[email protected]> (cherry picked from commit f01a61b)
…8792) # Backport This will backport the following commits from `main` to `8.6`: - [[Logs UI] Prevent summary request from piling up (#148670)](#148670) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Felix Stürmer","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-01-12T11:04:05Z","message":"[Logs UI] Prevent summary request from piling up (#148670)\n\nCo-authored-by: kibanamachine <[email protected]>","sha":"f01a61b81ab0a4756dfe40233aa61a196aa64dbe","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Feature:Logs UI","Team:Infra Monitoring UI","backport:prev-minor","v8.7.0"],"number":148670,"url":"https://github.com/elastic/kibana/pull/148670","mergeCommit":{"message":"[Logs UI] Prevent summary request from piling up (#148670)\n\nCo-authored-by: kibanamachine <[email protected]>","sha":"f01a61b81ab0a4756dfe40233aa61a196aa64dbe"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/148670","number":148670,"mergeCommit":{"message":"[Logs UI] Prevent summary request from piling up (#148670)\n\nCo-authored-by: kibanamachine <[email protected]>","sha":"f01a61b81ab0a4756dfe40233aa61a196aa64dbe"}}]}] BACKPORT--> Co-authored-by: Felix Stürmer <[email protected]>
Co-authored-by: kibanamachine <[email protected]>
📝 Summary
This prevents the execution of new log stream summary requests until the previous request has finished.
related to #86439
🕵️♀️ Review notes
Currently, the
useLogSummary
hook executes new summary requests when any of the parameters change. If parameter changes arrive quicker than the summary requests complete, they will pile up. While theuseCancellableEffect
prevented the requests from overtaking each other, the old in-flight requests would still put load on the cluster.Ideally we would re-implement the summary fetching as cancellable async searches. But since we're going to change the orchestration of log stream requests soon anyway (as part of #134412), that would be wasteful. So this is an intermediate improvement to reduce the cluster load.
The changes to the
use_observable.ts
collection of hooks are twofold:useBehaviorSubject
didn't keep the identity of the second return value (thenext
function) stable, which could lead to undesired re-rendering.useReplaySubject
hook is similar to the improveduseBehaviorSubject
, but powered by a n RxJSReplaySubject
, which doesn't have an initial value.🩺 How to test
/api/log_entries/summary
take longer than the refresh interval