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

[8.x] [Synthetics] Improve overview page performance !! (#201275) #203892

Merged
merged 2 commits into from
Dec 12, 2024

Conversation

kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

## Summary

Improve overview page performance !!

Right now UI works for few hundred to 1000 monitors, but it starts
degrading after that, this PR makes sure, we refactor queries in such a
way that it scale up to 10k-20k monitors easily.

### Queries before
Before this PR, we were doing 2 steps queries, first fetch all saved
objects and the fetch all summary documents by passings all ids from
first phase. This meant that let's say if we have 20k saved objects,
first we will need to page through all of them to even start fetching
summaries. To fetch summary documents, we were using `top_hits` query
which can be memory expensive.

### Queries now
In this PR we fetch summaries and saved objects in parallel, since we
have space id on documents as well, there was no need to do 2 step
queries. Now we fetch both things in parallel and then we hydrate saved
object data from summary data. In this PR now we are using top_metrics
query to fetch each monitor status instead of `top_hits`

I tested on about 20k monitors, app performs reasoably well after the PR
<img width="1920" alt="image"
src="https://github.com/user-attachments/assets/c143e196-59a4-45b4-86b7-bd22ac4c5d4b">

On a very slow cluster on which kibana is local against a remote cluster

### After
<img width="1920" alt="image"
src="https://github.com/user-attachments/assets/540d0cdf-2f8c-44d1-af76-81953d9ca0ff">

### Before
<img width="1918" alt="image"
src="https://github.com/user-attachments/assets/5fdc314d-bb59-4137-9397-d8aee6bd4806">

---------

Co-authored-by: kibanamachine <[email protected]>
(cherry picked from commit b4ccb0c)
@kibanamachine kibanamachine enabled auto-merge (squash) December 11, 2024 19:38
@botelastic botelastic bot added ci:project-deploy-observability Create an Observability project Team:obs-ux-management Observability Management User Experience Team labels Dec 11, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@elasticmachine
Copy link
Contributor

elasticmachine commented Dec 12, 2024

💛 Build succeeded, but was flaky

  • Buildkite Build
  • Commit: 3bfcfca
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-203892-3bfcfca95985

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #41 / Entity Manager _search API includes source and additional metadata fields
  • [job] [logs] FTR Configs #18 / InfraOps App Metrics UI Home page with metrics present Saved Views should update the current saved view and load it

Metrics [docs]

✅ unchanged

History

cc @shahzad31

@kibanamachine kibanamachine merged commit d13e80d into elastic:8.x Dec 12, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport ci:project-deploy-observability Create an Observability project Team:obs-ux-management Observability Management User Experience Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants