Adding params for enabling and disabling mapping_stats and analysis_s… #14447
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…tats with flags
Description
The current implementation of the cluster stats API includes mapping and analysis stats by default. While this does not cause any significant overhead for small and medium clusters, iterating over the entire cluster state on the coordinator node to generate these stats can incur significant overhead in large clusters, especially with complex mappings or a large cluster state.
This pull request proposes introducing a new experimental flag,
opensearch.experimental.optimization.cluster_stats.response_level(default: 2), to control the inclusion of mapping and analysis stats in the cluster stats response:Benefits:
For users who still require mapping and analysis stats at response level 1, the following parameters can be included in the REST call:
include_mapping_stats-> To include mapping statsinclude_analysis_stats-> To include analysis statsMy Take on Response Levels:
While the introduction of response levels is an experimental step in this PR, it might be beneficial to explore further granularity in the future. Providing additional parameters within the REST API to allow users to choose specific layers of ClusterStats response would offer even finer control over the response content and minimize data transfer for various use cases.
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.