-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add execution context service (#102039)
* add execution context service on the server-side * integrate execution context service into http service * add integration tests for execution context + http server * update core code * update integration tests * update settings docs * add execution context test plugin * add a client-side test * remove requestId from execution context * add execution context service for the client side * expose execution context service to plugins * add execution context service for the server-side * update http service * update elasticsearch service * move integration tests from http to execution_context service * integrate in es client * expose to plugins * refactor functional tests * remove x-opaque-id from create_cluster tests * update test plugin package.json * fix type errors in the test mocks * fix elasticsearch service tests * add escaping to support non-ascii symbols in description field * improve test coverage * update docs * remove unnecessary import * update docs * Apply suggestions from code review Co-authored-by: Josh Dover <1813008+joshdover@users.noreply.github.com> * address comments * remove execution context cleanup * add option to disable execution_context service on the server side * put x-opaque-id test back * put tests back * add header size limitation to the server side as well * fix integration tests * address comments Co-authored-by: Josh Dover <1813008+joshdover@users.noreply.github.com>
- Loading branch information
Showing
99 changed files
with
2,182 additions
and
32 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
...development/core/public/kibana-plugin-core-public.corestart.executioncontext.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [CoreStart](./kibana-plugin-core-public.corestart.md) > [executionContext](./kibana-plugin-core-public.corestart.executioncontext.md) | ||
|
||
## CoreStart.executionContext property | ||
|
||
[ExecutionContextServiceStart](./kibana-plugin-core-public.executioncontextservicestart.md) | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
executionContext: ExecutionContextServiceStart; | ||
``` |
This file contains 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
19 changes: 19 additions & 0 deletions
19
...nt/core/public/kibana-plugin-core-public.executioncontextservicestart.create.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [ExecutionContextServiceStart](./kibana-plugin-core-public.executioncontextservicestart.md) > [create](./kibana-plugin-core-public.executioncontextservicestart.create.md) | ||
|
||
## ExecutionContextServiceStart.create property | ||
|
||
Creates a context container carrying the meta-data of a runtime operation. Provided meta-data will be propagated to Kibana and Elasticsearch servers. | ||
|
||
```js | ||
const context = executionContext.create(...); | ||
http.fetch('/endpoint/', { context }); | ||
|
||
``` | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
create: (context: KibanaExecutionContext) => IExecutionContextContainer; | ||
``` |
25 changes: 25 additions & 0 deletions
25
...velopment/core/public/kibana-plugin-core-public.executioncontextservicestart.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [ExecutionContextServiceStart](./kibana-plugin-core-public.executioncontextservicestart.md) | ||
|
||
## ExecutionContextServiceStart interface | ||
|
||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface ExecutionContextServiceStart | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Type | Description | | ||
| --- | --- | --- | | ||
| [create](./kibana-plugin-core-public.executioncontextservicestart.create.md) | <code>(context: KibanaExecutionContext) => IExecutionContextContainer</code> | Creates a context container carrying the meta-data of a runtime operation. Provided meta-data will be propagated to Kibana and Elasticsearch servers. | ||
```js | ||
const context = executionContext.create(...); | ||
http.fetch('/endpoint/', { context }); | ||
|
||
``` | ||
| | ||
|
11 changes: 11 additions & 0 deletions
11
docs/development/core/public/kibana-plugin-core-public.httpfetchoptions.context.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [HttpFetchOptions](./kibana-plugin-core-public.httpfetchoptions.md) > [context](./kibana-plugin-core-public.httpfetchoptions.context.md) | ||
|
||
## HttpFetchOptions.context property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
context?: IExecutionContextContainer; | ||
``` |
This file contains 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
19 changes: 19 additions & 0 deletions
19
...development/core/public/kibana-plugin-core-public.iexecutioncontextcontainer.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [IExecutionContextContainer](./kibana-plugin-core-public.iexecutioncontextcontainer.md) | ||
|
||
## IExecutionContextContainer interface | ||
|
||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface IExecutionContextContainer | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Type | Description | | ||
| --- | --- | --- | | ||
| [toHeader](./kibana-plugin-core-public.iexecutioncontextcontainer.toheader.md) | <code>() => Record<string, string></code> | | | ||
|
11 changes: 11 additions & 0 deletions
11
...nt/core/public/kibana-plugin-core-public.iexecutioncontextcontainer.toheader.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [IExecutionContextContainer](./kibana-plugin-core-public.iexecutioncontextcontainer.md) > [toHeader](./kibana-plugin-core-public.iexecutioncontextcontainer.toheader.md) | ||
|
||
## IExecutionContextContainer.toHeader property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
toHeader: () => Record<string, string>; | ||
``` |
13 changes: 13 additions & 0 deletions
13
...ent/core/public/kibana-plugin-core-public.kibanaexecutioncontext.description.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [KibanaExecutionContext](./kibana-plugin-core-public.kibanaexecutioncontext.md) > [description](./kibana-plugin-core-public.kibanaexecutioncontext.description.md) | ||
|
||
## KibanaExecutionContext.description property | ||
|
||
human readable description. For example, a vis title, action name | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
readonly description: string; | ||
``` |
13 changes: 13 additions & 0 deletions
13
.../development/core/public/kibana-plugin-core-public.kibanaexecutioncontext.id.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [KibanaExecutionContext](./kibana-plugin-core-public.kibanaexecutioncontext.md) > [id](./kibana-plugin-core-public.kibanaexecutioncontext.id.md) | ||
|
||
## KibanaExecutionContext.id property | ||
|
||
unique value to indentify find the source | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
readonly id: string; | ||
``` |
23 changes: 23 additions & 0 deletions
23
docs/development/core/public/kibana-plugin-core-public.kibanaexecutioncontext.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [KibanaExecutionContext](./kibana-plugin-core-public.kibanaexecutioncontext.md) | ||
|
||
## KibanaExecutionContext interface | ||
|
||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface KibanaExecutionContext | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Type | Description | | ||
| --- | --- | --- | | ||
| [description](./kibana-plugin-core-public.kibanaexecutioncontext.description.md) | <code>string</code> | human readable description. For example, a vis title, action name | | ||
| [id](./kibana-plugin-core-public.kibanaexecutioncontext.id.md) | <code>string</code> | unique value to indentify find the source | | ||
| [name](./kibana-plugin-core-public.kibanaexecutioncontext.name.md) | <code>string</code> | public name of a user-facing feature | | ||
| [type](./kibana-plugin-core-public.kibanaexecutioncontext.type.md) | <code>string</code> | Kibana application initated an operation. Can be narrowed to an enum later. | | ||
| [url](./kibana-plugin-core-public.kibanaexecutioncontext.url.md) | <code>string</code> | in browser - url to navigate to a current page, on server - endpoint path, for task: task SO url | | ||
|
13 changes: 13 additions & 0 deletions
13
...evelopment/core/public/kibana-plugin-core-public.kibanaexecutioncontext.name.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [KibanaExecutionContext](./kibana-plugin-core-public.kibanaexecutioncontext.md) > [name](./kibana-plugin-core-public.kibanaexecutioncontext.name.md) | ||
|
||
## KibanaExecutionContext.name property | ||
|
||
public name of a user-facing feature | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
readonly name: string; | ||
``` |
13 changes: 13 additions & 0 deletions
13
...evelopment/core/public/kibana-plugin-core-public.kibanaexecutioncontext.type.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [KibanaExecutionContext](./kibana-plugin-core-public.kibanaexecutioncontext.md) > [type](./kibana-plugin-core-public.kibanaexecutioncontext.type.md) | ||
|
||
## KibanaExecutionContext.type property | ||
|
||
Kibana application initated an operation. Can be narrowed to an enum later. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
readonly type: string; | ||
``` |
13 changes: 13 additions & 0 deletions
13
...development/core/public/kibana-plugin-core-public.kibanaexecutioncontext.url.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [KibanaExecutionContext](./kibana-plugin-core-public.kibanaexecutioncontext.md) > [url](./kibana-plugin-core-public.kibanaexecutioncontext.url.md) | ||
|
||
## KibanaExecutionContext.url property | ||
|
||
in browser - url to navigate to a current page, on server - endpoint path, for task: task SO url | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
readonly url?: string; | ||
``` |
This file contains 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
13 changes: 13 additions & 0 deletions
13
...development/core/server/kibana-plugin-core-server.coresetup.executioncontext.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [CoreSetup](./kibana-plugin-core-server.coresetup.md) > [executionContext](./kibana-plugin-core-server.coresetup.executioncontext.md) | ||
|
||
## CoreSetup.executionContext property | ||
|
||
[ExecutionContextSetup](./kibana-plugin-core-server.executioncontextsetup.md) | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
executionContext: ExecutionContextSetup; | ||
``` |
This file contains 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
13 changes: 13 additions & 0 deletions
13
...development/core/server/kibana-plugin-core-server.corestart.executioncontext.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [CoreStart](./kibana-plugin-core-server.corestart.md) > [executionContext](./kibana-plugin-core-server.corestart.executioncontext.md) | ||
|
||
## CoreStart.executionContext property | ||
|
||
[ExecutionContextStart](./kibana-plugin-core-server.executioncontextstart.md) | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
executionContext: ExecutionContextStart; | ||
``` |
This file contains 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
17 changes: 17 additions & 0 deletions
17
.../development/core/server/kibana-plugin-core-server.executioncontextsetup.get.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [ExecutionContextSetup](./kibana-plugin-core-server.executioncontextsetup.md) > [get](./kibana-plugin-core-server.executioncontextsetup.get.md) | ||
|
||
## ExecutionContextSetup.get() method | ||
|
||
Retrieves an opearation meta-data for the current async context. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
get(): IExecutionContextContainer | undefined; | ||
``` | ||
<b>Returns:</b> | ||
|
||
`IExecutionContextContainer | undefined` | ||
|
20 changes: 20 additions & 0 deletions
20
docs/development/core/server/kibana-plugin-core-server.executioncontextsetup.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [ExecutionContextSetup](./kibana-plugin-core-server.executioncontextsetup.md) | ||
|
||
## ExecutionContextSetup interface | ||
|
||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface ExecutionContextSetup | ||
``` | ||
|
||
## Methods | ||
|
||
| Method | Description | | ||
| --- | --- | | ||
| [get()](./kibana-plugin-core-server.executioncontextsetup.get.md) | Retrieves an opearation meta-data for the current async context. | | ||
| [set(context)](./kibana-plugin-core-server.executioncontextsetup.set.md) | Stores the meta-data of a runtime operation. Data are carried over all async operations automatically. The sequential calls merge provided "context" object shallowly. | | ||
|
24 changes: 24 additions & 0 deletions
24
.../development/core/server/kibana-plugin-core-server.executioncontextsetup.set.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [ExecutionContextSetup](./kibana-plugin-core-server.executioncontextsetup.md) > [set](./kibana-plugin-core-server.executioncontextsetup.set.md) | ||
|
||
## ExecutionContextSetup.set() method | ||
|
||
Stores the meta-data of a runtime operation. Data are carried over all async operations automatically. The sequential calls merge provided "context" object shallowly. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
set(context: Partial<KibanaServerExecutionContext>): void; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| context | <code>Partial<KibanaServerExecutionContext></code> | | | ||
|
||
<b>Returns:</b> | ||
|
||
`void` | ||
|
12 changes: 12 additions & 0 deletions
12
docs/development/core/server/kibana-plugin-core-server.executioncontextstart.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [ExecutionContextStart](./kibana-plugin-core-server.executioncontextstart.md) | ||
|
||
## ExecutionContextStart type | ||
|
||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare type ExecutionContextStart = ExecutionContextSetup; | ||
``` |
Oops, something went wrong.