diff --git a/.ci/packer_cache.sh b/.ci/packer_cache.sh
index e4b5e35e1e4a9..5317b2c500b49 100755
--- a/.ci/packer_cache.sh
+++ b/.ci/packer_cache.sh
@@ -2,5 +2,8 @@
set -e
+# cache image used by kibana-load-testing project
+docker pull "maven:3.6.3-openjdk-8-slim"
+
./.ci/packer_cache_for_branch.sh master
./.ci/packer_cache_for_branch.sh 7.x
diff --git a/.eslintrc.js b/.eslintrc.js
index b70090a50e64d..ab868c29b7bed 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -89,6 +89,72 @@ const SAFER_LODASH_SET_DEFINITELYTYPED_HEADER = `
*/
`;
+/** Packages which should not be included within production code. */
+const DEV_PACKAGES = [
+ 'kbn-babel-code-parser',
+ 'kbn-dev-utils',
+ 'kbn-docs-utils',
+ 'kbn-es*',
+ 'kbn-eslint*',
+ 'kbn-optimizer',
+ 'kbn-plugin-generator',
+ 'kbn-plugin-helpers',
+ 'kbn-pm',
+ 'kbn-storybook',
+ 'kbn-telemetry-tools',
+ 'kbn-test',
+];
+
+/** Directories (at any depth) which include dev-only code. */
+const DEV_DIRECTORIES = [
+ '.storybook',
+ '__tests__',
+ '__test__',
+ '__jest__',
+ '__fixtures__',
+ '__mocks__',
+ '__stories__',
+ 'e2e',
+ 'fixtures',
+ 'ftr_e2e',
+ 'integration_tests',
+ 'manual_tests',
+ 'mock',
+ 'storybook',
+ 'scripts',
+ 'test',
+ 'test-d',
+ 'test_utils',
+ 'test_utilities',
+ 'test_helpers',
+ 'tests_client_integration',
+];
+
+/** File patterns for dev-only code. */
+const DEV_FILE_PATTERNS = [
+ '*.mock.{js,ts,tsx}',
+ '*.test.{js,ts,tsx}',
+ '*.test.helpers.{js,ts,tsx}',
+ '*.stories.{js,ts,tsx}',
+ '*.story.{js,ts,tsx}',
+ '*.stub.{js,ts,tsx}',
+ 'mock.{js,ts,tsx}',
+ '_stubs.{js,ts,tsx}',
+ '{testHelpers,test_helper,test_utils}.{js,ts,tsx}',
+ '{postcss,webpack}.config.js',
+];
+
+/** Glob patterns which describe dev-only code. */
+const DEV_PATTERNS = [
+ ...DEV_PACKAGES.map((pkg) => `packages/${pkg}/**/*`),
+ ...DEV_DIRECTORIES.map((dir) => `{packages,src,x-pack}/**/${dir}/**/*`),
+ ...DEV_FILE_PATTERNS.map((file) => `{packages,src,x-pack}/**/${file}`),
+ 'packages/kbn-interpreter/tasks/**/*',
+ 'src/dev/**/*',
+ 'x-pack/{dev-tools,tasks,scripts,test,build_chromium}/**/*',
+ 'x-pack/plugins/*/server/scripts/**/*',
+];
+
module.exports = {
root: true,
@@ -491,43 +557,17 @@ module.exports = {
},
/**
- * Files that ARE NOT allowed to use devDependencies
- */
- {
- files: ['x-pack/**/*.js', 'packages/kbn-interpreter/**/*.js'],
- rules: {
- 'import/no-extraneous-dependencies': [
- 'error',
- {
- devDependencies: false,
- peerDependencies: true,
- packageDir: '.',
- },
- ],
- },
- },
-
- /**
- * Files that ARE allowed to use devDependencies
+ * Single package.json rules, it tells eslint to ignore the child package.json files
+ * and look for dependencies declarations in the single and root level package.json
*/
{
- files: [
- 'packages/kbn-es/src/**/*.js',
- 'packages/kbn-interpreter/tasks/**/*.js',
- 'packages/kbn-interpreter/src/plugin/**/*.js',
- 'x-pack/{dev-tools,tasks,scripts,test,build_chromium}/**/*.js',
- 'x-pack/**/{__tests__,__test__,__jest__,__fixtures__,__mocks__,public}/**/*.js',
- 'x-pack/**/*.test.js',
- 'x-pack/test_utils/**/*',
- 'x-pack/gulpfile.js',
- 'x-pack/plugins/apm/public/utils/testHelpers.js',
- 'x-pack/plugins/canvas/shareable_runtime/postcss.config.js',
- ],
+ files: ['{src,x-pack,packages}/**/*.{js,mjs,ts,tsx}'],
rules: {
'import/no-extraneous-dependencies': [
'error',
{
- devDependencies: true,
+ /* Files that ARE allowed to use devDependencies */
+ devDependencies: [...DEV_PATTERNS],
peerDependencies: true,
packageDir: '.',
},
@@ -1420,21 +1460,5 @@ module.exports = {
],
},
},
-
- /**
- * Single package.json rules, it tells eslint to ignore the child package.json files
- * and look for dependencies declarations in the single and root level package.json
- */
- {
- files: ['**/*.{js,mjs,ts,tsx}'],
- rules: {
- 'import/no-extraneous-dependencies': [
- 'error',
- {
- packageDir: '.',
- },
- ],
- },
- },
],
};
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 2f2f260addb35..33b3e4a7dede6 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -59,6 +59,7 @@
/x-pack/plugins/embeddable_enhanced/ @elastic/kibana-app-services
/x-pack/plugins/ui_actions_enhanced/ @elastic/kibana-app-services
/x-pack/plugins/runtime_fields @elastic/kibana-app-services
+/x-pack/test/search_sessions_integration/ @elastic/kibana-app-services
#CC# /src/plugins/bfetch/ @elastic/kibana-app-services
#CC# /src/plugins/index_pattern_management/ @elastic/kibana-app-services
#CC# /src/plugins/inspector/ @elastic/kibana-app-services
diff --git a/.github/ISSUE_TEMPLATE/Question.md b/.github/ISSUE_TEMPLATE/Question.md
deleted file mode 100644
index 38fcb7af30b47..0000000000000
--- a/.github/ISSUE_TEMPLATE/Question.md
+++ /dev/null
@@ -1,15 +0,0 @@
----
-name: Question
-about: Who, what, when, where, and how?
-
----
-
-Hey, stop right there!
-
-We use GitHub to track feature requests and bug reports. Please do not submit issues for questions about how to use features of Kibana, how to set Kibana up, best practices, or development related help.
-
-However, we do want to help! Head on over to our official Kibana forums and ask your questions there. In additional to awesome, knowledgeable community contributors, core Kibana developers are on the forums every single day to help you out.
-
-The forums are here: https://discuss.elastic.co/c/kibana
-
-We can't stop you from opening an issue here, but it will likely linger without a response for days or weeks before it is closed and we ask you to join us on the forums instead. Save yourself the time, and ask on the forums today.
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 0000000000000..348d756c141b0
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,5 @@
+blank_issues_enabled: true
+contact_links:
+ - name: Question
+ url: https://discuss.elastic.co/c/kibana
+ about: Please ask and answer questions here.
diff --git a/dev_docs/assets/api_doc_pick.png b/dev_docs/assets/api_doc_pick.png
new file mode 100644
index 0000000000000..825fa47b266cb
Binary files /dev/null and b/dev_docs/assets/api_doc_pick.png differ
diff --git a/dev_docs/assets/dev_docs_nested_object.png b/dev_docs/assets/dev_docs_nested_object.png
new file mode 100644
index 0000000000000..a6b2f533b3858
Binary files /dev/null and b/dev_docs/assets/dev_docs_nested_object.png differ
diff --git a/dev_docs/best_practices.mdx b/dev_docs/best_practices.mdx
index 6156c05197289..4d51263f93372 100644
--- a/dev_docs/best_practices.mdx
+++ b/dev_docs/best_practices.mdx
@@ -12,6 +12,132 @@ tags: ['kibana', 'onboarding', 'dev', 'architecture']
First things first, be sure to review our and check out all the available
platform that can simplify plugin development.
+## Developer documentation
+
+### High-level documentation
+
+#### Structure
+
+Refer to [divio documentation](https://documentation.divio.com/) for guidance on where and how to structure our high-level documentation.
+
+ and
+ sections are both _explanation_ oriented,
+ covers both _tutorials_ and _How to_, and
+the section covers _reference_ material.
+
+#### Location
+
+If the information spans multiple plugins, consider adding it to the [dev_docs](https://github.com/elastic/kibana/tree/master/dev_docs) folder. If it is plugin specific, consider adding it inside the plugin folder. Write it in an mdx file if you would like it to show up in our new (beta) documentation system.
+
+
+
+To add docs into the new docs system, create an `.mdx` file that
+contains . Read about the syntax . An extra step is needed to add a menu item. will walk you through how to set the docs system
+up locally and edit the nav menu.
+
+
+
+#### Keep content fresh
+
+A fresh pair of eyes are invaluable. Recruit new hires to read, review and update documentation. Leads should also periodically review documentation to ensure it stays up to date. File issues any time you notice documentation is outdated.
+
+#### Consider your target audience
+
+Documentation in the Kibana Developer Guide is targeted towards developers building Kibana plugins. Keep implementation details about internal plugin code out of these docs.
+
+#### High to low level
+
+When a developer first lands in our docs, think about their journey. Introduce basic concepts before diving into details. The left navigation should be set up so documents on top are higher level than documents near the bottom.
+
+#### Think outside-in
+
+It's easy to forget what it felt like to first write code in Kibana, but do your best to frame these docs "outside-in". Don't use esoteric, internal language unless a definition is documented and linked. The fresh eyes of a new hire can be a great asset.
+
+### API documentation
+
+We automatically generate . The following guidelines will help ensure your are useful.
+
+#### Code comments
+
+Every publicly exposed function, class, interface, type, parameter and property should have a comment using JSDoc style comments.
+
+- Use `@param` tags for every function parameter.
+- Use `@returns` tags for return types.
+- Use `@throws` when appropriate.
+- Use `@beta` or `@deprecated` when appropriate.
+- Use `@internal` to indicate this API item is intended for internal use only, which will also remove it from the docs.
+
+#### Interfaces vs inlined types
+
+Prefer types and interfaces over complex inline objects. For example, prefer:
+
+```ts
+/**
+* The SearchSpec interface contains settings for creating a new SearchService, like
+* username and password.
+*/
+export interface SearchSpec {
+ /**
+ * Stores the username. Duh,
+ */
+ username: string;
+ /**
+ * Stores the password. I hope it's encrypted!
+ */
+ password: string;
+}
+
+ /**
+ * Retrieve search services
+ * @param searchSpec Configuration information for initializing the search service.
+ * @returns the id of the search service
+ */
+export getSearchService: (searchSpec: SearchSpec) => string;
+```
+
+over:
+
+```ts
+/**
+ * Retrieve search services
+ * @param searchSpec Configuration information for initializing the search service.
+ * @returns the id of the search service
+ */
+export getSearchService: (searchSpec: { username: string; password: string }) => string;
+```
+
+In the former, there will be a link to the `SearchSpec` interface with documentation for the `username` and `password` properties. In the latter the object will render inline, without comments:
+
+![prefer interfaces documentation](./assets/dev_docs_nested_object.png)
+
+#### Export every type used in a public API
+
+When a publicly exported API items references a private type, this results in a broken link in our docs system. The private type is, by proxy, part of your public API, and as such, should be exported.
+
+Do:
+
+```ts
+export interface AnInterface { bar: string };
+export type foo: string | AnInterface;
+```
+
+Don't:
+
+```ts
+interface AnInterface { bar: string };
+export type foo: string | AnInterface;
+```
+
+#### Avoid “Pick”
+
+`Pick` not only ends up being unhelpful in our documentation system, but it's also of limited help in your IDE. For that reason, avoid `Pick` and other similarly complex types on your public API items. Using these semantics internally is fine.
+
+![pick api documentation](./assets/api_doc_pick.png)
+
+### Example plugins
+
+Running Kibana with `yarn start --run-examples` will include all [example plugins](https://github.com/elastic/kibana/tree/master/examples). These are tested examples of platform services in use. We strongly encourage anyone providing a platform level service or to include a tutorial that links to a tested example plugin. This is better than relying on copied code snippets, which can quickly get out of date.
+
## Performance
Build with scalability in mind.
diff --git a/docs/api/actions-and-connectors.asciidoc b/docs/api/actions-and-connectors.asciidoc
index 5480cdd57f691..ff4cb8401091e 100644
--- a/docs/api/actions-and-connectors.asciidoc
+++ b/docs/api/actions-and-connectors.asciidoc
@@ -5,19 +5,19 @@ Manage Actions and Connectors.
The following connector APIs are available:
-* <> to retrieve a single connector by ID
+* <> to retrieve a single connector by ID
-* <> to retrieve all connectors
+* <> to retrieve all connectors
-* <> to retrieve a list of all connector types
+* <> to retrieve a list of all connector types
-* <> to create connectors
+* <> to create connectors
-* <> to update the attributes for an existing connector
+* <> to update the attributes for an existing connector
-* <> to execute a connector by ID
+* <> to execute a connector by ID
-* <> to delete a connector by ID
+* <> to delete a connector by ID
For deprecated APIs, refer to <>.
diff --git a/docs/api/actions-and-connectors/create.asciidoc b/docs/api/actions-and-connectors/create.asciidoc
index c9a09e890ea6d..554e84615d568 100644
--- a/docs/api/actions-and-connectors/create.asciidoc
+++ b/docs/api/actions-and-connectors/create.asciidoc
@@ -1,25 +1,25 @@
-[[actions-and-connectors-api-create]]
+[[create-connector-api]]
=== Create connector API
++++
-Create connector API
+Create connector
++++
Creates a connector.
-[[actions-and-connectors-api-create-request]]
+[[create-connector-api-request]]
==== Request
`POST :/api/actions/connector`
`POST :/s//api/actions/connector`
-[[actions-and-connectors-api-create-path-params]]
+[[create-connector-api-path-params]]
==== Path parameters
`space_id`::
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
-[[actions-and-connectors-api-create-request-body]]
+[[create-connector-api-request-body]]
==== Request body
`name`::
@@ -36,15 +36,15 @@ Creates a connector.
(Required, object) The secrets configuration for the connector. Secrets configuration properties vary
depending on the connector type. For information about the secrets configuration properties, refer to <>.
+
-WARNING: Remember these values. You must provide them each time you call the <> API.
+WARNING: Remember these values. You must provide them each time you call the <> API.
-[[actions-and-connectors-api-create-request-codes]]
+[[create-connector-api-request-codes]]
==== Response code
`200`::
Indicates a successful call.
-[[actions-and-connectors-api-create-example]]
+[[create-connector-api-example]]
==== Example
[source,sh]
diff --git a/docs/api/actions-and-connectors/delete.asciidoc b/docs/api/actions-and-connectors/delete.asciidoc
index a9f9e658613e0..021a3f7cdf3f7 100644
--- a/docs/api/actions-and-connectors/delete.asciidoc
+++ b/docs/api/actions-and-connectors/delete.asciidoc
@@ -1,21 +1,21 @@
-[[actions-and-connectors-api-delete]]
+[[delete-connector-api]]
=== Delete connector API
++++
-Delete connector API
+Delete connector
++++
Deletes an connector by ID.
WARNING: When you delete a connector, _it cannot be recovered_.
-[[actions-and-connectors-api-delete-request]]
+[[delete-connector-api-request]]
==== Request
`DELETE :/api/actions/connector/`
`DELETE :/s//api/actions/connector/`
-[[actions-and-connectors-api-delete-path-params]]
+[[delete-connector-api-path-params]]
==== Path parameters
`id`::
@@ -24,7 +24,7 @@ WARNING: When you delete a connector, _it cannot be recovered_.
`space_id`::
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
-[[actions-and-connectors-api-delete-response-codes]]
+[[delete-connector-api-response-codes]]
==== Response code
`200`::
diff --git a/docs/api/actions-and-connectors/execute.asciidoc b/docs/api/actions-and-connectors/execute.asciidoc
index b87380907f7bb..e830c9b4bbf88 100644
--- a/docs/api/actions-and-connectors/execute.asciidoc
+++ b/docs/api/actions-and-connectors/execute.asciidoc
@@ -1,19 +1,19 @@
-[[actions-and-connectors-api-execute]]
+[[execute-connector-api]]
=== Execute connector API
++++
-Execute connector API
+Execute connector
++++
Executes a connector by ID.
-[[actions-and-connectors-api-execute-request]]
+[[execute-connector-api-request]]
==== Request
`POST :/api/actions/connector//_execute`
`POST :/s//api/actions/connector//_execute`
-[[actions-and-connectors-api-execute-params]]
+[[execute-connector-api-params]]
==== Path parameters
`id`::
@@ -22,20 +22,20 @@ Executes a connector by ID.
`space_id`::
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
-[[actions-and-connectors-api-execute-request-body]]
+[[execute-connector-api-request-body]]
==== Request body
`params`::
(Required, object) The parameters of the connector. Parameter properties vary depending on
the connector type. For information about the parameter properties, refer to <>.
-[[actions-and-connectors-api-execute-codes]]
+[[execute-connector-api-codes]]
==== Response code
`200`::
Indicates a successful call.
-[[actions-and-connectors-api-execute-example]]
+[[execute-connector-api-example]]
==== Example
[source,sh]
diff --git a/docs/api/actions-and-connectors/get.asciidoc b/docs/api/actions-and-connectors/get.asciidoc
index 33d37a4add4dd..0d9af45c4ef0c 100644
--- a/docs/api/actions-and-connectors/get.asciidoc
+++ b/docs/api/actions-and-connectors/get.asciidoc
@@ -1,19 +1,19 @@
-[[actions-and-connectors-api-get]]
+[[get-connector-api]]
=== Get connector API
++++
-Get connector API
+Get connector
++++
Retrieves a connector by ID.
-[[actions-and-connectors-api-get-request]]
+[[get-connector-api-request]]
==== Request
`GET :/api/actions/connector/`
`GET :/s//api/actions/connector/`
-[[actions-and-connectors-api-get-params]]
+[[get-connector-api-params]]
==== Path parameters
`id`::
@@ -22,13 +22,13 @@ Retrieves a connector by ID.
`space_id`::
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
-[[actions-and-connectors-api-get-codes]]
+[[get-connector-api-codes]]
==== Response code
`200`::
Indicates a successful call.
-[[actions-and-connectors-api-get-example]]
+[[get-connector-api-example]]
==== Example
[source,sh]
diff --git a/docs/api/actions-and-connectors/get_all.asciidoc b/docs/api/actions-and-connectors/get_all.asciidoc
index 8b4977d61e741..e4e67a9bbde73 100644
--- a/docs/api/actions-and-connectors/get_all.asciidoc
+++ b/docs/api/actions-and-connectors/get_all.asciidoc
@@ -1,31 +1,31 @@
-[[actions-and-connectors-api-get-all]]
-=== Get all actions API
+[[get-all-connectors-api]]
+=== Get all connectors API
++++
-Get all actions API
+Get all connectors
++++
Retrieves all connectors.
-[[actions-and-connectors-api-get-all-request]]
+[[get-all-connectors-api-request]]
==== Request
`GET :/api/actions/connectors`
`GET :/s//api/actions/connectors`
-[[actions-and-connectors-api-get-all-path-params]]
+[[get-all-connectors-api-path-params]]
==== Path parameters
`space_id`::
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
-[[actions-and-connectors-api-get-all-codes]]
+[[get-all-connectors-api-codes]]
==== Response code
`200`::
Indicates a successful call.
-[[actions-and-connectors-api-get-all-example]]
+[[get-all-connectors-api-example]]
==== Example
[source,sh]
diff --git a/docs/api/actions-and-connectors/legacy/create.asciidoc b/docs/api/actions-and-connectors/legacy/create.asciidoc
index faf6227f01947..af4feddcb80fb 100644
--- a/docs/api/actions-and-connectors/legacy/create.asciidoc
+++ b/docs/api/actions-and-connectors/legacy/create.asciidoc
@@ -1,12 +1,10 @@
[[actions-and-connectors-legacy-api-create]]
==== Legacy Create connector API
++++
-Legacy Create connector API
+Legacy Create connector
++++
-deprecated::[7.13.0]
-
-Please use the <> instead.
+WARNING: Deprecated in 7.13.0. Use <> instead.
Creates a connector.
diff --git a/docs/api/actions-and-connectors/legacy/delete.asciidoc b/docs/api/actions-and-connectors/legacy/delete.asciidoc
index b02f1011fd9b4..170fceba2d157 100644
--- a/docs/api/actions-and-connectors/legacy/delete.asciidoc
+++ b/docs/api/actions-and-connectors/legacy/delete.asciidoc
@@ -1,12 +1,10 @@
[[actions-and-connectors-legacy-api-delete]]
==== Legacy Delete connector API
++++
-Legacy Delete connector API
+Legacy Delete connector
++++
-deprecated::[7.13.0]
-
-Please use the <> instead.
+WARNING: Deprecated in 7.13.0. Use <> instead.
Deletes a connector by ID.
diff --git a/docs/api/actions-and-connectors/legacy/execute.asciidoc b/docs/api/actions-and-connectors/legacy/execute.asciidoc
index 30cb18c54aa69..200844ab72f17 100644
--- a/docs/api/actions-and-connectors/legacy/execute.asciidoc
+++ b/docs/api/actions-and-connectors/legacy/execute.asciidoc
@@ -1,12 +1,10 @@
[[actions-and-connectors-legacy-api-execute]]
==== Legacy Execute connector API
++++
-Legacy Execute connector API
+Legacy Execute connector
++++
-deprecated::[7.13.0]
-
-Please use the <> instead.
+WARNING: Deprecated in 7.13.0. Use <> instead.
Executes a connector by ID.
diff --git a/docs/api/actions-and-connectors/legacy/get.asciidoc b/docs/api/actions-and-connectors/legacy/get.asciidoc
index cf8cc1b6b677e..1b138fb7032e0 100644
--- a/docs/api/actions-and-connectors/legacy/get.asciidoc
+++ b/docs/api/actions-and-connectors/legacy/get.asciidoc
@@ -1,12 +1,10 @@
[[actions-and-connectors-legacy-api-get]]
==== Legacy Get connector API
++++
-Legacy Get connector API
+Legacy Get connector
++++
-deprecated::[7.13.0]
-
-Please use the <> instead.
+WARNING: Deprecated in 7.13.0. Use <> instead.
Retrieves a connector by ID.
diff --git a/docs/api/actions-and-connectors/legacy/get_all.asciidoc b/docs/api/actions-and-connectors/legacy/get_all.asciidoc
index 24ad446d95d95..ba235955c005e 100644
--- a/docs/api/actions-and-connectors/legacy/get_all.asciidoc
+++ b/docs/api/actions-and-connectors/legacy/get_all.asciidoc
@@ -1,12 +1,10 @@
[[actions-and-connectors-legacy-api-get-all]]
==== Legacy Get all connector API
++++
-Legacy Get all connector API
+Legacy Get all connector
++++
-deprecated::[7.13.0]
-
-Please use the <> instead.
+WARNING: Deprecated in 7.13.0. Use <> instead.
Retrieves all connectors.
diff --git a/docs/api/actions-and-connectors/legacy/list.asciidoc b/docs/api/actions-and-connectors/legacy/list.asciidoc
index 86026f332d917..8acfd5415af57 100644
--- a/docs/api/actions-and-connectors/legacy/list.asciidoc
+++ b/docs/api/actions-and-connectors/legacy/list.asciidoc
@@ -1,12 +1,10 @@
[[actions-and-connectors-legacy-api-list]]
==== Legacy List connector types API
++++
-Legacy List all connector types API
+Legacy List all connector types
++++
-deprecated::[7.13.0]
-
-Please use the <> instead.
+WARNING: Deprecated in 7.13.0. Use <> instead.
Retrieves a list of all connector types.
diff --git a/docs/api/actions-and-connectors/legacy/update.asciidoc b/docs/api/actions-and-connectors/legacy/update.asciidoc
index c2e841988717a..517daf9a40dca 100644
--- a/docs/api/actions-and-connectors/legacy/update.asciidoc
+++ b/docs/api/actions-and-connectors/legacy/update.asciidoc
@@ -1,12 +1,10 @@
[[actions-and-connectors-legacy-api-update]]
==== Legacy Update connector API
++++
-Legacy Update connector API
+Legacy Update connector
++++
-deprecated::[7.13.0]
-
-Please use the <> instead.
+WARNING: Deprecated in 7.13.0. Use <> instead.
Updates the attributes for an existing connector.
diff --git a/docs/api/actions-and-connectors/list.asciidoc b/docs/api/actions-and-connectors/list.asciidoc
index 941f7b4376e91..bd1ccb777b9ae 100644
--- a/docs/api/actions-and-connectors/list.asciidoc
+++ b/docs/api/actions-and-connectors/list.asciidoc
@@ -1,31 +1,31 @@
-[[actions-and-connectors-api-list]]
+[[list-connector-types-api]]
=== List connector types API
++++
-List all connector types API
+List all connector types
++++
Retrieves a list of all connector types.
-[[actions-and-connectors-api-list-request]]
+[[list-connector-types-api-request]]
==== Request
`GET :/api/actions/connector_types`
`GET :/s//api/actions/connector_types`
-[[actions-and-connectors-api-list-path-params]]
+[[list-connector-types-api-path-params]]
==== Path parameters
`space_id`::
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
-[[actions-and-connectors-api-list-codes]]
+[[list-connector-types-api-codes]]
==== Response code
`200`::
Indicates a successful call.
-[[actions-and-connectors-api-list-example]]
+[[list-connector-types-api-example]]
==== Example
[source,sh]
diff --git a/docs/api/actions-and-connectors/update.asciidoc b/docs/api/actions-and-connectors/update.asciidoc
index 6c4e6040bdfb5..f522cb8d048e0 100644
--- a/docs/api/actions-and-connectors/update.asciidoc
+++ b/docs/api/actions-and-connectors/update.asciidoc
@@ -1,19 +1,19 @@
-[[actions-and-connectors-api-update]]
+[[update-connector-api]]
=== Update connector API
++++
-Update connector API
+Update connector
++++
Updates the attributes for an existing connector.
-[[actions-and-connectors-api-update-request]]
+[[update-connector-api-request]]
==== Request
`PUT :/api/actions/connector/`
`PUT :/s//api/actions/connector/`
-[[actions-and-connectors-api-update-params]]
+[[update-connector-api-params]]
==== Path parameters
`id`::
@@ -22,7 +22,7 @@ Updates the attributes for an existing connector.
`space_id`::
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
-[[actions-and-connectors-api-update-request-body]]
+[[update-connector-api-request-body]]
==== Request body
`name`::
@@ -34,13 +34,13 @@ Updates the attributes for an existing connector.
`secrets`::
(Required, object) The updated secrets configuration for the connector. Secrets properties vary depending on the connector type. For information about the secrets configuration properties, refer to <>.
-[[actions-and-connectors-api-update-codes]]
+[[update-connector-api-codes]]
==== Response code
`200`::
Indicates a successful call.
-[[actions-and-connectors-api-update-example]]
+[[update-connector-api-example]]
==== Example
[source,sh]
diff --git a/docs/apm/service-overview.asciidoc b/docs/apm/service-overview.asciidoc
index 36d021d64456e..693046d652943 100644
--- a/docs/apm/service-overview.asciidoc
+++ b/docs/apm/service-overview.asciidoc
@@ -38,6 +38,8 @@ image::apm/images/traffic-transactions.png[Traffic and transactions]
=== Error rate and errors
The *Error rate* chart displays the average error rates relating to the service, within a specific time range.
+An HTTP response code greater than 400 does not necessarily indicate a failed transaction.
+<>.
The *Errors* table provides a high-level view of each error message when it first and last occurred,
along with the total number of occurrences. This makes it very easy to quickly see which errors affect
diff --git a/docs/apm/transactions.asciidoc b/docs/apm/transactions.asciidoc
index 8c8da81aa577e..c2a3e0bc2502d 100644
--- a/docs/apm/transactions.asciidoc
+++ b/docs/apm/transactions.asciidoc
@@ -22,11 +22,21 @@ Visualize response codes: `2xx`, `3xx`, `4xx`, etc.
Useful for determining if more responses than usual are being served with a particular response code.
Like in the latency graph, you can zoom in on anomalies to further investigate them.
+[[transaction-error-rate]]
*Error rate*::
-Visualize the total number of transactions with errors divided by the total number of transactions.
-The error rate value is based on the `event.outcome` field and is the relative number of failed transactions.
-Any unexpected increases, decreases, or irregular patterns can be investigated further
-with the <>.
+The error rate represents the percentage of failed transactions from the perspective of the selected service.
+It's useful for visualizing unexpected increases, decreases, or irregular patterns in a service's transactions.
++
+[TIP]
+====
+HTTP **transactions** from the HTTP server perspective do not consider a `4xx` status code (client error) as a failure
+because the failure was caused by the caller, not the HTTP server. Thus, there will be no increase in error rate.
+
+HTTP **spans** from the client perspective however, are considered failures if the HTTP status code is ≥ 400.
+These spans will increase the error rate.
+
+If there is no HTTP status, both transactions and spans are considered successful unless an error is reported.
+====
*Average duration by span type*::
Visualize where your application is spending most of its time.
diff --git a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md
index df5ce62cc07af..6ca7a83ac0a03 100644
--- a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md
+++ b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md
@@ -87,7 +87,9 @@ readonly links: {
readonly sum: string;
readonly top_hits: string;
};
- readonly runtimeFields: string;
+ readonly runtimeFields: {
+ readonly mapping: string;
+ };
readonly scriptedFields: {
readonly scriptFields: string;
readonly scriptAggs: string;
diff --git a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md
index da3ae17171c81..3847ab0c6183a 100644
--- a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md
+++ b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md
@@ -17,5 +17,5 @@ export interface DocLinksStart
| --- | --- | --- |
| [DOC\_LINK\_VERSION](./kibana-plugin-core-public.doclinksstart.doc_link_version.md) | string | |
| [ELASTIC\_WEBSITE\_URL](./kibana-plugin-core-public.doclinksstart.elastic_website_url.md) | string | |
-| [links](./kibana-plugin-core-public.doclinksstart.links.md) | { readonly dashboard: { readonly guide: string; readonly drilldowns: string; readonly drilldownsTriggerPicker: string; readonly urlDrilldownTemplateSyntax: string; readonly urlDrilldownVariables: string; }; readonly discover: Record<string, string>; readonly filebeat: { readonly base: string; readonly installation: string; readonly configuration: string; readonly elasticsearchOutput: string; readonly elasticsearchModule: string; readonly startup: string; readonly exportedFields: string; }; readonly auditbeat: { readonly base: string; }; readonly metricbeat: { readonly base: string; readonly configure: string; readonly httpEndpoint: string; readonly install: string; readonly start: string; }; readonly enterpriseSearch: { readonly base: string; readonly appSearchBase: string; readonly workplaceSearchBase: string; }; readonly heartbeat: { readonly base: string; }; readonly logstash: { readonly base: string; }; readonly functionbeat: { readonly base: string; }; readonly winlogbeat: { readonly base: string; }; readonly aggs: { readonly composite: string; readonly composite_missing_bucket: string; readonly date_histogram: string; readonly date_range: string; readonly date_format_pattern: string; readonly filter: string; readonly filters: string; readonly geohash_grid: string; readonly histogram: string; readonly ip_range: string; readonly range: string; readonly significant_terms: string; readonly terms: string; readonly avg: string; readonly avg_bucket: string; readonly max_bucket: string; readonly min_bucket: string; readonly sum_bucket: string; readonly cardinality: string; readonly count: string; readonly cumulative_sum: string; readonly derivative: string; readonly geo_bounds: string; readonly geo_centroid: string; readonly max: string; readonly median: string; readonly min: string; readonly moving_avg: string; readonly percentile_ranks: string; readonly serial_diff: string; readonly std_dev: string; readonly sum: string; readonly top_hits: string; }; readonly runtimeFields: string; readonly scriptedFields: { readonly scriptFields: string; readonly scriptAggs: string; readonly painless: string; readonly painlessApi: string; readonly painlessLangSpec: string; readonly painlessSyntax: string; readonly painlessWalkthrough: string; readonly luceneExpressions: string; }; readonly indexPatterns: { readonly introduction: string; readonly fieldFormattersNumber: string; readonly fieldFormattersString: string; }; readonly addData: string; readonly kibana: string; readonly elasticsearch: Record<string, string>; readonly siem: { readonly guide: string; readonly gettingStarted: string; }; readonly query: { readonly eql: string; readonly luceneQuerySyntax: string; readonly queryDsl: string; readonly kueryQuerySyntax: string; }; readonly date: { readonly dateMath: string; readonly dateMathIndexNames: string; }; readonly management: Record<string, string>; readonly ml: Record<string, string>; readonly transforms: Record<string, string>; readonly visualize: Record<string, string>; readonly apis: Readonly<{ createIndex: string; createSnapshotLifecyclePolicy: string; createRoleMapping: string; createRoleMappingTemplates: string; createApiKey: string; createPipeline: string; createTransformRequest: string; cronExpressions: string; executeWatchActionModes: string; indexExists: string; openIndex: string; putComponentTemplate: string; painlessExecute: string; painlessExecuteAPIContexts: string; putComponentTemplateMetadata: string; putSnapshotLifecyclePolicy: string; putWatch: string; updateTransform: string; }>; readonly observability: Record<string, string>; readonly alerting: Record<string, string>; readonly maps: Record<string, string>; readonly monitoring: Record<string, string>; readonly security: Readonly<{ apiKeyServiceSettings: string; clusterPrivileges: string; elasticsearchSettings: string; elasticsearchEnableSecurity: string; indicesPrivileges: string; kibanaTLS: string; kibanaPrivileges: string; mappingRoles: string; mappingRolesFieldRules: string; runAsPrivilege: string; }>; readonly watcher: Record<string, string>; readonly ccs: Record<string, string>; readonly plugins: Record<string, string>; readonly snapshotRestore: Record<string, string>; readonly ingest: Record<string, string>; } | |
+| [links](./kibana-plugin-core-public.doclinksstart.links.md) | { readonly dashboard: { readonly guide: string; readonly drilldowns: string; readonly drilldownsTriggerPicker: string; readonly urlDrilldownTemplateSyntax: string; readonly urlDrilldownVariables: string; }; readonly discover: Record<string, string>; readonly filebeat: { readonly base: string; readonly installation: string; readonly configuration: string; readonly elasticsearchOutput: string; readonly elasticsearchModule: string; readonly startup: string; readonly exportedFields: string; }; readonly auditbeat: { readonly base: string; }; readonly metricbeat: { readonly base: string; readonly configure: string; readonly httpEndpoint: string; readonly install: string; readonly start: string; }; readonly enterpriseSearch: { readonly base: string; readonly appSearchBase: string; readonly workplaceSearchBase: string; }; readonly heartbeat: { readonly base: string; }; readonly logstash: { readonly base: string; }; readonly functionbeat: { readonly base: string; }; readonly winlogbeat: { readonly base: string; }; readonly aggs: { readonly composite: string; readonly composite_missing_bucket: string; readonly date_histogram: string; readonly date_range: string; readonly date_format_pattern: string; readonly filter: string; readonly filters: string; readonly geohash_grid: string; readonly histogram: string; readonly ip_range: string; readonly range: string; readonly significant_terms: string; readonly terms: string; readonly avg: string; readonly avg_bucket: string; readonly max_bucket: string; readonly min_bucket: string; readonly sum_bucket: string; readonly cardinality: string; readonly count: string; readonly cumulative_sum: string; readonly derivative: string; readonly geo_bounds: string; readonly geo_centroid: string; readonly max: string; readonly median: string; readonly min: string; readonly moving_avg: string; readonly percentile_ranks: string; readonly serial_diff: string; readonly std_dev: string; readonly sum: string; readonly top_hits: string; }; readonly runtimeFields: { readonly mapping: string; }; readonly scriptedFields: { readonly scriptFields: string; readonly scriptAggs: string; readonly painless: string; readonly painlessApi: string; readonly painlessLangSpec: string; readonly painlessSyntax: string; readonly painlessWalkthrough: string; readonly luceneExpressions: string; }; readonly indexPatterns: { readonly introduction: string; readonly fieldFormattersNumber: string; readonly fieldFormattersString: string; }; readonly addData: string; readonly kibana: string; readonly elasticsearch: Record<string, string>; readonly siem: { readonly guide: string; readonly gettingStarted: string; }; readonly query: { readonly eql: string; readonly luceneQuerySyntax: string; readonly queryDsl: string; readonly kueryQuerySyntax: string; }; readonly date: { readonly dateMath: string; readonly dateMathIndexNames: string; }; readonly management: Record<string, string>; readonly ml: Record<string, string>; readonly transforms: Record<string, string>; readonly visualize: Record<string, string>; readonly apis: Readonly<{ createIndex: string; createSnapshotLifecyclePolicy: string; createRoleMapping: string; createRoleMappingTemplates: string; createApiKey: string; createPipeline: string; createTransformRequest: string; cronExpressions: string; executeWatchActionModes: string; indexExists: string; openIndex: string; putComponentTemplate: string; painlessExecute: string; painlessExecuteAPIContexts: string; putComponentTemplateMetadata: string; putSnapshotLifecyclePolicy: string; putWatch: string; updateTransform: string; }>; readonly observability: Record<string, string>; readonly alerting: Record<string, string>; readonly maps: Record<string, string>; readonly monitoring: Record<string, string>; readonly security: Readonly<{ apiKeyServiceSettings: string; clusterPrivileges: string; elasticsearchSettings: string; elasticsearchEnableSecurity: string; indicesPrivileges: string; kibanaTLS: string; kibanaPrivileges: string; mappingRoles: string; mappingRolesFieldRules: string; runAsPrivilege: string; }>; readonly watcher: Record<string, string>; readonly ccs: Record<string, string>; readonly plugins: Record<string, string>; readonly snapshotRestore: Record<string, string>; readonly ingest: Record<string, string>; } | |
diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsincrementcounteroptions.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsincrementcounteroptions.md
index 68e9bb09456cd..8da2458cf007e 100644
--- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsincrementcounteroptions.md
+++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsincrementcounteroptions.md
@@ -8,7 +8,7 @@
Signature:
```typescript
-export interface SavedObjectsIncrementCounterOptions extends SavedObjectsBaseOptions
+export interface SavedObjectsIncrementCounterOptions extends SavedObjectsBaseOptions
```
## Properties
@@ -18,4 +18,5 @@ export interface SavedObjectsIncrementCounterOptions extends SavedObjectsBaseOpt
| [initialize](./kibana-plugin-core-server.savedobjectsincrementcounteroptions.initialize.md) | boolean | (default=false) If true, sets all the counter fields to 0 if they don't already exist. Existing fields will be left as-is and won't be incremented. |
| [migrationVersion](./kibana-plugin-core-server.savedobjectsincrementcounteroptions.migrationversion.md) | SavedObjectsMigrationVersion | [SavedObjectsMigrationVersion](./kibana-plugin-core-server.savedobjectsmigrationversion.md) |
| [refresh](./kibana-plugin-core-server.savedobjectsincrementcounteroptions.refresh.md) | MutatingOperationRefreshSetting | (default='wait\_for') The Elasticsearch refresh setting for this operation. See [MutatingOperationRefreshSetting](./kibana-plugin-core-server.mutatingoperationrefreshsetting.md) |
+| [upsertAttributes](./kibana-plugin-core-server.savedobjectsincrementcounteroptions.upsertattributes.md) | Attributes | Attributes to use when upserting the document if it doesn't exist. |
diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsincrementcounteroptions.upsertattributes.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsincrementcounteroptions.upsertattributes.md
new file mode 100644
index 0000000000000..d5657dd65771f
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsincrementcounteroptions.upsertattributes.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsIncrementCounterOptions](./kibana-plugin-core-server.savedobjectsincrementcounteroptions.md) > [upsertAttributes](./kibana-plugin-core-server.savedobjectsincrementcounteroptions.upsertattributes.md)
+
+## SavedObjectsIncrementCounterOptions.upsertAttributes property
+
+Attributes to use when upserting the document if it doesn't exist.
+
+Signature:
+
+```typescript
+upsertAttributes?: Attributes;
+```
diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.incrementcounter.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.incrementcounter.md
index eb18e064c84e2..59d98bf4d607b 100644
--- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.incrementcounter.md
+++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.incrementcounter.md
@@ -9,7 +9,7 @@ Increments all the specified counter fields (by one by default). Creates the doc
Signature:
```typescript
-incrementCounter(type: string, id: string, counterFields: Array, options?: SavedObjectsIncrementCounterOptions): Promise>;
+incrementCounter(type: string, id: string, counterFields: Array, options?: SavedObjectsIncrementCounterOptions): Promise>;
```
## Parameters
@@ -19,7 +19,7 @@ incrementCounter(type: string, id: string, counterFields: Arraystring | The type of saved object whose fields should be incremented |
| id | string | The id of the document whose fields should be incremented |
| counterFields | Array<string | SavedObjectsIncrementCounterField> | An array of field names to increment or an array of [SavedObjectsIncrementCounterField](./kibana-plugin-core-server.savedobjectsincrementcounterfield.md) |
-| options | SavedObjectsIncrementCounterOptions | [SavedObjectsIncrementCounterOptions](./kibana-plugin-core-server.savedobjectsincrementcounteroptions.md) |
+| options | SavedObjectsIncrementCounterOptions<T> | [SavedObjectsIncrementCounterOptions](./kibana-plugin-core-server.savedobjectsincrementcounteroptions.md) |
Returns:
@@ -52,5 +52,19 @@ repository
'stats.apiCalls',
])
+// Increment the apiCalls field counter by 4
+repository
+ .incrementCounter('dashboard_counter_type', 'counter_id', [
+ { fieldName: 'stats.apiCalls' incrementBy: 4 },
+ ])
+
+// Initialize the document with arbitrary fields if not present
+repository.incrementCounter<{ appId: string }>(
+ 'dashboard_counter_type',
+ 'counter_id',
+ [ 'stats.apiCalls'],
+ { upsertAttributes: { appId: 'myId' } }
+)
+
```
diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.fetch_.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.fetch_.md
index bcf220a9a27e6..d5641107a88aa 100644
--- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.fetch_.md
+++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.fetch_.md
@@ -9,7 +9,7 @@ Fetch this source from Elasticsearch, returning an observable over the response(
Signature:
```typescript
-fetch$(options?: ISearchOptions): import("rxjs").Observable>;
+fetch$(options?: ISearchOptions): import("rxjs").Observable>;
```
## Parameters
@@ -20,5 +20,5 @@ fetch$(options?: ISearchOptions): import("rxjs").ObservableReturns:
-`import("rxjs").Observable>`
+`import("rxjs").Observable>`
diff --git a/docs/maps/images/gs_add_cloropeth_layer.png b/docs/maps/images/gs_add_cloropeth_layer.png
index 1528f404026f2..42e00ccc5dd24 100644
Binary files a/docs/maps/images/gs_add_cloropeth_layer.png and b/docs/maps/images/gs_add_cloropeth_layer.png differ
diff --git a/docs/maps/images/gs_add_es_document_layer.png b/docs/maps/images/gs_add_es_document_layer.png
index f4ffbc581745d..d7616c4b11fe0 100644
Binary files a/docs/maps/images/gs_add_es_document_layer.png and b/docs/maps/images/gs_add_es_document_layer.png differ
diff --git a/docs/maps/images/sample_data_web_logs.png b/docs/maps/images/sample_data_web_logs.png
index 3b0c2ba3f12c0..f4f4de88f1992 100644
Binary files a/docs/maps/images/sample_data_web_logs.png and b/docs/maps/images/sample_data_web_logs.png differ
diff --git a/docs/maps/maps-getting-started.asciidoc b/docs/maps/maps-getting-started.asciidoc
index c62aafac00d3f..39ea4daf2ba33 100644
--- a/docs/maps/maps-getting-started.asciidoc
+++ b/docs/maps/maps-getting-started.asciidoc
@@ -67,8 +67,9 @@ and lighter shades will symbolize countries with less traffic.
. In **Layer style**, set:
-** **Fill color** to the grey color ramp
+** **Fill color: As number** to the grey color ramp
** **Border color** to white
+** **Label** to symbol label
. Click **Save & close**.
+
@@ -102,7 +103,7 @@ The layer is only visible when users zoom in.
. In **Layer settings**, set:
** **Name** to `Actual Requests`
-** **Visibilty** to the range [9, 24]
+** **Visibility** to the range [9, 24]
** **Opacity** to 100%
. Add a tooltip field and select **agent**, **bytes**, **clientip**, **host**,
@@ -134,9 +135,9 @@ grids with less bytes transferred.
** **Name** to `Total Requests and Bytes`
** **Visibility** to the range [0, 9]
** **Opacity** to 100%
-. Add a metric with:
-** **Aggregation** set to **Sum**
-** **Field** set to **bytes**
+. In **Metrics**, use:
+** **Agregation** set to **Count**, and
+** **Aggregation** set to **Sum** with **Field** set to **bytes**
. In **Layer style**, change **Symbol size**:
** Set the field select to *sum bytes*.
** Set the min size to 7 and the max size to 25 px.
diff --git a/docs/settings/monitoring-settings.asciidoc b/docs/settings/monitoring-settings.asciidoc
index f48dbeab9d61a..6483442248cea 100644
--- a/docs/settings/monitoring-settings.asciidoc
+++ b/docs/settings/monitoring-settings.asciidoc
@@ -37,11 +37,6 @@ For more information, see
monitoring back-end does not run and {kib} stats are not sent to the monitoring
cluster.
-a|`monitoring.cluster_alerts.`
-`email_notifications.email_address` {ess-icon}
- | Specifies the email address where you want to receive cluster alerts.
- See <> for details.
-
| `monitoring.ui.elasticsearch.hosts`
| Specifies the location of the {es} cluster where your monitoring data is stored.
By default, this is the same as <>. This setting enables
diff --git a/docs/user/dashboard/images/lens_advanced_1_1_2.png b/docs/user/dashboard/images/lens_advanced_1_1_2.png
index 8b5fe130ce7b7..0247ecf695057 100644
Binary files a/docs/user/dashboard/images/lens_advanced_1_1_2.png and b/docs/user/dashboard/images/lens_advanced_1_1_2.png differ
diff --git a/docs/user/dashboard/images/lens_advanced_2_2_1.png b/docs/user/dashboard/images/lens_advanced_2_2_1.png
index 3124dd1de0654..3044f1070367d 100644
Binary files a/docs/user/dashboard/images/lens_advanced_2_2_1.png and b/docs/user/dashboard/images/lens_advanced_2_2_1.png differ
diff --git a/docs/user/dashboard/images/lens_advanced_3_1_1.png b/docs/user/dashboard/images/lens_advanced_3_1_1.png
index 4d52a23cc2cff..c3fb697666b46 100644
Binary files a/docs/user/dashboard/images/lens_advanced_3_1_1.png and b/docs/user/dashboard/images/lens_advanced_3_1_1.png differ
diff --git a/docs/user/monitoring/cluster-alerts.asciidoc b/docs/user/monitoring/cluster-alerts.asciidoc
deleted file mode 100644
index 2945ebc67710c..0000000000000
--- a/docs/user/monitoring/cluster-alerts.asciidoc
+++ /dev/null
@@ -1,64 +0,0 @@
-[role="xpack"]
-[[cluster-alerts]]
-= Cluster Alerts
-
-The *Stack Monitoring > Clusters* page in {kib} summarizes the status of your
-{stack}. You can drill down into the metrics to view more information about your
-cluster and specific nodes, instances, and indices.
-
-The Top Cluster Alerts shown on the Clusters page notify you of
-conditions that require your attention:
-
-* {es} Cluster Health Status is Yellow (missing at least one replica)
-or Red (missing at least one primary).
-* {es} Version Mismatch. You have {es} nodes with
-different versions in the same cluster.
-* {kib} Version Mismatch. You have {kib} instances with different
-versions running against the same {es} cluster.
-* Logstash Version Mismatch. You have Logstash nodes with different
-versions reporting stats to the same monitoring cluster.
-* {es} Nodes Changed. You have {es} nodes that were recently added or removed.
-* {es} License Expiration. The cluster's license is about to expire.
-+
---
-If you do not preserve the data directory when upgrading a {kib} or
-Logstash node, the instance is assigned a new persistent UUID and shows up
-as a new instance
---
-* {xpack} License Expiration. When the {xpack} license expiration date
-approaches, you will get notifications with a severity level relative to how
-soon the expiration date is:
- ** 60 days: Informational alert
- ** 30 days: Low-level alert
- ** 15 days: Medium-level alert
- ** 7 days: Severe-level alert
-+
-The 60-day and 30-day thresholds are skipped for Trial licenses, which are only
-valid for 30 days.
-
-The {monitor-features} check the cluster alert conditions every minute. Cluster
-alerts are automatically dismissed when the condition is resolved.
-
-NOTE: {watcher} must be enabled to view cluster alerts. If you have a Basic
-license, Top Cluster Alerts are not displayed.
-
-[float]
-[[cluster-alert-email-notifications]]
-== Email Notifications
-To receive email notifications for the Cluster Alerts:
-
-. Configure an email account as described in
-{ref}/actions-email.html#configuring-email[Configuring email accounts].
-. Configure the
-`monitoring.cluster_alerts.email_notifications.email_address` setting in
-`kibana.yml` with your email address.
-+
---
-TIP: If you have separate production and monitoring clusters and separate {kib}
-instances for those clusters, you must put the
-`monitoring.cluster_alerts.email_notifications.email_address` setting in
-the {kib} instance that is associated with the production cluster.
-
---
-
-Email notifications are sent only when Cluster Alerts are triggered and resolved.
diff --git a/docs/user/monitoring/index.asciidoc b/docs/user/monitoring/index.asciidoc
index 514988792d214..e4fd4a8cd085c 100644
--- a/docs/user/monitoring/index.asciidoc
+++ b/docs/user/monitoring/index.asciidoc
@@ -1,6 +1,5 @@
include::xpack-monitoring.asciidoc[]
include::beats-details.asciidoc[leveloffset=+1]
-include::cluster-alerts.asciidoc[leveloffset=+1]
include::elasticsearch-details.asciidoc[leveloffset=+1]
include::kibana-alerts.asciidoc[leveloffset=+1]
include::kibana-details.asciidoc[leveloffset=+1]
diff --git a/docs/user/monitoring/kibana-alerts.asciidoc b/docs/user/monitoring/kibana-alerts.asciidoc
index 300497126c3e5..04f4e986ca289 100644
--- a/docs/user/monitoring/kibana-alerts.asciidoc
+++ b/docs/user/monitoring/kibana-alerts.asciidoc
@@ -29,7 +29,7 @@ To review and modify all the available alerts, use
This alert is triggered when a node runs a consistently high CPU load. By
default, the trigger condition is set at 85% or more averaged over the last 5
minutes. The alert is grouped across all the nodes of the cluster by running
-checks on a schedule time of 1 minute with a re-notify internal of 1 day.
+checks on a schedule time of 1 minute with a re-notify interval of 1 day.
[discrete]
[[kibana-alerts-disk-usage-threshold]]
@@ -38,7 +38,7 @@ checks on a schedule time of 1 minute with a re-notify internal of 1 day.
This alert is triggered when a node is nearly at disk capacity. By
default, the trigger condition is set at 80% or more averaged over the last 5
minutes. The alert is grouped across all the nodes of the cluster by running
-checks on a schedule time of 1 minute with a re-notify internal of 1 day.
+checks on a schedule time of 1 minute with a re-notify interval of 1 day.
[discrete]
[[kibana-alerts-jvm-memory-threshold]]
@@ -47,7 +47,7 @@ checks on a schedule time of 1 minute with a re-notify internal of 1 day.
This alert is triggered when a node runs a consistently high JVM memory usage. By
default, the trigger condition is set at 85% or more averaged over the last 5
minutes. The alert is grouped across all the nodes of the cluster by running
-checks on a schedule time of 1 minute with a re-notify internal of 1 day.
+checks on a schedule time of 1 minute with a re-notify interval of 1 day.
[discrete]
[[kibana-alerts-missing-monitoring-data]]
@@ -56,7 +56,72 @@ checks on a schedule time of 1 minute with a re-notify internal of 1 day.
This alert is triggered when any stack products nodes or instances stop sending
monitoring data. By default, the trigger condition is set to missing for 15 minutes
looking back 1 day. The alert is grouped across all the nodes of the cluster by running
-checks on a schedule time of 1 minute with a re-notify internal of 6 hours.
+checks on a schedule time of 1 minute with a re-notify interval of 6 hours.
+
+[discrete]
+[[kibana-alerts-thread-pool-rejections]]
+== Thread pool rejections (search/write)
+
+This alert is triggered when a node experiences thread pool rejections. By
+default, the trigger condition is set at 300 or more over the last 5
+minutes. The alert is grouped across all the nodes of the cluster by running
+checks on a schedule time of 1 minute with a re-notify interval of 1 day.
+Thresholds can be set independently for `search` and `write` type rejections.
+
+[discrete]
+[[kibana-alerts-ccr-read-exceptions]]
+== CCR read exceptions
+
+This alert is triggered if a read exception has been detected on any of the
+replicated clusters. The trigger condition is met if 1 or more read exceptions
+are detected in the last hour. The alert is grouped across all replicated clusters
+by running checks on a schedule time of 1 minute with a re-notify interval of 6 hours.
+
+[discrete]
+[[kibana-alerts-large-shard-size]]
+== Large shard size
+
+This alert is triggered if a large (primary) shard size is found on any of the
+specified index patterns. The trigger condition is met if an index's shard size is
+55gb or higher in the last 5 minutes. The alert is grouped across all indices that match
+the default patter of `*` by running checks on a schedule time of 1 minute with a re-notify
+interval of 12 hours.
+
+[discrete]
+[[kibana-alerts-cluster-alerts]]
+== Cluster alerts
+
+These alerts summarize the current status of your {stack}. You can drill down into the metrics
+to view more information about your cluster and specific nodes, instances, and indices.
+
+An alert will be triggered if any of the following conditions are met within the last minute:
+
+* {es} cluster health status is yellow (missing at least one replica)
+or red (missing at least one primary).
+* {es} version mismatch. You have {es} nodes with
+different versions in the same cluster.
+* {kib} version mismatch. You have {kib} instances with different
+versions running against the same {es} cluster.
+* Logstash version mismatch. You have Logstash nodes with different
+versions reporting stats to the same monitoring cluster.
+* {es} nodes changed. You have {es} nodes that were recently added or removed.
+* {es} license expiration. The cluster's license is about to expire.
++
+--
+If you do not preserve the data directory when upgrading a {kib} or
+Logstash node, the instance is assigned a new persistent UUID and shows up
+as a new instance
+--
+* Subscription license expiration. When the expiration date
+approaches, you will get notifications with a severity level relative to how
+soon the expiration date is:
+ ** 60 days: Informational alert
+ ** 30 days: Low-level alert
+ ** 15 days: Medium-level alert
+ ** 7 days: Severe-level alert
++
+The 60-day and 30-day thresholds are skipped for Trial licenses, which are only
+valid for 30 days.
NOTE: Some action types are subscription features, while others are free.
For a comparison of the Elastic subscription levels, see the alerting section of
diff --git a/docs/user/production-considerations/task-manager-troubleshooting.asciidoc b/docs/user/production-considerations/task-manager-troubleshooting.asciidoc
index c96b294c0c50d..5e75aef0d9570 100644
--- a/docs/user/production-considerations/task-manager-troubleshooting.asciidoc
+++ b/docs/user/production-considerations/task-manager-troubleshooting.asciidoc
@@ -706,3 +706,21 @@ These rough calculations give you a lower bound to the required throughput, whic
Given these inferred attributes, it would be safe to assume that a single {kib} instance with default settings **would not** provide the required throughput. It is possible that scaling horizontally by adding a couple more {kib} instances will.
For details on scaling Task Manager, see <>.
+
+[float]
+[[task-manager-cannot-operate-when-inline-scripts-are-disabled]]
+==== Inline scripts are disabled in {es}
+
+*Problem*:
+
+Tasks are not running, and the server logs contain the following error message:
+
+[source, txt]
+--------------------------------------------------
+[warning][plugins][taskManager] Task Manager cannot operate when inline scripts are disabled in {es}
+--------------------------------------------------
+
+*Solution*:
+
+Inline scripts are a hard requirement for Task Manager to function.
+To enable inline scripting, see the Elasticsearch documentation for {ref}/modules-scripting-security.html#allowed-script-types-setting[configuring allowed script types setting].
diff --git a/package.json b/package.json
index 66a6ef1d4558b..99591fdc1ea40 100644
--- a/package.json
+++ b/package.json
@@ -95,18 +95,23 @@
"yarn": "^1.21.1"
},
"dependencies": {
+ "@elastic/apm-rum": "^5.6.1",
+ "@elastic/apm-rum-react": "^1.2.5",
+ "@elastic/charts": "26.0.0",
"@elastic/datemath": "link:packages/elastic-datemath",
"@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.4",
"@elastic/ems-client": "7.12.0",
- "@elastic/eui": "31.7.0",
+ "@elastic/eui": "31.10.0",
"@elastic/filesaver": "1.1.2",
"@elastic/good": "^9.0.1-kibana3",
+ "@elastic/maki": "6.3.0",
"@elastic/node-crypto": "1.2.1",
"@elastic/numeral": "^2.5.0",
"@elastic/react-search-ui": "^1.5.1",
"@elastic/request-crypto": "1.1.4",
"@elastic/safer-lodash-set": "link:packages/elastic-safer-lodash-set",
"@elastic/search-ui-app-search-connector": "^1.5.0",
+ "@elastic/ui-ace": "0.2.3",
"@hapi/boom": "^9.1.1",
"@hapi/cookie": "^11.0.2",
"@hapi/good-squeeze": "6.0.0",
@@ -131,9 +136,15 @@
"@kbn/tinymath": "link:packages/kbn-tinymath",
"@kbn/ui-framework": "link:packages/kbn-ui-framework",
"@kbn/ui-shared-deps": "link:packages/kbn-ui-shared-deps",
+ "@kbn/utility-types": "link:packages/kbn-utility-types",
"@kbn/utils": "link:packages/kbn-utils",
"@loaders.gl/core": "^2.3.1",
"@loaders.gl/json": "^2.3.1",
+ "@mapbox/geojson-rewind": "^0.5.0",
+ "@mapbox/mapbox-gl-draw": "^1.2.0",
+ "@mapbox/mapbox-gl-rtl-text": "^0.2.3",
+ "@mapbox/vector-tile": "1.3.1",
+ "@scant/router": "^0.1.1",
"@slack/webhook": "^5.0.4",
"@turf/along": "6.0.1",
"@turf/area": "6.0.1",
@@ -151,41 +162,60 @@
"accept": "3.0.2",
"ajv": "^6.12.4",
"angular": "^1.8.0",
+ "angular-aria": "^1.8.0",
"angular-elastic": "^2.5.1",
+ "angular-recursion": "^1.0.5",
"angular-resource": "1.8.0",
+ "angular-route": "^1.8.0",
"angular-sanitize": "^1.8.0",
+ "angular-sortable-view": "^0.0.17",
"angular-ui-ace": "0.2.3",
"antlr4ts": "^0.5.0-alpha.3",
"apollo-cache-inmemory": "1.6.2",
"apollo-client": "^2.3.8",
+ "apollo-link": "^1.2.3",
+ "apollo-link-error": "^1.1.7",
"apollo-link-http": "^1.5.16",
"apollo-link-http-common": "^0.2.15",
"apollo-link-schema": "^1.1.0",
+ "apollo-link-state": "^0.4.1",
"apollo-server-core": "^1.3.6",
"apollo-server-errors": "^2.0.2",
"apollo-server-hapi": "^1.3.6",
"archiver": "^5.2.0",
"axios": "^0.21.1",
+ "base64-js": "^1.3.1",
"bluebird": "3.5.5",
"brace": "0.11.1",
+ "broadcast-channel": "^3.0.3",
"chalk": "^4.1.0",
"check-disk-space": "^2.1.0",
+ "cheerio": "0.22.0",
"chokidar": "^3.4.3",
"chroma-js": "^1.4.1",
"classnames": "2.2.6",
"color": "1.0.3",
"commander": "^3.0.2",
+ "compare-versions": "3.5.1",
"concat-stream": "1.6.2",
+ "constate": "^1.3.2",
+ "cronstrue": "^1.51.0",
"content-disposition": "0.5.3",
+ "copy-to-clipboard": "^3.0.8",
"core-js": "^3.6.5",
+ "css-minimizer-webpack-plugin": "^1.3.0",
"custom-event-polyfill": "^0.3.0",
"cytoscape": "^3.10.0",
"cytoscape-dagre": "^2.2.2",
+ "d3": "3.5.17",
"d3-array": "1.2.4",
+ "d3-cloud": "1.2.5",
+ "d3-scale": "1.0.7",
"d3-shape": "^1.1.0",
"d3-time": "^1.1.0",
"dedent": "^0.7.0",
"deep-freeze-strict": "^1.1.1",
+ "deepmerge": "^4.2.2",
"del": "^5.1.0",
"elastic-apm-node": "^3.10.0",
"elasticsearch": "^16.7.0",
@@ -194,9 +224,11 @@
"expiry-js": "0.1.7",
"extract-zip": "^2.0.1",
"fast-deep-equal": "^3.1.1",
+ "file-saver": "^1.3.8",
"file-type": "^10.9.0",
"focus-trap-react": "^3.1.1",
"font-awesome": "4.7.0",
+ "formsy-react": "^1.1.5",
"fp-ts": "^2.3.1",
"geojson-vt": "^3.2.1",
"get-port": "^5.0.0",
@@ -212,31 +244,51 @@
"graphql-tag": "^2.10.3",
"graphql-tools": "^3.0.2",
"handlebars": "4.7.7",
+ "he": "^1.2.0",
"history": "^4.9.0",
+ "history-extra": "^5.0.1",
"hjson": "3.2.1",
"http-proxy-agent": "^2.1.0",
"https-proxy-agent": "^5.0.0",
+ "i18n-iso-countries": "^4.3.1",
+ "icalendar": "0.7.1",
"idx": "^2.5.6",
"immer": "^8.0.1",
"inline-style": "^2.0.0",
"intl": "^1.2.5",
"intl-format-cache": "^2.1.0",
"intl-messageformat": "^2.2.0",
+ "intl-messageformat-parser": "^1.4.0",
"intl-relativeformat": "^2.1.0",
"io-ts": "^2.0.5",
"ipaddr.js": "2.0.0",
"isbinaryfile": "4.0.2",
"joi": "^13.5.2",
"jquery": "^3.5.0",
+ "js-levenshtein": "^1.1.6",
+ "js-search": "^1.4.3",
"js-yaml": "^3.14.0",
"json-stable-stringify": "^1.0.1",
+ "json-stringify-pretty-compact": "1.2.0",
"json-stringify-safe": "5.0.1",
"jsonwebtoken": "^8.5.1",
+ "jsts": "^1.6.2",
+ "kea": "^2.3.0",
+ "leaflet": "1.5.1",
+ "leaflet-draw": "0.4.14",
+ "leaflet-responsive-popup": "0.6.4",
+ "leaflet.heat": "0.2.0",
+ "less": "npm:@elastic/less@2.7.3-kibana",
"load-json-file": "^6.2.0",
+ "loader-utils": "^1.2.3",
"lodash": "^4.17.21",
"lru-cache": "^4.1.5",
+ "lz-string": "^1.4.4",
"markdown-it": "^10.0.0",
+ "mapbox-gl": "1.13.1",
+ "mapbox-gl-draw-rectangle-mode": "^1.0.4",
"md5": "^2.1.0",
+ "memoize-one": "^5.0.0",
"mime": "^2.4.4",
"mime-types": "^2.1.27",
"mini-css-extract-plugin": "0.8.0",
@@ -261,38 +313,69 @@
"papaparse": "^5.2.0",
"pdfmake": "^0.1.65",
"pegjs": "0.10.0",
+ "p-limit": "^3.0.1",
+ "pluralize": "3.1.0",
"pngjs": "^3.4.0",
+ "polished": "^1.9.2",
"prop-types": "^15.7.2",
"proper-lockfile": "^3.2.0",
"proxy-from-env": "1.0.0",
+ "proxyquire": "1.8.0",
"puid": "1.0.7",
"puppeteer": "npm:@elastic/puppeteer@5.4.1-patch.1",
"query-string": "^6.13.2",
"raw-loader": "^3.1.0",
+ "rbush": "^3.0.1",
+ "re-resizable": "^6.1.1",
"re2": "^1.15.4",
"react": "^16.12.0",
"react-ace": "^5.9.0",
+ "react-apollo": "^2.1.4",
+ "react-beautiful-dnd": "^13.0.0",
"react-color": "^2.13.8",
"react-datetime": "^2.14.0",
"react-dom": "^16.12.0",
+ "react-dropzone": "^4.2.9",
+ "react-fast-compare": "^2.0.4",
+ "react-grid-layout": "^0.16.2",
"react-input-range": "^1.3.0",
"react-intl": "^2.8.0",
"react-is": "^16.8.0",
+ "react-markdown": "^4.3.1",
"react-moment-proptypes": "^1.7.0",
+ "react-monaco-editor": "^0.41.2",
+ "react-popper-tooltip": "^2.10.1",
"react-query": "^3.12.0",
+ "react-resize-detector": "^4.2.0",
+ "react-reverse-portal": "^1.0.4",
+ "react-router-redux": "^4.0.8",
+ "react-shortcuts": "^2.0.0",
+ "react-sizeme": "^2.3.6",
+ "react-syntax-highlighter": "^15.3.1",
"react-redux": "^7.2.0",
"react-resizable": "^1.7.5",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
+ "react-tiny-virtual-list": "^2.2.0",
+ "react-virtualized": "^9.21.2",
"react-use": "^15.3.8",
+ "react-vis": "^1.8.1",
+ "react-visibility-sensor": "^5.1.1",
+ "reactcss": "1.2.3",
"recompose": "^0.26.0",
+ "reduce-reducers": "^1.0.4",
"redux": "^4.0.5",
"redux-actions": "^2.6.5",
+ "redux-devtools-extension": "^2.13.8",
"redux-observable": "^1.2.0",
+ "redux-saga": "^1.1.3",
"redux-thunk": "^2.3.0",
+ "redux-thunks": "^1.0.0",
"regenerator-runtime": "^0.13.3",
"request": "^2.88.0",
"require-in-the-middle": "^5.0.2",
+ "reselect": "^4.0.0",
+ "resize-observer-polyfill": "^1.5.0",
"rison-node": "1.0.2",
"rxjs": "^6.5.5",
"seedrandom": "^3.0.5",
@@ -305,17 +388,30 @@
"style-it": "^2.1.3",
"styled-components": "^5.1.0",
"symbol-observable": "^1.2.0",
+ "suricata-sid-db": "^1.0.2",
"tabbable": "1.1.3",
"tar": "4.4.13",
+ "tinycolor2": "1.4.1",
"tinygradient": "0.4.3",
+ "topojson-client": "3.0.0",
"tree-kill": "^1.2.2",
"ts-easing": "^0.2.0",
"tslib": "^2.0.0",
"type-detect": "^4.0.8",
+ "typescript-fsa": "^3.0.0",
+ "typescript-fsa-reducers": "^1.2.2",
"ui-select": "0.19.8",
"unified": "^9.2.1",
+ "unstated": "^2.1.1",
+ "use-resize-observer": "^6.0.0",
"utility-types": "^3.10.0",
"uuid": "3.3.2",
+ "vega": "^5.19.1",
+ "vega-lite": "^4.17.0",
+ "vega-schema-url-parser": "^2.1.0",
+ "vega-spec-injector": "^0.0.2",
+ "vega-tooltip": "^0.25.0",
+ "venn.js": "0.2.20",
"vinyl": "^2.2.0",
"vt-pbf": "^3.1.1",
"wellknown": "^0.5.0",
@@ -347,13 +443,10 @@
"@cypress/webpack-preprocessor": "^5.5.0",
"@elastic/apm-rum": "^5.6.1",
"@elastic/apm-rum-react": "^1.2.5",
- "@elastic/charts": "25.3.0",
"@elastic/eslint-config-kibana": "link:packages/elastic-eslint-config-kibana",
"@elastic/eslint-plugin-eui": "0.0.2",
"@elastic/github-checks-reporter": "0.0.20b3",
"@elastic/makelogs": "^6.0.0",
- "@elastic/maki": "6.3.0",
- "@elastic/ui-ace": "0.2.3",
"@istanbuljs/schema": "^0.1.2",
"@jest/reporters": "^26.5.2",
"@kbn/babel-code-parser": "link:packages/kbn-babel-code-parser",
@@ -373,17 +466,11 @@
"@kbn/telemetry-tools": "link:packages/kbn-telemetry-tools",
"@kbn/test": "link:packages/kbn-test",
"@kbn/test-subj-selector": "link:packages/kbn-test-subj-selector",
- "@kbn/utility-types": "link:packages/kbn-utility-types",
"@loaders.gl/polyfills": "^2.3.5",
- "@mapbox/geojson-rewind": "^0.5.0",
- "@mapbox/mapbox-gl-draw": "^1.2.0",
- "@mapbox/mapbox-gl-rtl-text": "^0.2.3",
- "@mapbox/vector-tile": "1.3.1",
"@microsoft/api-documenter": "7.7.2",
"@microsoft/api-extractor": "7.7.0",
"@octokit/rest": "^16.35.0",
"@percy/agent": "^0.28.6",
- "@scant/router": "^0.1.0",
"@storybook/addon-a11y": "^6.1.20",
"@storybook/addon-actions": "^6.1.20",
"@storybook/addon-docs": "^6.1.20",
@@ -456,7 +543,6 @@
"@types/he": "^1.1.1",
"@types/history": "^4.7.3",
"@types/hjson": "^2.4.2",
- "@types/hoist-non-react-statics": "^3.3.1",
"@types/http-proxy": "^1.17.4",
"@types/http-proxy-agent": "^2.0.2",
"@types/inquirer": "^7.3.1",
@@ -476,7 +562,6 @@
"@types/listr": "^0.14.0",
"@types/loader-utils": "^1.1.3",
"@types/lodash": "^4.14.159",
- "@types/log-symbols": "^2.0.0",
"@types/lru-cache": "^5.1.0",
"@types/mapbox-gl": "^1.9.1",
"@types/markdown-it": "^0.0.7",
@@ -563,21 +648,13 @@
"@types/zen-observable": "^0.8.0",
"@typescript-eslint/eslint-plugin": "^4.14.1",
"@typescript-eslint/parser": "^4.14.1",
- "@welldone-software/why-did-you-render": "^5.0.0",
"@yarnpkg/lockfile": "^1.1.0",
"abab": "^2.0.4",
"aggregate-error": "^3.1.0",
- "angular-aria": "^1.8.0",
"angular-mocks": "^1.7.9",
- "angular-recursion": "^1.0.5",
- "angular-route": "^1.8.0",
- "angular-sortable-view": "^0.0.17",
"antlr4ts-cli": "^0.5.0-alpha.3",
"apidoc": "^0.25.0",
"apidoc-markdown": "^5.1.8",
- "apollo-link": "^1.2.3",
- "apollo-link-error": "^1.1.7",
- "apollo-link-state": "^0.4.1",
"argsplit": "^1.0.5",
"autoprefixer": "^9.7.4",
"axe-core": "^4.0.2",
@@ -590,34 +667,23 @@
"babel-plugin-styled-components": "^1.10.7",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"backport": "^5.6.6",
- "base64-js": "^1.3.1",
"base64url": "^3.0.1",
- "broadcast-channel": "^3.0.3",
"callsites": "^3.1.0",
"chai": "3.5.0",
"chance": "1.0.18",
- "cheerio": "0.22.0",
"chromedriver": "^89.0.0",
"clean-webpack-plugin": "^3.0.0",
"cmd-shim": "^2.1.0",
- "compare-versions": "3.5.1",
"compression-webpack-plugin": "^4.0.0",
- "constate": "^1.3.2",
- "copy-to-clipboard": "^3.0.8",
"copy-webpack-plugin": "^6.0.2",
"cpy": "^8.1.1",
- "cronstrue": "^1.51.0",
"css-loader": "^3.4.2",
"cypress": "^6.2.1",
"cypress-cucumber-preprocessor": "^2.5.2",
"cypress-multi-reporters": "^1.4.0",
"cypress-pipe": "^2.0.0",
"cypress-promise": "^1.1.0",
- "d3": "3.5.17",
- "d3-cloud": "1.2.5",
- "d3-scale": "1.0.7",
"debug": "^2.6.9",
- "deepmerge": "^4.2.2",
"del-cli": "^3.0.1",
"delete-empty": "^2.0.0",
"dependency-check": "^4.1.0",
@@ -654,9 +720,7 @@
"fast-glob": "2.2.7",
"fetch-mock": "^7.3.9",
"file-loader": "^4.2.0",
- "file-saver": "^1.3.8",
"form-data": "^4.0.0",
- "formsy-react": "^1.1.5",
"geckodriver": "^1.22.2",
"glob-watcher": "5.0.3",
"graphql-code-generator": "^0.18.2",
@@ -675,19 +739,10 @@
"gulp-zip": "^5.0.2",
"has-ansi": "^3.0.0",
"hdr-histogram-js": "^1.2.0",
- "he": "^1.2.0",
- "highlight.js": "^9.18.5",
- "history-extra": "^5.0.1",
- "hoist-non-react-statics": "^3.3.2",
"html": "1.0.0",
"html-loader": "^0.5.5",
"http-proxy": "^1.18.1",
- "i18n-iso-countries": "^4.3.1",
- "icalendar": "0.7.1",
- "iedriver": "^3.14.2",
- "imports-loader": "^0.8.0",
"inquirer": "^7.3.3",
- "intl-messageformat-parser": "^1.4.0",
"is-glob": "^4.0.1",
"is-path-inside": "^3.0.2",
"istanbul-instrumenter-loader": "^3.0.1",
@@ -705,31 +760,14 @@
"jest-styled-components": "^7.0.2",
"jest-when": "^2.7.2",
"jimp": "^0.14.0",
- "js-levenshtein": "^1.1.6",
- "js-search": "^1.4.3",
"jsdom": "13.1.0",
- "json-stringify-pretty-compact": "1.2.0",
"json5": "^1.0.1",
"jsondiffpatch": "0.4.1",
- "jsts": "^1.6.2",
- "kea": "^2.3.0",
- "keymirror": "0.1.1",
- "leaflet": "1.5.1",
- "leaflet-draw": "0.4.14",
- "leaflet-responsive-popup": "0.6.4",
- "leaflet.heat": "0.2.0",
- "less": "npm:@elastic/less@2.7.3-kibana",
"license-checker": "^16.0.0",
"listr": "^0.14.1",
"lmdb-store": "^0.9.0",
"load-grunt-config": "^3.0.1",
- "loader-utils": "^1.2.3",
- "log-symbols": "^2.2.0",
- "lz-string": "^1.4.4",
- "mapbox-gl": "1.13.1",
- "mapbox-gl-draw-rectangle-mode": "^1.0.4",
"marge": "^1.0.1",
- "memoize-one": "^5.0.0",
"micromatch": "3.1.10",
"minimist": "^1.2.5",
"mkdirp": "0.5.1",
@@ -741,8 +779,6 @@
"mock-http-server": "1.3.0",
"ms-chromium-edge-driver": "^0.2.3",
"multimatch": "^4.0.0",
- "multistream": "^2.1.1",
- "murmurhash3js": "3.0.1",
"mutation-observer": "^1.0.3",
"ncp": "^2.0.0",
"node-sass": "^4.14.1",
@@ -750,53 +786,19 @@
"nyc": "^15.0.1",
"oboe": "^2.1.4",
"ora": "^4.0.4",
- "p-limit": "^3.0.1",
"parse-link-header": "^1.0.1",
"pbf": "3.2.1",
"pirates": "^4.0.1",
"pixelmatch": "^5.1.0",
- "pkg-up": "^2.0.0",
- "pluralize": "3.1.0",
- "polished": "^1.9.2",
"postcss": "^7.0.32",
"postcss-loader": "^3.0.0",
"postcss-prefix-selector": "^1.7.2",
"prettier": "^2.2.0",
"pretty-ms": "5.0.0",
- "proxyquire": "1.8.0",
"q": "^1.5.1",
- "querystring": "^0.2.0",
- "rbush": "^3.0.1",
- "re-resizable": "^6.1.1",
- "react-apollo": "^2.1.4",
- "react-beautiful-dnd": "^13.0.0",
- "react-docgen-typescript-loader": "^3.1.1",
- "react-dropzone": "^4.2.9",
- "react-fast-compare": "^2.0.4",
- "react-grid-layout": "^0.16.2",
- "react-markdown": "^4.3.1",
- "react-monaco-editor": "^0.41.2",
- "react-popper-tooltip": "^2.10.1",
- "react-resize-detector": "^4.2.0",
- "react-reverse-portal": "^1.0.4",
- "react-router-redux": "^4.0.8",
- "react-shortcuts": "^2.0.0",
- "react-sizeme": "^2.3.6",
- "react-syntax-highlighter": "^15.3.1",
"react-test-renderer": "^16.12.0",
- "react-tiny-virtual-list": "^2.2.0",
- "react-virtualized": "^9.21.2",
- "react-vis": "^1.8.1",
- "react-visibility-sensor": "^5.1.1",
- "reactcss": "1.2.3",
"read-pkg": "^5.2.0",
- "reduce-reducers": "^1.0.4",
- "redux-devtools-extension": "^2.13.8",
- "redux-saga": "^1.1.3",
- "redux-thunks": "^1.0.0",
"regenerate": "^1.4.0",
- "reselect": "^4.0.0",
- "resize-observer-polyfill": "^1.5.0",
"resolve": "^1.7.1",
"rxjs-marbles": "^5.0.6",
"sass-loader": "^8.0.2",
@@ -816,31 +818,18 @@
"supertest": "^3.1.0",
"supertest-as-promised": "^4.0.2",
"supports-color": "^7.0.0",
- "suricata-sid-db": "^1.0.2",
"tape": "^5.0.1",
"tar-fs": "^2.1.0",
"tempy": "^0.3.0",
"terminal-link": "^2.1.1",
"terser-webpack-plugin": "^2.1.2",
- "tinycolor2": "1.4.1",
- "topojson-client": "3.0.0",
"ts-loader": "^7.0.5",
"ts-morph": "^9.1.0",
"tsd": "^0.13.1",
"typescript": "4.1.3",
- "typescript-fsa": "^3.0.0",
- "typescript-fsa-reducers": "^1.2.2",
"unlazy-loader": "^0.1.3",
- "unstated": "^2.1.1",
"url-loader": "^2.2.0",
- "use-resize-observer": "^6.0.0",
"val-loader": "^1.1.1",
- "vega": "^5.19.1",
- "vega-lite": "^4.17.0",
- "vega-schema-url-parser": "^2.1.0",
- "vega-spec-injector": "^0.0.2",
- "vega-tooltip": "^0.25.0",
- "venn.js": "0.2.20",
"vinyl-fs": "^3.0.3",
"wait-on": "^5.2.1",
"watchpack": "^1.6.0",
diff --git a/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.json b/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.json
index 99b108eb2e6b3..e9b87aa0f972f 100644
--- a/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.json
+++ b/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.json
@@ -2,6 +2,45 @@
"id": "pluginA",
"client": {
"classes": [
+ {
+ "id": "def-public.CrazyClass",
+ "type": "Class",
+ "tags": [],
+ "label": "CrazyClass",
+ "description": [],
+ "signature": [
+ {
+ "pluginId": "pluginA",
+ "scope": "public",
+ "docId": "kibPluginAPluginApi",
+ "section": "def-public.CrazyClass",
+ "text": "CrazyClass"
+ },
+ "
"`;
+exports[`FlyoutService openFlyout() renders a flyout to the DOM 2`] = `"
Flyout content
"`;
exports[`FlyoutService openFlyout() with a currently active flyout replaces the current flyout with a new one 1`] = `
Array [
@@ -59,4 +59,4 @@ Array [
]
`;
-exports[`FlyoutService openFlyout() with a currently active flyout replaces the current flyout with a new one 2`] = `"
Flyout content 2
"`;
+exports[`FlyoutService openFlyout() with a currently active flyout replaces the current flyout with a new one 2`] = `"
"`;
exports[`ModalService openConfirm() with a currently active confirm replaces the current confirm with the new one 1`] = `
Array [
@@ -131,7 +131,7 @@ Array [
]
`;
-exports[`ModalService openModal() renders a modal to the DOM 2`] = `"
Modal content
"`;
+exports[`ModalService openModal() renders a modal to the DOM 2`] = `"
Modal content
"`;
exports[`ModalService openModal() with a currently active confirm replaces the current confirm with the new one 1`] = `
Array [
diff --git a/src/core/public/public.api.md b/src/core/public/public.api.md
index 5c034e68a3736..5a5ae253bac7f 100644
--- a/src/core/public/public.api.md
+++ b/src/core/public/public.api.md
@@ -559,7 +559,9 @@ export interface DocLinksStart {
readonly sum: string;
readonly top_hits: string;
};
- readonly runtimeFields: string;
+ readonly runtimeFields: {
+ readonly mapping: string;
+ };
readonly scriptedFields: {
readonly scriptFields: string;
readonly scriptAggs: string;
diff --git a/src/core/server/elasticsearch/integration_tests/client.test.ts b/src/core/server/elasticsearch/integration_tests/client.test.ts
new file mode 100644
index 0000000000000..3a4b7c5c4af22
--- /dev/null
+++ b/src/core/server/elasticsearch/integration_tests/client.test.ts
@@ -0,0 +1,57 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import {
+ createTestServers,
+ TestElasticsearchUtils,
+ TestKibanaUtils,
+} from '../../../test_helpers/kbn_server';
+
+describe('elasticsearch clients', () => {
+ let esServer: TestElasticsearchUtils;
+ let kibanaServer: TestKibanaUtils;
+
+ beforeAll(async () => {
+ const { startES, startKibana } = createTestServers({
+ adjustTimeout: jest.setTimeout,
+ });
+
+ esServer = await startES();
+ kibanaServer = await startKibana();
+ });
+
+ afterAll(async () => {
+ await kibanaServer.stop();
+ await esServer.stop();
+ });
+
+ it('does not return deprecation warning when x-elastic-product-origin header is set', async () => {
+ // Header should be automatically set by Core
+ const resp1 = await kibanaServer.coreStart.elasticsearch.client.asInternalUser.indices.getSettings(
+ { index: '.kibana' }
+ );
+ expect(resp1.headers).not.toHaveProperty('warning');
+
+ // Also test setting it explicitly
+ const resp2 = await kibanaServer.coreStart.elasticsearch.client.asInternalUser.indices.getSettings(
+ { index: '.kibana' },
+ { headers: { 'x-elastic-product-origin': 'kibana' } }
+ );
+ expect(resp2.headers).not.toHaveProperty('warning');
+ });
+
+ it('returns deprecation warning when x-elastic-product-orign header is not set', async () => {
+ const resp = await kibanaServer.coreStart.elasticsearch.client.asInternalUser.indices.getSettings(
+ { index: '.kibana' },
+ { headers: { 'x-elastic-product-origin': null } }
+ );
+
+ expect(resp.headers).toHaveProperty('warning');
+ expect(resp.headers!.warning).toMatch('system indices');
+ });
+});
diff --git a/src/core/server/saved_objects/service/lib/repository.test.js b/src/core/server/saved_objects/service/lib/repository.test.js
index 37572c83e4c88..ce48e8dc9a317 100644
--- a/src/core/server/saved_objects/service/lib/repository.test.js
+++ b/src/core/server/saved_objects/service/lib/repository.test.js
@@ -23,6 +23,7 @@ import { mockKibanaMigrator } from '../../migrations/kibana/kibana_migrator.mock
import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks';
import { esKuery } from '../../es_query';
import { errors as EsErrors } from '@elastic/elasticsearch';
+
const { nodeTypes } = esKuery;
jest.mock('./search_dsl/search_dsl', () => ({ getSearchDsl: jest.fn() }));
@@ -3654,6 +3655,33 @@ describe('SavedObjectsRepository', () => {
);
});
+ it(`uses the 'upsertAttributes' option when specified`, async () => {
+ const upsertAttributes = {
+ foo: 'bar',
+ hello: 'dolly',
+ };
+ await incrementCounterSuccess(type, id, counterFields, { namespace, upsertAttributes });
+ expect(client.update).toHaveBeenCalledWith(
+ expect.objectContaining({
+ body: expect.objectContaining({
+ upsert: expect.objectContaining({
+ [type]: {
+ foo: 'bar',
+ hello: 'dolly',
+ ...counterFields.reduce((aggs, field) => {
+ return {
+ ...aggs,
+ [field]: 1,
+ };
+ }, {}),
+ },
+ }),
+ }),
+ }),
+ expect.anything()
+ );
+ });
+
it(`prepends namespace to the id when providing namespace for single-namespace type`, async () => {
await incrementCounterSuccess(type, id, counterFields, { namespace });
expect(client.update).toHaveBeenCalledWith(
diff --git a/src/core/server/saved_objects/service/lib/repository.ts b/src/core/server/saved_objects/service/lib/repository.ts
index aa1e62c1652ca..6e2a1d6ec0511 100644
--- a/src/core/server/saved_objects/service/lib/repository.ts
+++ b/src/core/server/saved_objects/service/lib/repository.ts
@@ -76,10 +76,16 @@ import {
// BEWARE: The SavedObjectClient depends on the implementation details of the SavedObjectsRepository
// so any breaking changes to this repository are considered breaking changes to the SavedObjectsClient.
-// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
-type Left = { tag: 'Left'; error: Record };
-// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
-type Right = { tag: 'Right'; value: Record };
+interface Left {
+ tag: 'Left';
+ error: Record;
+}
+
+interface Right {
+ tag: 'Right';
+ value: Record;
+}
+
type Either = Left | Right;
const isLeft = (either: Either): either is Left => either.tag === 'Left';
const isRight = (either: Either): either is Right => either.tag === 'Right';
@@ -98,7 +104,8 @@ export interface SavedObjectsRepositoryOptions {
/**
* @public
*/
-export interface SavedObjectsIncrementCounterOptions extends SavedObjectsBaseOptions {
+export interface SavedObjectsIncrementCounterOptions
+ extends SavedObjectsBaseOptions {
/**
* (default=false) If true, sets all the counter fields to 0 if they don't
* already exist. Existing fields will be left as-is and won't be incremented.
@@ -111,6 +118,10 @@ export interface SavedObjectsIncrementCounterOptions extends SavedObjectsBaseOpt
* operation. See {@link MutatingOperationRefreshSetting}
*/
refresh?: MutatingOperationRefreshSetting;
+ /**
+ * Attributes to use when upserting the document if it doesn't exist.
+ */
+ upsertAttributes?: Attributes;
}
/**
@@ -1694,6 +1705,20 @@ export class SavedObjectsRepository {
* .incrementCounter('dashboard_counter_type', 'counter_id', [
* 'stats.apiCalls',
* ])
+ *
+ * // Increment the apiCalls field counter by 4
+ * repository
+ * .incrementCounter('dashboard_counter_type', 'counter_id', [
+ * { fieldName: 'stats.apiCalls' incrementBy: 4 },
+ * ])
+ *
+ * // Initialize the document with arbitrary fields if not present
+ * repository.incrementCounter<{ appId: string }>(
+ * 'dashboard_counter_type',
+ * 'counter_id',
+ * [ 'stats.apiCalls'],
+ * { upsertAttributes: { appId: 'myId' } }
+ * )
* ```
*
* @param type - The type of saved object whose fields should be incremented
@@ -1706,7 +1731,7 @@ export class SavedObjectsRepository {
type: string,
id: string,
counterFields: Array,
- options: SavedObjectsIncrementCounterOptions = {}
+ options: SavedObjectsIncrementCounterOptions = {}
): Promise> {
if (typeof type !== 'string') {
throw new Error('"type" argument must be a string');
@@ -1728,12 +1753,16 @@ export class SavedObjectsRepository {
throw SavedObjectsErrorHelpers.createUnsupportedTypeError(type);
}
- const { migrationVersion, refresh = DEFAULT_REFRESH_SETTING, initialize = false } = options;
+ const {
+ migrationVersion,
+ refresh = DEFAULT_REFRESH_SETTING,
+ initialize = false,
+ upsertAttributes,
+ } = options;
const normalizedCounterFields = counterFields.map((counterField) => {
const fieldName = typeof counterField === 'string' ? counterField : counterField.fieldName;
const incrementBy = typeof counterField === 'string' ? 1 : counterField.incrementBy || 1;
-
return {
fieldName,
incrementBy: initialize ? 0 : incrementBy,
@@ -1757,11 +1786,14 @@ export class SavedObjectsRepository {
type,
...(savedObjectNamespace && { namespace: savedObjectNamespace }),
...(savedObjectNamespaces && { namespaces: savedObjectNamespaces }),
- attributes: normalizedCounterFields.reduce((acc, counterField) => {
- const { fieldName, incrementBy } = counterField;
- acc[fieldName] = incrementBy;
- return acc;
- }, {} as Record),
+ attributes: {
+ ...(upsertAttributes ?? {}),
+ ...normalizedCounterFields.reduce((acc, counterField) => {
+ const { fieldName, incrementBy } = counterField;
+ acc[fieldName] = incrementBy;
+ return acc;
+ }, {} as Record),
+ },
migrationVersion,
updated_at: time,
});
diff --git a/src/core/server/server.api.md b/src/core/server/server.api.md
index 73f8a44075162..cf1647ef5cec3 100644
--- a/src/core/server/server.api.md
+++ b/src/core/server/server.api.md
@@ -2735,11 +2735,12 @@ export interface SavedObjectsIncrementCounterField {
}
// @public (undocumented)
-export interface SavedObjectsIncrementCounterOptions extends SavedObjectsBaseOptions {
+export interface SavedObjectsIncrementCounterOptions extends SavedObjectsBaseOptions {
initialize?: boolean;
// (undocumented)
migrationVersion?: SavedObjectsMigrationVersion;
refresh?: MutatingOperationRefreshSetting;
+ upsertAttributes?: Attributes;
}
// @public
@@ -2839,7 +2840,7 @@ export class SavedObjectsRepository {
// (undocumented)
find(options: SavedObjectsFindOptions): Promise>;
get(type: string, id: string, options?: SavedObjectsBaseOptions): Promise>;
- incrementCounter(type: string, id: string, counterFields: Array, options?: SavedObjectsIncrementCounterOptions): Promise>;
+ incrementCounter(type: string, id: string, counterFields: Array, options?: SavedObjectsIncrementCounterOptions): Promise>;
openPointInTimeForType(type: string | string[], { keepAlive, preference }?: SavedObjectsOpenPointInTimeOptions): Promise;
removeReferencesTo(type: string, id: string, options?: SavedObjectsRemoveReferencesToOptions): Promise;
resolve(type: string, id: string, options?: SavedObjectsBaseOptions): Promise>;
diff --git a/src/plugins/dashboard/common/embeddable/embeddable_saved_object_converters.ts b/src/plugins/dashboard/common/embeddable/embeddable_saved_object_converters.ts
index c67cd325572ff..96725d4405112 100644
--- a/src/plugins/dashboard/common/embeddable/embeddable_saved_object_converters.ts
+++ b/src/plugins/dashboard/common/embeddable/embeddable_saved_object_converters.ts
@@ -29,9 +29,6 @@ export function convertPanelStateToSavedDashboardPanel(
panelState: DashboardPanelState,
version: string
): SavedDashboardPanel {
- const customTitle: string | undefined = panelState.explicitInput.title
- ? (panelState.explicitInput.title as string)
- : undefined;
const savedObjectId = (panelState.explicitInput as SavedObjectEmbeddableInput).savedObjectId;
return {
version,
@@ -39,7 +36,7 @@ export function convertPanelStateToSavedDashboardPanel(
gridData: panelState.gridData,
panelIndex: panelState.explicitInput.id,
embeddableConfig: omit(panelState.explicitInput, ['id', 'savedObjectId', 'title']),
- ...(customTitle && { title: customTitle }),
+ ...(panelState.explicitInput.title !== undefined && { title: panelState.explicitInput.title }),
...(savedObjectId !== undefined && { id: savedObjectId }),
};
}
diff --git a/src/plugins/dashboard/public/application/embeddable/empty_screen/__snapshots__/dashboard_empty_screen.test.tsx.snap b/src/plugins/dashboard/public/application/embeddable/empty_screen/__snapshots__/dashboard_empty_screen.test.tsx.snap
index a50aadc12e6c0..9e3018fb512c3 100644
--- a/src/plugins/dashboard/public/application/embeddable/empty_screen/__snapshots__/dashboard_empty_screen.test.tsx.snap
+++ b/src/plugins/dashboard/public/application/embeddable/empty_screen/__snapshots__/dashboard_empty_screen.test.tsx.snap
@@ -597,7 +597,7 @@ exports[`DashboardEmptyScreen renders correctly with readonly mode 1`] = `
restrictWidth="500px"
>
@@ -671,12 +671,12 @@ exports[`after fetch renders call to action when no dashboards exist 1`] = `
restrictWidth={true}
>
@@ -817,12 +817,12 @@ exports[`after fetch renders warning when listingLimit is exceeded 1`] = `
restrictWidth={true}
>
diff --git a/src/plugins/data/README.mdx b/src/plugins/data/README.mdx
index 145aaa64fa3ad..60e74a3fa126c 100644
--- a/src/plugins/data/README.mdx
+++ b/src/plugins/data/README.mdx
@@ -21,7 +21,6 @@ It is wired into the `TopNavMenu` component, but can be used independently.
### Fetch Query Suggestions
The `getQuerySuggestions` function helps to construct a query.
-KQL suggestion functions are registered in X-Pack, so this API does not return results in OSS.
```.ts
diff --git a/src/plugins/data/common/search/session/types.ts b/src/plugins/data/common/search/session/types.ts
index f63d2dfec142c..a7ba8ab9576b6 100644
--- a/src/plugins/data/common/search/session/types.ts
+++ b/src/plugins/data/common/search/session/types.ts
@@ -31,6 +31,13 @@ export interface SearchSessionSavedObjectAttributes {
* Expiration time of the session. Expiration itself is managed by Elasticsearch.
*/
expires: string;
+ /**
+ * Time of transition into completed state,
+ *
+ * Can be "null" in case already completed session
+ * transitioned into in-progress session
+ */
+ completed?: string | null;
/**
* status
*/
diff --git a/src/plugins/data/public/autocomplete/autocomplete_service.ts b/src/plugins/data/public/autocomplete/autocomplete_service.ts
index 6b288c4507f06..eb9d859664c4d 100644
--- a/src/plugins/data/public/autocomplete/autocomplete_service.ts
+++ b/src/plugins/data/public/autocomplete/autocomplete_service.ts
@@ -18,6 +18,11 @@ import {
import { ConfigSchema } from '../../config';
import { UsageCollectionSetup } from '../../../usage_collection/public';
import { createUsageCollector } from './collectors';
+import {
+ KUERY_LANGUAGE_NAME,
+ setupKqlQuerySuggestionProvider,
+} from './providers/kql_query_suggestion';
+import { DataPublicPluginStart, DataStartDependencies } from '../types';
export class AutocompleteService {
autocompleteConfig: ConfigSchema['autocomplete'];
@@ -31,12 +36,6 @@ export class AutocompleteService {
private readonly querySuggestionProviders: Map = new Map();
private getValueSuggestions?: ValueSuggestionsGetFn;
- private addQuerySuggestionProvider = (language: string, provider: QuerySuggestionGetFn): void => {
- if (language && provider && this.autocompleteConfig.querySuggestions.enabled) {
- this.querySuggestionProviders.set(language, provider);
- }
- };
-
private getQuerySuggestions: QuerySuggestionGetFn = (args) => {
const { language } = args;
const provider = this.querySuggestionProviders.get(language);
@@ -50,7 +49,7 @@ export class AutocompleteService {
/** @public **/
public setup(
- core: CoreSetup,
+ core: CoreSetup,
{
timefilter,
usageCollection,
@@ -62,11 +61,15 @@ export class AutocompleteService {
? setupValueSuggestionProvider(core, { timefilter, usageCollector })
: getEmptyValueSuggestions;
- return {
- addQuerySuggestionProvider: this.addQuerySuggestionProvider,
+ if (this.autocompleteConfig.querySuggestions.enabled) {
+ this.querySuggestionProviders.set(KUERY_LANGUAGE_NAME, setupKqlQuerySuggestionProvider(core));
+ }
- /** @obsolete **/
- /** please use "getProvider" only from the start contract **/
+ return {
+ /**
+ * @deprecated
+ * please use "getQuerySuggestions" from the start contract
+ */
getQuerySuggestions: this.getQuerySuggestions,
};
}
diff --git a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/README.md b/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/README.md
new file mode 100644
index 0000000000000..2ab87a7a490c1
--- /dev/null
+++ b/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/README.md
@@ -0,0 +1 @@
+This is implementation of KQL query suggestions
diff --git a/x-pack/plugins/data_enhanced/public/autocomplete/providers/kql_query_suggestion/__fixtures__/index_pattern_response.json b/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/__fixtures__/index_pattern_response.json
similarity index 100%
rename from x-pack/plugins/data_enhanced/public/autocomplete/providers/kql_query_suggestion/__fixtures__/index_pattern_response.json
rename to src/plugins/data/public/autocomplete/providers/kql_query_suggestion/__fixtures__/index_pattern_response.json
diff --git a/x-pack/plugins/data_enhanced/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts b/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts
similarity index 92%
rename from x-pack/plugins/data_enhanced/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts
rename to src/plugins/data/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts
index 5e562ae63e91b..c1c44f1f55548 100644
--- a/x-pack/plugins/data_enhanced/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts
+++ b/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/conjunction.test.ts
@@ -1,8 +1,9 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
*/
import { setupGetConjunctionSuggestions } from './conjunction';
diff --git a/x-pack/plugins/data_enhanced/public/autocomplete/providers/kql_query_suggestion/conjunction.tsx b/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/conjunction.tsx
similarity index 67%
rename from x-pack/plugins/data_enhanced/public/autocomplete/providers/kql_query_suggestion/conjunction.tsx
rename to src/plugins/data/public/autocomplete/providers/kql_query_suggestion/conjunction.tsx
index 7efc2ea193abe..345f9f8051e5d 100644
--- a/x-pack/plugins/data_enhanced/public/autocomplete/providers/kql_query_suggestion/conjunction.tsx
+++ b/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/conjunction.tsx
@@ -1,8 +1,9 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
*/
import React from 'react';
@@ -16,17 +17,17 @@ import {
const bothArgumentsText = (
);
const oneOrMoreArgumentsText = (
);
@@ -34,20 +35,20 @@ const conjunctions: Record = {
and: (
{bothArgumentsText},
}}
description="Full text: ' Requires both arguments to be true'. See
- 'xpack.data.kueryAutocomplete.andOperatorDescription.bothArgumentsText' for 'both arguments' part."
+ 'data.kueryAutocomplete.andOperatorDescription.bothArgumentsText' for 'both arguments' part."
/>
),
or: (
= {
),
}}
description="Full text: 'Requires one or more arguments to be true'. See
- 'xpack.data.kueryAutocomplete.orOperatorDescription.oneOrMoreArgumentsText' for 'one or more arguments' part."
+ 'data.kueryAutocomplete.orOperatorDescription.oneOrMoreArgumentsText' for 'one or more arguments' part."
/>
),
diff --git a/x-pack/plugins/data_enhanced/public/autocomplete/providers/kql_query_suggestion/field.test.ts b/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/field.test.ts
similarity index 97%
rename from x-pack/plugins/data_enhanced/public/autocomplete/providers/kql_query_suggestion/field.test.ts
rename to src/plugins/data/public/autocomplete/providers/kql_query_suggestion/field.test.ts
index afc55d13af9d9..f1eced06a33ea 100644
--- a/x-pack/plugins/data_enhanced/public/autocomplete/providers/kql_query_suggestion/field.test.ts
+++ b/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/field.test.ts
@@ -1,8 +1,9 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
*/
import indexPatternResponse from './__fixtures__/index_pattern_response.json';
diff --git a/x-pack/plugins/data_enhanced/public/autocomplete/providers/kql_query_suggestion/field.tsx b/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/field.tsx
similarity index 92%
rename from x-pack/plugins/data_enhanced/public/autocomplete/providers/kql_query_suggestion/field.tsx
rename to src/plugins/data/public/autocomplete/providers/kql_query_suggestion/field.tsx
index ac6f7de888320..5cafca168dfa2 100644
--- a/x-pack/plugins/data_enhanced/public/autocomplete/providers/kql_query_suggestion/field.tsx
+++ b/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/field.tsx
@@ -1,8 +1,9 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
*/
import React from 'react';
@@ -22,7 +23,7 @@ const getDescription = (field: IFieldType) => {
return (
{field.name} }}
/>
diff --git a/x-pack/plugins/data_enhanced/public/autocomplete/providers/kql_query_suggestion/index.ts b/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/index.ts
similarity index 85%
rename from x-pack/plugins/data_enhanced/public/autocomplete/providers/kql_query_suggestion/index.ts
rename to src/plugins/data/public/autocomplete/providers/kql_query_suggestion/index.ts
index 8b36480a35b17..c5c1626ae74f6 100644
--- a/x-pack/plugins/data_enhanced/public/autocomplete/providers/kql_query_suggestion/index.ts
+++ b/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/index.ts
@@ -1,8 +1,9 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
*/
import { CoreSetup } from 'kibana/public';
@@ -17,6 +18,7 @@ import {
QuerySuggestion,
QuerySuggestionGetFnArgs,
QuerySuggestionGetFn,
+ DataPublicPluginStart,
} from '../../../../../../../src/plugins/data/public';
const cursorSymbol = '@kuery-cursor@';
@@ -26,7 +28,9 @@ const dedup = (suggestions: QuerySuggestion[]): QuerySuggestion[] =>
export const KUERY_LANGUAGE_NAME = 'kuery';
-export const setupKqlQuerySuggestionProvider = (core: CoreSetup): QuerySuggestionGetFn => {
+export const setupKqlQuerySuggestionProvider = (
+ core: CoreSetup
@@ -1304,81 +1295,72 @@ exports[`Inspector Data View component should render single table without select
display="inlineBlock"
hasArrow={true}
isOpen={false}
- ownFocus={false}
+ ownFocus={true}
panelPaddingSize="none"
>
-
-
-
-
-
-
+
+
+
+
-
+
@@ -1420,7 +1402,7 @@ exports[`Inspector Data View component should render single table without select
>