-
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
[Synthetics] Improve overview page performance !! #201275
[Synthetics] Improve overview page performance !! #201275
Conversation
…w-status-performance
…zad31/kibana into overview-status-performance
…w-status-performance
…w-status-performance
…w-status-performance
…zad31/kibana into overview-status-performance
…w-status-performance
…w-status-performance
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 functionality looks good to me. Have some recommended code changes/improvements. I'll let @dominiqueclarke leave a review as well before approving when she's available.
...bservability_solution/synthetics/server/saved_objects/synthetics_monitor/get_all_monitors.ts
Outdated
Show resolved
Hide resolved
...ck/plugins/observability_solution/synthetics/server/synthetics_service/synthetics_service.ts
Show resolved
Hide resolved
...s/observability_solution/synthetics/server/routes/overview_status/overview_status_service.ts
Outdated
Show resolved
Hide resolved
...s/observability_solution/synthetics/server/routes/overview_status/overview_status_service.ts
Outdated
Show resolved
Hide resolved
...s/observability_solution/synthetics/server/routes/overview_status/overview_status_service.ts
Outdated
Show resolved
Hide resolved
...s/observability_solution/synthetics/server/routes/overview_status/overview_status_service.ts
Show resolved
Hide resolved
...s/observability_solution/synthetics/server/routes/overview_status/overview_status_service.ts
Outdated
Show resolved
Hide resolved
...s/observability_solution/synthetics/server/routes/overview_status/overview_status_service.ts
Outdated
Show resolved
Hide resolved
...s/observability_solution/synthetics/server/routes/overview_status/overview_status_service.ts
Outdated
Show resolved
Hide resolved
Pinging @elastic/obs-ux-management-team (Team:obs-ux-management) |
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
…w-status-performance
…w-status-performance
/oblt-deploy |
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
💚 Build Succeeded
Metrics [docs]
History
|
Starting backport for target branches: 8.x |
## 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)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. 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]>
…03892) # Backport This will backport the following commits from `main` to `8.x`: - [[Synthetics] Improve overview page performance !! (#201275)](#201275) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Shahzad","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-11T19:33:33Z","message":"[Synthetics] Improve overview page performance !! (#201275)\n\n## Summary\r\n\r\nImprove overview page performance !!\r\n\r\nRight now UI works for few hundred to 1000 monitors, but it starts\r\ndegrading after that, this PR makes sure, we refactor queries in such a\r\nway that it scale up to 10k-20k monitors easily.\r\n\r\n\r\n### Queries before\r\nBefore this PR, we were doing 2 steps queries, first fetch all saved\r\nobjects and the fetch all summary documents by passings all ids from\r\nfirst phase. This meant that let's say if we have 20k saved objects,\r\nfirst we will need to page through all of them to even start fetching\r\nsummaries. To fetch summary documents, we were using `top_hits` query\r\nwhich can be memory expensive.\r\n\r\n\r\n### Queries now\r\nIn this PR we fetch summaries and saved objects in parallel, since we\r\nhave space id on documents as well, there was no need to do 2 step\r\nqueries. Now we fetch both things in parallel and then we hydrate saved\r\nobject data from summary data. In this PR now we are using top_metrics\r\nquery to fetch each monitor status instead of `top_hits`\r\n\r\n\r\nI tested on about 20k monitors, app performs reasoably well after the PR\r\n<img width=\"1920\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/c143e196-59a4-45b4-86b7-bd22ac4c5d4b\">\r\n\r\n\r\nOn a very slow cluster on which kibana is local against a remote cluster\r\n\r\n### After\r\n<img width=\"1920\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/540d0cdf-2f8c-44d1-af76-81953d9ca0ff\">\r\n\r\n\r\n### Before\r\n<img width=\"1918\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/5fdc314d-bb59-4137-9397-d8aee6bd4806\">\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"b4ccb0c205b2df4312edfe7a087e0bca25242d05","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-management"],"title":"[Synthetics] Improve overview page performance !!","number":201275,"url":"https://github.com/elastic/kibana/pull/201275","mergeCommit":{"message":"[Synthetics] Improve overview page performance !! (#201275)\n\n## Summary\r\n\r\nImprove overview page performance !!\r\n\r\nRight now UI works for few hundred to 1000 monitors, but it starts\r\ndegrading after that, this PR makes sure, we refactor queries in such a\r\nway that it scale up to 10k-20k monitors easily.\r\n\r\n\r\n### Queries before\r\nBefore this PR, we were doing 2 steps queries, first fetch all saved\r\nobjects and the fetch all summary documents by passings all ids from\r\nfirst phase. This meant that let's say if we have 20k saved objects,\r\nfirst we will need to page through all of them to even start fetching\r\nsummaries. To fetch summary documents, we were using `top_hits` query\r\nwhich can be memory expensive.\r\n\r\n\r\n### Queries now\r\nIn this PR we fetch summaries and saved objects in parallel, since we\r\nhave space id on documents as well, there was no need to do 2 step\r\nqueries. Now we fetch both things in parallel and then we hydrate saved\r\nobject data from summary data. In this PR now we are using top_metrics\r\nquery to fetch each monitor status instead of `top_hits`\r\n\r\n\r\nI tested on about 20k monitors, app performs reasoably well after the PR\r\n<img width=\"1920\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/c143e196-59a4-45b4-86b7-bd22ac4c5d4b\">\r\n\r\n\r\nOn a very slow cluster on which kibana is local against a remote cluster\r\n\r\n### After\r\n<img width=\"1920\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/540d0cdf-2f8c-44d1-af76-81953d9ca0ff\">\r\n\r\n\r\n### Before\r\n<img width=\"1918\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/5fdc314d-bb59-4137-9397-d8aee6bd4806\">\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"b4ccb0c205b2df4312edfe7a087e0bca25242d05"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201275","number":201275,"mergeCommit":{"message":"[Synthetics] Improve overview page performance !! (#201275)\n\n## Summary\r\n\r\nImprove overview page performance !!\r\n\r\nRight now UI works for few hundred to 1000 monitors, but it starts\r\ndegrading after that, this PR makes sure, we refactor queries in such a\r\nway that it scale up to 10k-20k monitors easily.\r\n\r\n\r\n### Queries before\r\nBefore this PR, we were doing 2 steps queries, first fetch all saved\r\nobjects and the fetch all summary documents by passings all ids from\r\nfirst phase. This meant that let's say if we have 20k saved objects,\r\nfirst we will need to page through all of them to even start fetching\r\nsummaries. To fetch summary documents, we were using `top_hits` query\r\nwhich can be memory expensive.\r\n\r\n\r\n### Queries now\r\nIn this PR we fetch summaries and saved objects in parallel, since we\r\nhave space id on documents as well, there was no need to do 2 step\r\nqueries. Now we fetch both things in parallel and then we hydrate saved\r\nobject data from summary data. In this PR now we are using top_metrics\r\nquery to fetch each monitor status instead of `top_hits`\r\n\r\n\r\nI tested on about 20k monitors, app performs reasoably well after the PR\r\n<img width=\"1920\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/c143e196-59a4-45b4-86b7-bd22ac4c5d4b\">\r\n\r\n\r\nOn a very slow cluster on which kibana is local against a remote cluster\r\n\r\n### After\r\n<img width=\"1920\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/540d0cdf-2f8c-44d1-af76-81953d9ca0ff\">\r\n\r\n\r\n### Before\r\n<img width=\"1918\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/5fdc314d-bb59-4137-9397-d8aee6bd4806\">\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"b4ccb0c205b2df4312edfe7a087e0bca25242d05"}}]}] BACKPORT--> Co-authored-by: Shahzad <[email protected]>
## 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]>
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
![image](https://private-user-images.githubusercontent.com/3505601/388724578-c143e196-59a4-45b4-86b7-bd22ac4c5d4b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NzM1NDEsIm5iZiI6MTczODk3MzI0MSwicGF0aCI6Ii8zNTA1NjAxLzM4ODcyNDU3OC1jMTQzZTE5Ni01OWE0LTQ1YjQtODZiNy1iZDIyYWM0YzVkNGIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDhUMDAwNzIxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NzNmYWNhMzg3ZjgzMGI5Mjk0NGEyYzlhMjlmNjFiODM1ZjNkNGFjODlhY2FkMGY2MTg1NjdlZTI3ZTUxYjA5ZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.7wqRkM24FH6RGJ78vMHahVehIuTWfTe-Bm90WbHHvAY)
On a very slow cluster on which kibana is local against a remote cluster
After
Before