-
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
[ML] Trained Models: Optimize trained models Kibana API #200977
[ML] Trained Models: Optimize trained models Kibana API #200977
Conversation
…-models-init # Conflicts: # x-pack/plugins/ml/public/application/model_management/expanded_row.tsx # x-pack/plugins/ml/public/application/model_management/models_list.tsx
x-pack/test/api_integration/apis/ml/trained_models/trained_models_list.ts
Outdated
Show resolved
Hide resolved
x-pack/test/api_integration/apis/ml/trained_models/trained_models_list.ts
Outdated
Show resolved
Hide resolved
); | ||
}); | ||
|
||
it('returns models without pipeline in case user does not have required permission', async () => { |
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 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 error comes from another endpoint /data_frame/analytics/map/{analyticsId}
. I reckon it should be fixed separately.
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.
Agreed - this behavior isn't introduced by this PR and happens on main
. Can you create a separate issue for it please.
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 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.
Tested and LGTM. A great optimization!
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.
Added nit pick comment, but generally LGTM
const { endpoints } = await esClient.transport.request<{ | ||
endpoints: InferenceAPIConfigResponse[]; | ||
}>({ | ||
method: 'GET', | ||
path: `/_inference/_all`, | ||
}); |
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.
I appreciate this is relocated code, but it might be a good opportunity to remove the use of transport
.
const { endpoints } = await esClient.transport.request<{ | |
endpoints: InferenceAPIConfigResponse[]; | |
}>({ | |
method: 'GET', | |
path: `/_inference/_all`, | |
}); | |
const { endpoints } = await esClient.inference.get({ | |
inference_id: '_all', | |
}) |
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.
Done in 307bb40
Starting backport for target branches: 8.17, 8.x https://github.com/elastic/kibana/actions/runs/12166357717 |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
cc @darnautov |
💔 Backport failedThe pull request could not be backported due to the following error: Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
## Summary Closes elastic#191939 Closes elastic#175220 Adds various optimizations for the Trained Models page: --- - Creates a new Kibana `/trained_models_list` endpoint responsible for fetching complete data for the Trained Model UI page, including pipelines, indices and stats. Before the Trained Models page required 3 endpoints. The new `trained_models_list` replaces them, reducing the overall latency. <img width="715" alt="Screenshot 2024-12-02 at 16 18 32" src="https://github.com/user-attachments/assets/34bebbdc-ae80-4e08-8512-199c57cb5b54"> --- - Optimized fetching of pipelines, indices and stats, reducing the number of API calls to ES Several issues with the old endpoint stemmed from the with_indices flag. This flag triggered a method designed for the Model Map feature, which involved fetching a complete list of pipelines, iterating over each model, retrieving index settings multiple times, and obtaining both index content and a full list of transforms. The new endpoint solves these issues by fetching only the necessary information for the Trained Model page with minimal calls to Elasticsearch. #### APM transaction with a new endpoint <img width="1822" alt="image" src="https://github.com/user-attachments/assets/55e4a5f0-e571-46a2-b7ad-5b5a6fc44ceb"> #### APM transaction with an old endpoint https://github.com/user-attachments/assets/c9d62ddb-5e13-4ac1-9cbf-d685fbed7808 --- - Improves type definitions for different model types ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios (cherry picked from commit e067fa2)
## Summary Closes elastic#191939 Closes elastic#175220 Adds various optimizations for the Trained Models page: --- - Creates a new Kibana `/trained_models_list` endpoint responsible for fetching complete data for the Trained Model UI page, including pipelines, indices and stats. Before the Trained Models page required 3 endpoints. The new `trained_models_list` replaces them, reducing the overall latency. <img width="715" alt="Screenshot 2024-12-02 at 16 18 32" src="https://github.com/user-attachments/assets/34bebbdc-ae80-4e08-8512-199c57cb5b54"> --- - Optimized fetching of pipelines, indices and stats, reducing the number of API calls to ES Several issues with the old endpoint stemmed from the with_indices flag. This flag triggered a method designed for the Model Map feature, which involved fetching a complete list of pipelines, iterating over each model, retrieving index settings multiple times, and obtaining both index content and a full list of transforms. The new endpoint solves these issues by fetching only the necessary information for the Trained Model page with minimal calls to Elasticsearch. #### APM transaction with a new endpoint <img width="1822" alt="image" src="https://github.com/user-attachments/assets/55e4a5f0-e571-46a2-b7ad-5b5a6fc44ceb"> #### APM transaction with an old endpoint https://github.com/user-attachments/assets/c9d62ddb-5e13-4ac1-9cbf-d685fbed7808 --- - Improves type definitions for different model types ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios (cherry picked from commit e067fa2) # Conflicts: # x-pack/plugins/ml/server/shared_services/shared_services.ts
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
… (#203087) # Backport This will backport the following commits from `main` to `8.x`: - [[ML] Trained Models: Optimize trained models Kibana API (#200977)](#200977) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Dima Arnautov","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-04T18:50:18Z","message":"[ML] Trained Models: Optimize trained models Kibana API (#200977)\n\n## Summary\r\n\r\nCloses #191939 \r\nCloses https://github.com/elastic/kibana/issues/175220\r\n\r\nAdds various optimizations for the Trained Models page:\r\n\r\n---\r\n\r\n- Creates a new Kibana `/trained_models_list` endpoint responsible for\r\nfetching complete data for the Trained Model UI page, including\r\npipelines, indices and stats.\r\n\r\nBefore the Trained Models page required 3 endpoints. The new\r\n`trained_models_list` replaces them, reducing the overall latency.\r\n\r\n<img width=\"715\" alt=\"Screenshot 2024-12-02 at 16 18 32\"\r\nsrc=\"https://github.com/user-attachments/assets/34bebbdc-ae80-4e08-8512-199c57cb5b54\">\r\n\r\n\r\n---\r\n\r\n- Optimized fetching of pipelines, indices and stats, reducing the\r\nnumber of API calls to ES\r\n\r\nSeveral issues with the old endpoint stemmed from the with_indices flag.\r\nThis flag triggered a method designed for the Model Map feature, which\r\ninvolved fetching a complete list of pipelines, iterating over each\r\nmodel, retrieving index settings multiple times, and obtaining both\r\nindex content and a full list of transforms.\r\n\r\nThe new endpoint solves these issues by fetching only the necessary\r\ninformation for the Trained Model page with minimal calls to\r\nElasticsearch.\r\n\r\n#### APM transaction with a new endpoint \r\n<img width=\"1822\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/55e4a5f0-e571-46a2-b7ad-5b5a6fc44ceb\">\r\n\r\n#### APM transaction with an old endpoint\r\n\r\n\r\nhttps://github.com/user-attachments/assets/c9d62ddb-5e13-4ac1-9cbf-d685fbed7808\r\n\r\n---\r\n\r\n- Improves type definitions for different model types\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"e067fa239de670123c4f7d6aaba3d6001796babe","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement",":ml","Feature:Data Frame Analytics","v9.0.0","Feature:3rd Party Models","Team:ML","backport:version","v8.17.0","v8.18.0"],"number":200977,"url":"https://github.com/elastic/kibana/pull/200977","mergeCommit":{"message":"[ML] Trained Models: Optimize trained models Kibana API (#200977)\n\n## Summary\r\n\r\nCloses #191939 \r\nCloses https://github.com/elastic/kibana/issues/175220\r\n\r\nAdds various optimizations for the Trained Models page:\r\n\r\n---\r\n\r\n- Creates a new Kibana `/trained_models_list` endpoint responsible for\r\nfetching complete data for the Trained Model UI page, including\r\npipelines, indices and stats.\r\n\r\nBefore the Trained Models page required 3 endpoints. The new\r\n`trained_models_list` replaces them, reducing the overall latency.\r\n\r\n<img width=\"715\" alt=\"Screenshot 2024-12-02 at 16 18 32\"\r\nsrc=\"https://github.com/user-attachments/assets/34bebbdc-ae80-4e08-8512-199c57cb5b54\">\r\n\r\n\r\n---\r\n\r\n- Optimized fetching of pipelines, indices and stats, reducing the\r\nnumber of API calls to ES\r\n\r\nSeveral issues with the old endpoint stemmed from the with_indices flag.\r\nThis flag triggered a method designed for the Model Map feature, which\r\ninvolved fetching a complete list of pipelines, iterating over each\r\nmodel, retrieving index settings multiple times, and obtaining both\r\nindex content and a full list of transforms.\r\n\r\nThe new endpoint solves these issues by fetching only the necessary\r\ninformation for the Trained Model page with minimal calls to\r\nElasticsearch.\r\n\r\n#### APM transaction with a new endpoint \r\n<img width=\"1822\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/55e4a5f0-e571-46a2-b7ad-5b5a6fc44ceb\">\r\n\r\n#### APM transaction with an old endpoint\r\n\r\n\r\nhttps://github.com/user-attachments/assets/c9d62ddb-5e13-4ac1-9cbf-d685fbed7808\r\n\r\n---\r\n\r\n- Improves type definitions for different model types\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"e067fa239de670123c4f7d6aaba3d6001796babe"}},"sourceBranch":"main","suggestedTargetBranches":["8.17","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/200977","number":200977,"mergeCommit":{"message":"[ML] Trained Models: Optimize trained models Kibana API (#200977)\n\n## Summary\r\n\r\nCloses #191939 \r\nCloses https://github.com/elastic/kibana/issues/175220\r\n\r\nAdds various optimizations for the Trained Models page:\r\n\r\n---\r\n\r\n- Creates a new Kibana `/trained_models_list` endpoint responsible for\r\nfetching complete data for the Trained Model UI page, including\r\npipelines, indices and stats.\r\n\r\nBefore the Trained Models page required 3 endpoints. The new\r\n`trained_models_list` replaces them, reducing the overall latency.\r\n\r\n<img width=\"715\" alt=\"Screenshot 2024-12-02 at 16 18 32\"\r\nsrc=\"https://github.com/user-attachments/assets/34bebbdc-ae80-4e08-8512-199c57cb5b54\">\r\n\r\n\r\n---\r\n\r\n- Optimized fetching of pipelines, indices and stats, reducing the\r\nnumber of API calls to ES\r\n\r\nSeveral issues with the old endpoint stemmed from the with_indices flag.\r\nThis flag triggered a method designed for the Model Map feature, which\r\ninvolved fetching a complete list of pipelines, iterating over each\r\nmodel, retrieving index settings multiple times, and obtaining both\r\nindex content and a full list of transforms.\r\n\r\nThe new endpoint solves these issues by fetching only the necessary\r\ninformation for the Trained Model page with minimal calls to\r\nElasticsearch.\r\n\r\n#### APM transaction with a new endpoint \r\n<img width=\"1822\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/55e4a5f0-e571-46a2-b7ad-5b5a6fc44ceb\">\r\n\r\n#### APM transaction with an old endpoint\r\n\r\n\r\nhttps://github.com/user-attachments/assets/c9d62ddb-5e13-4ac1-9cbf-d685fbed7808\r\n\r\n---\r\n\r\n- Improves type definitions for different model types\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"e067fa239de670123c4f7d6aaba3d6001796babe"}},{"branch":"8.17","label":"v8.17.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.18.0","labelRegex":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
…) (#203088) # Backport This will backport the following commits from `main` to `8.17`: - [[ML] Trained Models: Optimize trained models Kibana API (#200977)](#200977) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Dima Arnautov","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-04T18:50:18Z","message":"[ML] Trained Models: Optimize trained models Kibana API (#200977)\n\n## Summary\r\n\r\nCloses #191939 \r\nCloses https://github.com/elastic/kibana/issues/175220\r\n\r\nAdds various optimizations for the Trained Models page:\r\n\r\n---\r\n\r\n- Creates a new Kibana `/trained_models_list` endpoint responsible for\r\nfetching complete data for the Trained Model UI page, including\r\npipelines, indices and stats.\r\n\r\nBefore the Trained Models page required 3 endpoints. The new\r\n`trained_models_list` replaces them, reducing the overall latency.\r\n\r\n<img width=\"715\" alt=\"Screenshot 2024-12-02 at 16 18 32\"\r\nsrc=\"https://github.com/user-attachments/assets/34bebbdc-ae80-4e08-8512-199c57cb5b54\">\r\n\r\n\r\n---\r\n\r\n- Optimized fetching of pipelines, indices and stats, reducing the\r\nnumber of API calls to ES\r\n\r\nSeveral issues with the old endpoint stemmed from the with_indices flag.\r\nThis flag triggered a method designed for the Model Map feature, which\r\ninvolved fetching a complete list of pipelines, iterating over each\r\nmodel, retrieving index settings multiple times, and obtaining both\r\nindex content and a full list of transforms.\r\n\r\nThe new endpoint solves these issues by fetching only the necessary\r\ninformation for the Trained Model page with minimal calls to\r\nElasticsearch.\r\n\r\n#### APM transaction with a new endpoint \r\n<img width=\"1822\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/55e4a5f0-e571-46a2-b7ad-5b5a6fc44ceb\">\r\n\r\n#### APM transaction with an old endpoint\r\n\r\n\r\nhttps://github.com/user-attachments/assets/c9d62ddb-5e13-4ac1-9cbf-d685fbed7808\r\n\r\n---\r\n\r\n- Improves type definitions for different model types\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"e067fa239de670123c4f7d6aaba3d6001796babe","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement",":ml","Feature:Data Frame Analytics","v9.0.0","Feature:3rd Party Models","Team:ML","backport:version","v8.17.0","v8.18.0"],"number":200977,"url":"https://github.com/elastic/kibana/pull/200977","mergeCommit":{"message":"[ML] Trained Models: Optimize trained models Kibana API (#200977)\n\n## Summary\r\n\r\nCloses #191939 \r\nCloses https://github.com/elastic/kibana/issues/175220\r\n\r\nAdds various optimizations for the Trained Models page:\r\n\r\n---\r\n\r\n- Creates a new Kibana `/trained_models_list` endpoint responsible for\r\nfetching complete data for the Trained Model UI page, including\r\npipelines, indices and stats.\r\n\r\nBefore the Trained Models page required 3 endpoints. The new\r\n`trained_models_list` replaces them, reducing the overall latency.\r\n\r\n<img width=\"715\" alt=\"Screenshot 2024-12-02 at 16 18 32\"\r\nsrc=\"https://github.com/user-attachments/assets/34bebbdc-ae80-4e08-8512-199c57cb5b54\">\r\n\r\n\r\n---\r\n\r\n- Optimized fetching of pipelines, indices and stats, reducing the\r\nnumber of API calls to ES\r\n\r\nSeveral issues with the old endpoint stemmed from the with_indices flag.\r\nThis flag triggered a method designed for the Model Map feature, which\r\ninvolved fetching a complete list of pipelines, iterating over each\r\nmodel, retrieving index settings multiple times, and obtaining both\r\nindex content and a full list of transforms.\r\n\r\nThe new endpoint solves these issues by fetching only the necessary\r\ninformation for the Trained Model page with minimal calls to\r\nElasticsearch.\r\n\r\n#### APM transaction with a new endpoint \r\n<img width=\"1822\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/55e4a5f0-e571-46a2-b7ad-5b5a6fc44ceb\">\r\n\r\n#### APM transaction with an old endpoint\r\n\r\n\r\nhttps://github.com/user-attachments/assets/c9d62ddb-5e13-4ac1-9cbf-d685fbed7808\r\n\r\n---\r\n\r\n- Improves type definitions for different model types\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"e067fa239de670123c4f7d6aaba3d6001796babe"}},"sourceBranch":"main","suggestedTargetBranches":["8.17","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/200977","number":200977,"mergeCommit":{"message":"[ML] Trained Models: Optimize trained models Kibana API (#200977)\n\n## Summary\r\n\r\nCloses #191939 \r\nCloses https://github.com/elastic/kibana/issues/175220\r\n\r\nAdds various optimizations for the Trained Models page:\r\n\r\n---\r\n\r\n- Creates a new Kibana `/trained_models_list` endpoint responsible for\r\nfetching complete data for the Trained Model UI page, including\r\npipelines, indices and stats.\r\n\r\nBefore the Trained Models page required 3 endpoints. The new\r\n`trained_models_list` replaces them, reducing the overall latency.\r\n\r\n<img width=\"715\" alt=\"Screenshot 2024-12-02 at 16 18 32\"\r\nsrc=\"https://github.com/user-attachments/assets/34bebbdc-ae80-4e08-8512-199c57cb5b54\">\r\n\r\n\r\n---\r\n\r\n- Optimized fetching of pipelines, indices and stats, reducing the\r\nnumber of API calls to ES\r\n\r\nSeveral issues with the old endpoint stemmed from the with_indices flag.\r\nThis flag triggered a method designed for the Model Map feature, which\r\ninvolved fetching a complete list of pipelines, iterating over each\r\nmodel, retrieving index settings multiple times, and obtaining both\r\nindex content and a full list of transforms.\r\n\r\nThe new endpoint solves these issues by fetching only the necessary\r\ninformation for the Trained Model page with minimal calls to\r\nElasticsearch.\r\n\r\n#### APM transaction with a new endpoint \r\n<img width=\"1822\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/55e4a5f0-e571-46a2-b7ad-5b5a6fc44ceb\">\r\n\r\n#### APM transaction with an old endpoint\r\n\r\n\r\nhttps://github.com/user-attachments/assets/c9d62ddb-5e13-4ac1-9cbf-d685fbed7808\r\n\r\n---\r\n\r\n- Improves type definitions for different model types\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"e067fa239de670123c4f7d6aaba3d6001796babe"}},{"branch":"8.17","label":"v8.17.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.18.0","labelRegex":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> --------- Co-authored-by: kibanamachine <[email protected]>
## Summary Closes elastic#191939 Closes elastic#175220 Adds various optimizations for the Trained Models page: --- - Creates a new Kibana `/trained_models_list` endpoint responsible for fetching complete data for the Trained Model UI page, including pipelines, indices and stats. Before the Trained Models page required 3 endpoints. The new `trained_models_list` replaces them, reducing the overall latency. <img width="715" alt="Screenshot 2024-12-02 at 16 18 32" src="https://github.com/user-attachments/assets/34bebbdc-ae80-4e08-8512-199c57cb5b54"> --- - Optimized fetching of pipelines, indices and stats, reducing the number of API calls to ES Several issues with the old endpoint stemmed from the with_indices flag. This flag triggered a method designed for the Model Map feature, which involved fetching a complete list of pipelines, iterating over each model, retrieving index settings multiple times, and obtaining both index content and a full list of transforms. The new endpoint solves these issues by fetching only the necessary information for the Trained Model page with minimal calls to Elasticsearch. #### APM transaction with a new endpoint <img width="1822" alt="image" src="https://github.com/user-attachments/assets/55e4a5f0-e571-46a2-b7ad-5b5a6fc44ceb"> #### APM transaction with an old endpoint https://github.com/user-attachments/assets/c9d62ddb-5e13-4ac1-9cbf-d685fbed7808 --- - Improves type definitions for different model types ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
## Summary Closes elastic#191939 Closes elastic#175220 Adds various optimizations for the Trained Models page: --- - Creates a new Kibana `/trained_models_list` endpoint responsible for fetching complete data for the Trained Model UI page, including pipelines, indices and stats. Before the Trained Models page required 3 endpoints. The new `trained_models_list` replaces them, reducing the overall latency. <img width="715" alt="Screenshot 2024-12-02 at 16 18 32" src="https://github.com/user-attachments/assets/34bebbdc-ae80-4e08-8512-199c57cb5b54"> --- - Optimized fetching of pipelines, indices and stats, reducing the number of API calls to ES Several issues with the old endpoint stemmed from the with_indices flag. This flag triggered a method designed for the Model Map feature, which involved fetching a complete list of pipelines, iterating over each model, retrieving index settings multiple times, and obtaining both index content and a full list of transforms. The new endpoint solves these issues by fetching only the necessary information for the Trained Model page with minimal calls to Elasticsearch. #### APM transaction with a new endpoint <img width="1822" alt="image" src="https://github.com/user-attachments/assets/55e4a5f0-e571-46a2-b7ad-5b5a6fc44ceb"> #### APM transaction with an old endpoint https://github.com/user-attachments/assets/c9d62ddb-5e13-4ac1-9cbf-d685fbed7808 --- - Improves type definitions for different model types ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
## Summary Closes elastic#191939 Closes elastic#175220 Adds various optimizations for the Trained Models page: --- - Creates a new Kibana `/trained_models_list` endpoint responsible for fetching complete data for the Trained Model UI page, including pipelines, indices and stats. Before the Trained Models page required 3 endpoints. The new `trained_models_list` replaces them, reducing the overall latency. <img width="715" alt="Screenshot 2024-12-02 at 16 18 32" src="https://github.com/user-attachments/assets/34bebbdc-ae80-4e08-8512-199c57cb5b54"> --- - Optimized fetching of pipelines, indices and stats, reducing the number of API calls to ES Several issues with the old endpoint stemmed from the with_indices flag. This flag triggered a method designed for the Model Map feature, which involved fetching a complete list of pipelines, iterating over each model, retrieving index settings multiple times, and obtaining both index content and a full list of transforms. The new endpoint solves these issues by fetching only the necessary information for the Trained Model page with minimal calls to Elasticsearch. #### APM transaction with a new endpoint <img width="1822" alt="image" src="https://github.com/user-attachments/assets/55e4a5f0-e571-46a2-b7ad-5b5a6fc44ceb"> #### APM transaction with an old endpoint https://github.com/user-attachments/assets/c9d62ddb-5e13-4ac1-9cbf-d685fbed7808 --- - Improves type definitions for different model types ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
## Summary Closes elastic#191939 Closes elastic#175220 Adds various optimizations for the Trained Models page: --- - Creates a new Kibana `/trained_models_list` endpoint responsible for fetching complete data for the Trained Model UI page, including pipelines, indices and stats. Before the Trained Models page required 3 endpoints. The new `trained_models_list` replaces them, reducing the overall latency. <img width="715" alt="Screenshot 2024-12-02 at 16 18 32" src="https://github.com/user-attachments/assets/34bebbdc-ae80-4e08-8512-199c57cb5b54"> --- - Optimized fetching of pipelines, indices and stats, reducing the number of API calls to ES Several issues with the old endpoint stemmed from the with_indices flag. This flag triggered a method designed for the Model Map feature, which involved fetching a complete list of pipelines, iterating over each model, retrieving index settings multiple times, and obtaining both index content and a full list of transforms. The new endpoint solves these issues by fetching only the necessary information for the Trained Model page with minimal calls to Elasticsearch. #### APM transaction with a new endpoint <img width="1822" alt="image" src="https://github.com/user-attachments/assets/55e4a5f0-e571-46a2-b7ad-5b5a6fc44ceb"> #### APM transaction with an old endpoint https://github.com/user-attachments/assets/c9d62ddb-5e13-4ac1-9cbf-d685fbed7808 --- - Improves type definitions for different model types ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
## Summary Closes elastic#191939 Closes elastic#175220 Adds various optimizations for the Trained Models page: --- - Creates a new Kibana `/trained_models_list` endpoint responsible for fetching complete data for the Trained Model UI page, including pipelines, indices and stats. Before the Trained Models page required 3 endpoints. The new `trained_models_list` replaces them, reducing the overall latency. <img width="715" alt="Screenshot 2024-12-02 at 16 18 32" src="https://github.com/user-attachments/assets/34bebbdc-ae80-4e08-8512-199c57cb5b54"> --- - Optimized fetching of pipelines, indices and stats, reducing the number of API calls to ES Several issues with the old endpoint stemmed from the with_indices flag. This flag triggered a method designed for the Model Map feature, which involved fetching a complete list of pipelines, iterating over each model, retrieving index settings multiple times, and obtaining both index content and a full list of transforms. The new endpoint solves these issues by fetching only the necessary information for the Trained Model page with minimal calls to Elasticsearch. #### APM transaction with a new endpoint <img width="1822" alt="image" src="https://github.com/user-attachments/assets/55e4a5f0-e571-46a2-b7ad-5b5a6fc44ceb"> #### APM transaction with an old endpoint https://github.com/user-attachments/assets/c9d62ddb-5e13-4ac1-9cbf-d685fbed7808 --- - Improves type definitions for different model types ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
Summary
Closes #191939
Closes #175220
Adds various optimizations for the Trained Models page:
/trained_models_list
endpoint responsible for fetching complete data for the Trained Model UI page, including pipelines, indices and stats.Before the Trained Models page required 3 endpoints. The new
trained_models_list
replaces them, reducing the overall latency.Several issues with the old endpoint stemmed from the with_indices flag. This flag triggered a method designed for the Model Map feature, which involved fetching a complete list of pipelines, iterating over each model, retrieving index settings multiple times, and obtaining both index content and a full list of transforms.
The new endpoint solves these issues by fetching only the necessary information for the Trained Model page with minimal calls to Elasticsearch.
APM transaction with a new endpoint
APM transaction with an old endpoint
Screen.Recording.2024-12-02.at.16.10.51.mov
Checklist