[CPS] onRequest handler improvements#253697
Merged
Merged
Conversation
4fb8d25 to
bab1981
Compare
jloleysens
reviewed
Feb 18, 2026
| } | ||
|
|
||
| public readonly onRequest: OnRequestHandler = (_ctx, params, _options) => { | ||
| if (!this.isServerless) return; |
Contributor
There was a problem hiding this comment.
if serverless is false we still wanna run:
if (body?.project_routing != null) delete body.project_routing;
Right now that will be short circuited.
Contributor
|
Pinging @elastic/kibana-core (Team:Core) |
jloleysens
approved these changes
Feb 18, 2026
bdo-elastic
approved these changes
Feb 18, 2026
afharo
approved these changes
Feb 18, 2026
nreese
approved these changes
Feb 18, 2026
Contributor
nreese
left a comment
There was a problem hiding this comment.
kibana-presentation changes LGTM
code review only
…equest() calls Co-authored-by: Cursor <cursoragent@cursor.com>
The ElasticsearchService now reads the cps.cpsEnabled config directly from the configService during setup, removing the need for the setCpsFeatureFlag setter pattern. The CpsRequestHandler is only instantiated in serverless mode, and the onRequest handler is only passed to ClusterClient when applicable. Co-authored-by: Cursor <cursoragent@cursor.com>
…anch) Co-authored-by: Cursor <cursoragent@cursor.com>
6e26d80 to
dfda0dc
Compare
Contributor
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
History
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Closes https://github.com/elastic/kibana-team/issues/2845
Stripping project_routing
project_routingpresent inbodyto prevent ES request failures.pit, the logic strips it away. Note that PIT-based searches define theproject_routingglobally when callingopenPit.Cleanup
The logic for request handling has been moved to a separate
CpsRequestHandlerclass, preventing from cluttering theElasticsearchService.CPS config from configService
The
setCpsFeatureFlagsetter has been removed from theElasticsearchServiceSetupcontract. Instead, theElasticsearchServicenow reads thecps.cpsEnabledconfiguration directly from theconfigServiceduring setup. WhencpsEnabledis false, the handler must still strip anyproject_routinginformation from the request.body.