-
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
Reduce requests for all fields #184441
Comments
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
We would love to use field caps here, but we need the ability to detect runtime fields, which I don't think fieldcaps supports.
This call is made when configuring Field-Level Security ("FLS") within a role definition. Creating/updating roles is an administrative operation, and shouldn't occur too frequently.
We provide the list of fields within a combobox to allow administrators to select which fields to grant/restrict access to. If there's a way for us to page/search these results, then we'd be happy to consider doing so. We would love a more performant option. We've had issues in the past with this feature (#47378), to which we've applied band-aids. |
|
x-pack/plugins/search_playground/server/lib/fetch_query_source_fields.ts:58 @elastic/enterprise-search-frontend is called when the user chooses an index to determine what type of fields are in the indices chosen (the user can choose one or more indices to search on). Its called on change of index and shouldn't be called too frequently. Its cached on client side and the call is only made when the indices change (user action). The indices chosen are typically indices for search application data and tend to have smaller number of fields. |
Fetched when viewing a Search Application or its documents in the Search Application Documents Explorer. We use it to show the user which fields are present in the index (which we should just use mappings for), but we also use it to show the user which fields have conflicts. Search Applications are effectively index aliases with multiple backing indices, so having fields with the same name but different types in both indices are a common source of issues preventing Search Applications from working correctly. This call shouldn't happen very often as we don't see users going back to their search application after creation a lot. @joemcelroy AFAICT we don't actually do anything with the capabilities in the creation step for Search Applications, just the list of fields. We can just use mappings for that instead if it's cheaper, but probably not worth the effort. |
Thank you @legrego @yuliacech @joemcelroy @sphilipse - exactly what I was asking for! |
We are using |
@benakansara That would be much appreciated. |
Regarding
It called once when the user starts the wizard to create an new anomaly detection or data frame analytics job, so pretty rare.
We match up fields with supported ML functions (like aggregations) to allow the user to select one for a AD job detector or DFA job. Which creates the detector:
Regarding
It is called a few times during the use of the new transform wizard creating a Latest transform. I would guess on average 2 or 3 times while the user is making changes to the configuration.
We need to preview the destination index which will have the same mappings as the source index. |
@mattkime my team owns x-pack/plugins/observability_solution/apm/server/routes/correlations/queries/fetch_duration_field_candidates.ts:58, but that code was written by the ML UI team, so they might be able to update it along with the other items. x-pack/plugins/observability_solution/infra/server/lib/alerting/common/utils.ts:199 can probably also be handled by @elastic/obs-ux-management-team |
This code is used as part of the correlation analysis feature for Latency Correlations and Failed Transaction Correlations. How often is a given call made?It's not used in any kind of automation. The call will be made only once when a user runs correlation analysis. We need to run field caps to identify fields suitable for the analysis. Is it necessary to load all fields? If so, why?We need to fetch all fields because it's necessary as part of the analysis to identify which fields are suitable for analysis. However, I noticed when we originally implemented this, filtering of field types was not available. It was introduced in 8.2 (https://www.elastic.co/guide/en/elasticsearch/reference/current/release-notes-8.2.0.html) and we could update the existing code to make use of this. Create an issue to track this: #185875 Update 8.15: We merged some optimizations in #186182 |
This code is used as part of the AIOps Log Rate Analysis feature. How often is a given call made?It's not used in any kind of automation. The call will be made only once when a user runs log rate analysis. We need to run field caps to identify fields suitable for the analysis. Is it necessary to load all fields? If so, why?We need to fetch all fields because it's necessary as part of the analysis to identify which fields are suitable for analysis. In 8.14 we started to make use of filters to limit the scope of the query: #181109 The following parameters were added to improve the call:
|
I'm closing this issue since all the high priority items have been completed and the low priority items can be treated like normal tech debt if any change is appropriate. |
Field caps requests have historically been treated as free but with large datasets that can be slow, large, and increase the cost of operations. There are a number of places in the Kibana codebase where all fields are loaded - these should be reviewed.
For instance, alerts may run every couple of minutes and are therefore highest priority for improvement. Next, it could be called by a common dashboard like view - still being run many times a day and might be slow for the user. Last, they might only be called when creating something. These would be lowest priority and could be treated like ordinary tech debt.
Might be nice to add a comment in the codebase.
Low priority for optimization
x-pack/plugins/enterprise_search/server/lib/search_applications/field_capabilities.ts:39
@elastic/enterprise-search-frontendx-pack/plugins/security/server/routes/indices/get_fields.ts:24
- this is hitting getFieldMapping but its probably still worth the conversation @elastic/kibana-securityx-pack/plugins/rollup/server/routes/api/indices/register_validate_index_pattern_route.ts:74
@elastic/kibana-managementx-pack/plugins/search_playground/server/lib/fetch_query_source_fields.ts:58
@elastic/enterprise-search-frontendx-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_index_info.ts:46
@elastic/ml-uix-pack/plugins/observability_solution/apm/server/routes/correlations/queries/fetch_duration_field_candidates.ts:58
@elastic/obs-ux-infra_services-teamx-pack/plugins/ml/server/models/job_service/new_job_caps/field_service.ts:74
@elastic/ml-uix-pack/plugins/transform/server/routes/api/transforms_preview/route_handler.ts:37
@elastic/ml-uiHigher priority for optimization
x-pack/plugins/observability_solution/infra/server/lib/alerting/common/utils.ts:199
@elastic/obs-ux-logs-team @elastic/obs-ux-infra_services-teamx-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/utils.ts:133
@elastic/obs-ux-management-teamThe text was updated successfully, but these errors were encountered: