enable execution_context by default #119932
Merged
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 #102706
Since the last time @dmlemeshko conducted load testing, Kibana has made several changes that have a significant impact on
execution_context
performance: upgrade nodejs to v16 and enable async_hooks by defaultSo the new testing is necessary. We want to enable
execution_context
by default to provide the best UX with Kibana query source propagation to the Elasticsearch server.Benchmarks
I use the standard DemoJourney scenario from https://github.com/elastic/kibana-load-testing
95pt of the response time shows the difference within the statistical error.
main branch
PR brach
Plugin API changes
It might be hard in the distributed environment to understand what Kibana entity initiated a request to the Elasticsearch server. To overcome this problem we introduced a content of
execution_context
to attach domain-specific metadata to every request.execution_context
propagates specified metadata from the Kibana browser app or Kibana server to the Elasticsearch server viax-opaque-id
header emitted to the Elasticsearch slow logs. For further details check a troubleshooting guide here.Execution context has the following interface:
Kibana plugin can attach request specific metadata to an outbound HTTP request on the client side as
and on the server-side you need to wrap any async operation with
withContext
helper:Then, in Elasticsearch
slow logs
you might find a hint that a request was initiated bymy-plugin-ui-feature
feature ofmy-app
application and proxied throughmy-plugin-server-feature
features ofmy-app-server
app:Checklist
Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
execution context
tracking might be higher than anticipated.For maintainers