diff --git a/.buildkite/ftr_configs.yml b/.buildkite/ftr_configs.yml
index 3870c67506b42..ba928931f303a 100644
--- a/.buildkite/ftr_configs.yml
+++ b/.buildkite/ftr_configs.yml
@@ -146,6 +146,7 @@ enabled:
- x-pack/test/functional/apps/cross_cluster_replication/config.ts
- x-pack/test/functional/apps/dashboard/group1/config.ts
- x-pack/test/functional/apps/dashboard/group2/config.ts
+ - x-pack/test/functional/apps/dashboard/group3/config.ts
- x-pack/test/functional/apps/data_views/config.ts
- x-pack/test/functional/apps/dev_tools/config.ts
- x-pack/test/functional/apps/discover/config.ts
@@ -245,3 +246,9 @@ enabled:
- x-pack/test/ui_capabilities/spaces_only/config.ts
- x-pack/test/upgrade_assistant_integration/config.js
- x-pack/test/usage_collection/config.ts
+ - x-pack/test/performance/journeys/ecommerce_dashboard/config.ts
+ - x-pack/test/performance/journeys/flight_dashboard/config.ts
+ - x-pack/test/performance/journeys/login/config.ts
+ - x-pack/test/performance/journeys/many_fields_discover/config.ts
+ - x-pack/test/performance/journeys/promotion_tracking_dashboard/config.ts
+ - x-pack/test/performance/journeys/web_logs_dashboard/config.ts
diff --git a/.buildkite/pipelines/code_coverage/daily.yml b/.buildkite/pipelines/code_coverage/daily.yml
index a2b501a39b088..c9bb675ab40cf 100644
--- a/.buildkite/pipelines/code_coverage/daily.yml
+++ b/.buildkite/pipelines/code_coverage/daily.yml
@@ -13,7 +13,8 @@ steps:
queue: kibana-default
env:
FTR_CONFIGS_DEPS: ''
- LIMIT_CONFIG_TYPE: 'unit,functional,integration'
+# LIMIT_CONFIG_TYPE: 'unit,functional,integration'
+ LIMIT_CONFIG_TYPE: 'unit,integration'
JEST_UNIT_SCRIPT: '.buildkite/scripts/steps/code_coverage/jest.sh'
JEST_INTEGRATION_SCRIPT: '.buildkite/scripts/steps/code_coverage/jest_integration.sh'
FTR_CONFIGS_SCRIPT: '.buildkite/scripts/steps/code_coverage/ftr_configs.sh'
@@ -25,6 +26,6 @@ steps:
depends_on:
- jest
- jest-integration
- - ftr-configs
+# - ftr-configs
timeout_in_minutes: 30
key: ingest
diff --git a/.buildkite/scripts/steps/code_coverage/ingest.sh b/.buildkite/scripts/steps/code_coverage/ingest.sh
index a2f1b572252a5..a39097f706262 100755
--- a/.buildkite/scripts/steps/code_coverage/ingest.sh
+++ b/.buildkite/scripts/steps/code_coverage/ingest.sh
@@ -27,7 +27,7 @@ echo "--- Upload new git sha"
echo "--- Download coverage artifacts"
buildkite-agent artifact download target/kibana-coverage/jest/* .
-buildkite-agent artifact download target/kibana-coverage/functional/* .
+#buildkite-agent artifact download target/kibana-coverage/functional/* .
buildkite-agent artifact download target/ran_files/* .
ls -l target/ran_files/* || echo "### No ran-files found"
@@ -42,20 +42,20 @@ echo "--- Jest: Reset file paths prefix, merge coverage files, and generate the
replacePaths "$KIBANA_DIR/target/kibana-coverage/jest" "CC_REPLACEMENT_ANCHOR" "$KIBANA_DIR"
yarn nyc report --nycrc-path src/dev/code_coverage/nyc_config/nyc.jest.config.js
-echo "--- Functional: Reset file paths prefix, merge coverage files, and generate the final combined report"
+#echo "--- Functional: Reset file paths prefix, merge coverage files, and generate the final combined report"
# Functional: Reset file paths prefix to Kibana Dir of final worker
-set +e
-sed -ie "s|CC_REPLACEMENT_ANCHOR|${KIBANA_DIR}|g" target/kibana-coverage/functional/*.json
-echo "--- Begin Split and Merge for Functional"
-splitCoverage target/kibana-coverage/functional
-splitMerge
-set -e
+#set +e
+#sed -ie "s|CC_REPLACEMENT_ANCHOR|${KIBANA_DIR}|g" target/kibana-coverage/functional/*.json
+#echo "--- Begin Split and Merge for Functional"
+#splitCoverage target/kibana-coverage/functional
+#splitMerge
+#set -e
echo "--- Archive and upload combined reports"
collectAndUpload target/kibana-coverage/jest/kibana-jest-coverage.tar.gz \
target/kibana-coverage/jest-combined
-collectAndUpload target/kibana-coverage/functional/kibana-functional-coverage.tar.gz \
- target/kibana-coverage/functional-combined
+#collectAndUpload target/kibana-coverage/functional/kibana-functional-coverage.tar.gz \
+# target/kibana-coverage/functional-combined
echo "--- Upload coverage static site"
.buildkite/scripts/steps/code_coverage/reporting/uploadStaticSite.sh
diff --git a/.buildkite/scripts/steps/code_coverage/reporting/ingestData.sh b/.buildkite/scripts/steps/code_coverage/reporting/ingestData.sh
index c1df5ff4b39cf..de006352d0b09 100755
--- a/.buildkite/scripts/steps/code_coverage/reporting/ingestData.sh
+++ b/.buildkite/scripts/steps/code_coverage/reporting/ingestData.sh
@@ -38,14 +38,20 @@ echo "### Generate Team Assignments"
CI_STATS_DISABLED=true node scripts/generate_team_assignments.js \
--verbose --src '.github/CODEOWNERS' --dest $TEAM_ASSIGN_PATH
-for x in functional jest; do
- echo "### Ingesting coverage for ${x}"
- COVERAGE_SUMMARY_FILE="target/kibana-coverage/${x}-combined/coverage-summary.json"
-
- CI_STATS_DISABLED=true node scripts/ingest_coverage.js --path ${COVERAGE_SUMMARY_FILE} \
- --vcsInfoPath ./VCS_INFO.txt --teamAssignmentsPath $TEAM_ASSIGN_PATH &
-done
-wait
+#for x in functional jest; do
+# echo "### Ingesting coverage for ${x}"
+# COVERAGE_SUMMARY_FILE="target/kibana-coverage/${x}-combined/coverage-summary.json"
+#
+# CI_STATS_DISABLED=true node scripts/ingest_coverage.js --path ${COVERAGE_SUMMARY_FILE} \
+# --vcsInfoPath ./VCS_INFO.txt --teamAssignmentsPath $TEAM_ASSIGN_PATH &
+#done
+#wait
+
+echo "### Ingesting coverage for JEST"
+COVERAGE_SUMMARY_FILE="target/kibana-coverage/jest-combined/coverage-summary.json"
+
+CI_STATS_DISABLED=true node scripts/ingest_coverage.js --path ${COVERAGE_SUMMARY_FILE} \
+ --vcsInfoPath ./VCS_INFO.txt --teamAssignmentsPath $TEAM_ASSIGN_PATH
echo "--- Ingesting Code Coverage - Complete"
echo ""
diff --git a/.buildkite/scripts/steps/code_coverage/reporting/prokLinks.sh b/.buildkite/scripts/steps/code_coverage/reporting/prokLinks.sh
index f982ee5c581ce..0b6d0ce8ea105 100755
--- a/.buildkite/scripts/steps/code_coverage/reporting/prokLinks.sh
+++ b/.buildkite/scripts/steps/code_coverage/reporting/prokLinks.sh
@@ -4,7 +4,6 @@ set -euo pipefail
cat << EOF > src/dev/code_coverage/www/index_partial_2.html
Latest Jest
- Latest FTR
@@ -26,4 +25,4 @@ cat << EOF > src/dev/code_coverage/www/index_partial_2.html
EOF
cat src/dev/code_coverage/www/index_partial.html > src/dev/code_coverage/www/index.html
-cat src/dev/code_coverage/www/index_partial_2.html >> src/dev/code_coverage/www/index.html
\ No newline at end of file
+cat src/dev/code_coverage/www/index_partial_2.html >> src/dev/code_coverage/www/index.html
diff --git a/.buildkite/scripts/steps/code_coverage/reporting/uploadStaticSite.sh b/.buildkite/scripts/steps/code_coverage/reporting/uploadStaticSite.sh
index 4d3fb92cf2b43..dcb0b03b16d7c 100755
--- a/.buildkite/scripts/steps/code_coverage/reporting/uploadStaticSite.sh
+++ b/.buildkite/scripts/steps/code_coverage/reporting/uploadStaticSite.sh
@@ -11,8 +11,10 @@ for x in 'src/dev/code_coverage/www/index.html' 'src/dev/code_coverage/www/404.h
gsutil -m -q cp -r -a public-read -z js,css,html ${x} ${uploadPrefix}
done
-gsutil -m -q cp -r -a public-read -z js,css,html ${x} ${uploadPrefixWithTimeStamp}
+#gsutil -m -q cp -r -a public-read -z js,css,html ${x} ${uploadPrefixWithTimeStamp}
+#
+#for x in 'target/kibana-coverage/functional-combined' 'target/kibana-coverage/jest-combined'; do
+# gsutil -m -q cp -r -a public-read -z js,css,html ${x} ${uploadPrefixWithTimeStamp}
+#done
-for x in 'target/kibana-coverage/functional-combined' 'target/kibana-coverage/jest-combined'; do
- gsutil -m -q cp -r -a public-read -z js,css,html ${x} ${uploadPrefixWithTimeStamp}
-done
+gsutil -m -q cp -r -a public-read -z js,css,html 'target/kibana-coverage/jest-combined' ${uploadPrefixWithTimeStamp}
diff --git a/.buildkite/scripts/steps/functional/performance_playwright.sh b/.buildkite/scripts/steps/functional/performance_playwright.sh
index a1c3f23ced51e..e4553fcf09ca1 100644
--- a/.buildkite/scripts/steps/functional/performance_playwright.sh
+++ b/.buildkite/scripts/steps/functional/performance_playwright.sh
@@ -24,24 +24,20 @@ for i in "${journeys[@]}"; do
echo "JOURNEY[${i}] is running"
export TEST_PERFORMANCE_PHASE=WARMUP
- export ELASTIC_APM_ACTIVE=false
export JOURNEY_NAME="${i}"
checks-reporter-with-killswitch "Run Performance Tests with Playwright Config (Journey:${i},Phase: WARMUP)" \
node scripts/functional_tests \
- --config x-pack/test/performance/config.playwright.ts \
- --include "x-pack/test/performance/tests/playwright/${i}.ts" \
+ --config "x-pack/test/performance/journeys/${i}/config.ts" \
--kibana-install-dir "$KIBANA_BUILD_LOCATION" \
--debug \
--bail
export TEST_PERFORMANCE_PHASE=TEST
- export ELASTIC_APM_ACTIVE=true
checks-reporter-with-killswitch "Run Performance Tests with Playwright Config (Journey:${i},Phase: TEST)" \
node scripts/functional_tests \
- --config x-pack/test/performance/config.playwright.ts \
- --include "x-pack/test/performance/tests/playwright/${i}.ts" \
+ --config "x-pack/test/performance/journeys/${i}/config.ts" \
--kibana-install-dir "$KIBANA_BUILD_LOCATION" \
--debug \
--bail
diff --git a/.buildkite/scripts/steps/storybooks/build_and_upload.js b/.buildkite/scripts/steps/storybooks/build_and_upload.js
index c541f59548753..ef790f79fff96 100644
--- a/.buildkite/scripts/steps/storybooks/build_and_upload.js
+++ b/.buildkite/scripts/steps/storybooks/build_and_upload.js
@@ -16,6 +16,7 @@ const STORYBOOKS = [
'canvas',
'ci_composite',
'cloud',
+ 'coloring',
'controls',
'custom_integrations',
'dashboard_enhanced',
diff --git a/.eslintrc.js b/.eslintrc.js
index b4dbfbaf8600b..036b2123ee254 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -657,6 +657,7 @@ module.exports = {
'x-pack/test/*/*config.*ts',
'x-pack/test/saved_object_api_integration/*/apis/**/*',
'x-pack/test/ui_capabilities/*/tests/**/*',
+ 'x-pack/test/performance/**/*.ts',
],
rules: {
'import/no-default-export': 'off',
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 69245de6eb810..ceb9137f9f56e 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -72,6 +72,7 @@
/src/plugins/navigation/ @elastic/kibana-app-services
/src/plugins/share/ @elastic/kibana-app-services
/src/plugins/ui_actions/ @elastic/kibana-app-services
+/src/plugins/ui_actions_enhanced/ @elastic/kibana-app-services
/src/plugins/data_view_field_editor @elastic/kibana-app-services
/src/plugins/screenshot_mode @elastic/kibana-app-services
/src/plugins/bfetch/ @elastic/kibana-app-services
@@ -80,7 +81,6 @@
/src/plugins/unified_search/ @elastic/kibana-app-services
/x-pack/examples/ui_actions_enhanced_examples/ @elastic/kibana-app-services
/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
/src/plugins/dashboard/public/application/embeddable/viewport/print_media @elastic/kibana-app-services
@@ -141,6 +141,8 @@
/x-pack/test/functional/es_archives/uptime @elastic/uptime
/x-pack/test/functional/services/uptime @elastic/uptime
/x-pack/test/api_integration/apis/uptime @elastic/uptime
+/x-pack/plugins/observability/public/components/shared/exploratory_view @elastic/uptime
+
# Client Side Monitoring / Uptime (lives in APM directories but owned by Uptime)
/x-pack/plugins/apm/public/application/uxApp.tsx @elastic/uptime
diff --git a/.i18nrc.json b/.i18nrc.json
index a5d1b36ede73d..0ab8e6b490a12 100644
--- a/.i18nrc.json
+++ b/.i18nrc.json
@@ -77,6 +77,7 @@
"src/plugins/vis_types/timelion"
],
"uiActions": "src/plugins/ui_actions",
+ "uiActionsEnhanced": "src/plugins/ui_actions_enhanced",
"uiActionsExamples": "examples/ui_action_examples",
"usageCollection": "src/plugins/usage_collection",
"utils": "packages/kbn-securitysolution-utils/src",
diff --git a/dev_docs/contributing/how_we_use_github.mdx b/dev_docs/contributing/how_we_use_github.mdx
index a45cad425a0e5..339eebc89197b 100644
--- a/dev_docs/contributing/how_we_use_github.mdx
+++ b/dev_docs/contributing/how_we_use_github.mdx
@@ -131,7 +131,7 @@ would be useful to all teams, talk to your team or tech lead about getting it ad
### Team labels
-Examples: `Team:Security`, `Team:Operations`.
+Examples: `Team:Security`, `Team:Operations`, `Team:Docs`.
These labels map the issue to the team that owns the particular area. Part of the responsibilities of
(todo) is to ensure every issue has at least a team or a project
@@ -178,3 +178,37 @@ it might mean the version the team is tentatively planning to merge a fix.
Consult the owning team if you have a question about how a version label is meant
to be used on an issue.
+
+### Issue type and workflow labels
+
+These labels categorize the type of work. For example:
+
+- `blocked`: Indicates the issue is currently blocked
+- `blocker`: Indicates that we should not release the product at the next
+ proposed version without the issue being resolved
+- `bug`: Indicates an unexpected problem or unintended behavior
+- `discuss`: Indicates that an issue is a discussion topic
+- `docs`/`documentation`: Indicates improvements or additions to documentation
+- `enhancement`: Indicates new feature or enhancement requests
+- `meta`: Indicates that the issue tracks tasks related to a project
+- `triage-needed`: Indicates that someone from the area team needs to investigate.
+- `needs_team`: Indicates that issue is missing area team label. All issues should be assigned to one or more area teams for follow up. This label is assigned automatically and removed automatically once a team label is added.
+
+These labels affect whether your PR appears in the release notes (that is to say,
+it's notable and affects our users) and which section it appears in. For example:
+
+- `release_note:breaking`: Specifies a breaking change and adds the PR to the Breaking changes section in the release notes
+- `release_note:deprecation`: Specifies a deprecated feature and adds the PR to the Deprecations section in the release notes
+- `release_note:enhancement`: Specifies a feature enhancement and adds the PR to the Enhancements section in the release notes
+- `release_note:feature`: Specifies a new feature and adds the PR to the Features section in the release notes
+- `release_note:fix`: Specifies a bug fix and adds the PR to the Bug fixes section in the release notes
+- `release_node:plugin_api_changes`: Specifies a changes to the plugin API and adds the PR to the Plugin API changes page in the Developer Guide
+- `release_note:skip`: Omits the PR from release notes
+
+These labels related to backporting PRs:
+
+- `auto-backport`: Automatically backport this PR (to the branches related to
+ version labels) after it's merged
+- `backport`: This PR was backported
+- `backport:skip`: This PR does not require backporting
+
diff --git a/dev_docs/getting_started/troubleshooting.mdx b/dev_docs/getting_started/troubleshooting.mdx
index db52830bbae4f..b224a3200eefb 100644
--- a/dev_docs/getting_started/troubleshooting.mdx
+++ b/dev_docs/getting_started/troubleshooting.mdx
@@ -40,3 +40,12 @@ it means you are using a new Elasticsearch feature that will not work in a CCS e
We added this test coverage in version `8.1` because we accidentally broke core Kibana features (for example, when Discover started using the new fields parameter) for our CCS users. CCS is not a corner case and (excluding certain experimental features) Kibana should always work for our CCS users. This setting is our way of ensuring test coverage.
Please reach out to the [Kibana Operations team](https://github.com/orgs/elastic/teams/kibana-operations) if you have further questions.
+
+### Minified React errors
+
+If you experience minified React errors and want to expand them to their full error messages you will currently need to rebuild the `@kbn/ui-shared-deps-npm` package using "development" mode instead of "production", which can be done by modifying the corresponding line in `packages/kbn-ui-shared-deps-npm/webpack.config.js` and make sure to run `yarn kbn bootstrap` afterwards:
+
+```diff
+- mode: 'production',
++ mode: 'development',
+```
diff --git a/dev_docs/operations/operations_landing.mdx b/dev_docs/operations/operations_landing.mdx
index 40c3ae3560768..95fb4ceb2af09 100644
--- a/dev_docs/operations/operations_landing.mdx
+++ b/dev_docs/operations/operations_landing.mdx
@@ -28,6 +28,7 @@ layout: landing
{ pageId: "kibDevDocsOpsBabelPluginSyntheticPackages" },
{ pageId: "kibDevDocsOpsUiSharedDepsNpm" },
{ pageId: "kibDevDocsOpsUiSharedDepsSrc" },
+ { pageId: "kibDevDocsOpsPluginDiscovery" },
]}
/>
@@ -50,5 +51,7 @@ layout: landing
{ pageId: "kibDevDocsOpsAmbientUiTypes" },
{ pageId: "kibDevDocsOpsTestSubjSelector" },
{ pageId: "kibDevDocsOpsBazelRunner" },
+ { pageId: "kibDevDocsOpsCliDevMode" },
+ { pageId: "kibDevDocsOpsEs" },
]}
/>
\ No newline at end of file
diff --git a/dev_docs/tutorials/advanced_settings.mdx b/dev_docs/tutorials/advanced_settings.mdx
index 4e5e208fc68f0..1ca925e24f54a 100644
--- a/dev_docs/tutorials/advanced_settings.mdx
+++ b/dev_docs/tutorials/advanced_settings.mdx
@@ -286,3 +286,13 @@ export const migrations = {
};
```
[1] Since all `uiSettings` migrations are added to the same migration function, while not required, grouping settings by team is good practice.
+
+### Creating Transforms
+
+If you have need to make a change that isn't possible in a saved object migration function (for example, you need to find other saved
+objects), you can create a transform function instead. This will be applied when a `config` saved object is first created, and/or when it is
+first upgraded. Note that you might need to add an extra attribute to verify that this transform has already been applied so it doesn't get
+applied again in the future.
+
+For example, we needed to transform the `defaultIndex` attribute, and we added an extra `isDefaultIndexMigrated` attribute for this purpose.
+See `src/core/server/ui_settings/saved_objects/transforms.ts` and [#13339](https://github.com/elastic/kibana/pull/133339) for an example.
diff --git a/docs/api/actions-and-connectors.asciidoc b/docs/api/actions-and-connectors.asciidoc
index f8d286e00b856..b35fa57668859 100644
--- a/docs/api/actions-and-connectors.asciidoc
+++ b/docs/api/actions-and-connectors.asciidoc
@@ -28,7 +28,7 @@ include::actions-and-connectors/delete.asciidoc[leveloffset=+1]
include::actions-and-connectors/get.asciidoc[leveloffset=+1]
include::actions-and-connectors/get_all.asciidoc[leveloffset=+1]
include::actions-and-connectors/list.asciidoc[]
-include::actions-and-connectors/update.asciidoc[]
+include::actions-and-connectors/update.asciidoc[leveloffset=+1]
include::actions-and-connectors/execute.asciidoc[]
include::actions-and-connectors/legacy/index.asciidoc[]
include::actions-and-connectors/legacy/get.asciidoc[]
diff --git a/docs/api/actions-and-connectors/create.asciidoc b/docs/api/actions-and-connectors/create.asciidoc
index d5208b9debfe9..b8334573d2330 100644
--- a/docs/api/actions-and-connectors/create.asciidoc
+++ b/docs/api/actions-and-connectors/create.asciidoc
@@ -6,7 +6,6 @@
Creates a connector.
-[discrete]
[[create-connector-api-request]]
=== {api-request-title}
@@ -14,14 +13,12 @@ Creates a connector.
`POST :/s//api/actions/connector`
-[discrete]
=== {api-prereq-title}
You must have `all` privileges for the *Actions and Connectors* feature in the
*Management* section of the
<>.
-[discrete]
[[create-connector-api-path-params]]
=== {api-path-parms-title}
@@ -29,34 +26,88 @@ You must have `all` privileges for the *Actions and Connectors* feature in the
(Optional, string) An identifier for the space. If `space_id` is not provided
in the URL, the default space is used.
-[discrete]
+[role="child_attributes"]
[[create-connector-api-request-body]]
=== {api-request-body-title}
-`name`::
- (Required, string) The display name for the connector.
+`config`::
+(Required, object) The configuration for the connector. Configuration properties
+vary depending on the connector type. For example:
++
+--
+// tag::connector-config[]
+.Index connectors
+[%collapsible%open]
+====
+`executionTimeField`::
+(Optional, string) Specifies a field that will contain the time the alert
+condition was detected. The default value is `null`.
+
+`index`::
+(Required, string) The {es} index to be written to.
+
+`refresh`::
+(Optional, boolean) The {ref}/docs-refresh.html[refresh] policy for the write
+request. The default value is `false`.
+
+For more information, refer to
+{kibana-ref}/index-action-type.html[Index connector and action].
+====
+
+.{jira} connectors
+[%collapsible%open]
+====
+
+`apiUrl`::
+(Required, string) The {jira} instance URL.
+
+`projectKey`::
+(Required, string) The {jira} project key.
+
+For more information, refer to
+{kibana-ref}/jira-action-type.html[{jira} connector and action].
+====
+
+For more configuration properties, refer to <>.
+// end::connector-config[]
+--
`connector_type_id`::
- (Required, string) The connector type ID for the connector.
+(Required, string) The connector type ID for the connector.
-`config`::
- (Required, object) The configuration for the connector. Configuration properties vary depending on
- the connector type. For information about the configuration properties, refer to <>.
+`name`::
+(Required, string) The display name for the connector.
`secrets`::
- (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 <>.
+(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.
+--
++
+--
+// tag::connector-secrets[]
+.{jira} connectors
+[%collapsible%open]
+====
+`apiToken`::
+(Required, string) The {jira} API authentication token for HTTP basic
+authentication.
+
+`email`::
+(Required, string) The account email for HTTP Basic authentication.
+====
+// end::connector-secrets[]
+--
-[discrete]
[[create-connector-api-request-codes]]
=== {api-response-codes-title}
`200`::
Indicates a successful call.
-[discrete]
[[create-connector-api-example]]
=== {api-examples-title}
diff --git a/docs/api/actions-and-connectors/execute.asciidoc b/docs/api/actions-and-connectors/execute.asciidoc
index e830c9b4bbf88..2ddd311836281 100644
--- a/docs/api/actions-and-connectors/execute.asciidoc
+++ b/docs/api/actions-and-connectors/execute.asciidoc
@@ -7,14 +7,24 @@
Executes a connector by ID.
[[execute-connector-api-request]]
-==== Request
+==== {api-request-title}
`POST :/api/actions/connector//_execute`
`POST :/s//api/actions/connector//_execute`
+[discrete]
+=== {api-prereq-title}
+
+You must have `read` privileges for the *Actions and Connectors* feature in the
+*Management* section of the
+<>.
+
+If you use an index connector, you must also have `all`, `create`, `index`, or
+`write` {ref}/security-privileges.html[indices privileges].
+
[[execute-connector-api-params]]
-==== Path parameters
+==== {api-path-parms-title}
`id`::
(Required, string) The ID of the connector.
@@ -23,24 +33,26 @@ Executes a connector by ID.
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
[[execute-connector-api-request-body]]
-==== Request body
+==== {api-request-body-title}
`params`::
(Required, object) The parameters of the connector. Parameter properties vary depending on
the connector type. For information about the parameter properties, refer to <>.
[[execute-connector-api-codes]]
-==== Response code
+==== {api-response-codes-title}
`200`::
Indicates a successful call.
[[execute-connector-api-example]]
-==== Example
+==== {api-examples-title}
+
+Run an index connector:
[source,sh]
--------------------------------------------------
-$ curl -X POST api/actions/connector/c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad/_execute -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
+POST api/actions/connector/c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad/_execute
{
"params": {
"documents": [
@@ -51,7 +63,7 @@ $ curl -X POST api/actions/connector/c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad/_execu
}
]
}
-}'
+}
--------------------------------------------------
// KIBANA
@@ -62,7 +74,7 @@ The API returns the following:
{
"status": "ok",
"data": {
- "took": 197,
+ "took": 10,
"errors": false,
"items": [
{
@@ -76,7 +88,7 @@ The API returns the following:
"successful": 1,
"failed": 0
},
- "_seq_no": 0,
+ "_seq_no": 7,
"_primary_term": 1,
"status": 201
}
diff --git a/docs/api/actions-and-connectors/list.asciidoc b/docs/api/actions-and-connectors/list.asciidoc
index bd1ccb777b9ae..a2542c6ca3aaf 100644
--- a/docs/api/actions-and-connectors/list.asciidoc
+++ b/docs/api/actions-and-connectors/list.asciidoc
@@ -7,30 +7,37 @@
Retrieves a list of all connector types.
[[list-connector-types-api-request]]
-==== Request
+==== {api-request-title}
`GET :/api/actions/connector_types`
`GET :/s//api/actions/connector_types`
+
+[discrete]
+=== {api-prereq-title}
+
+You do not need any <> to
+run this API.
+
[[list-connector-types-api-path-params]]
-==== Path parameters
+==== {api-path-parms-title}
`space_id`::
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
[[list-connector-types-api-codes]]
-==== Response code
+==== {api-response-codes-title}
`200`::
Indicates a successful call.
[[list-connector-types-api-example]]
-==== Example
+==== {api-examples-title}
[source,sh]
--------------------------------------------------
-$ curl -X GET api/actions/connector_types
+GET api/actions/connector_types
--------------------------------------------------
// KIBANA
@@ -45,7 +52,7 @@ The API returns the following:
"minimum_license_required": "gold", <3>
"enabled": false, <4>
"enabled_in_config": true, <5>
- "enabled_in_license": false <6>
+ "enabled_in_license": true <6>
},
{
"id": ".index",
@@ -54,14 +61,13 @@ The API returns the following:
"enabled": true,
"enabled_in_config": true,
"enabled_in_license": true
- }
+ },
+ ...
]
--------------------------------------------------
-
-
<1> `id` - The unique ID of the connector type.
<2> `name` - The name of the connector type.
<3> `minimum_license_required` - The license required to use the connector type.
<4> `enabled` - Specifies if the connector type is enabled or disabled in {kib}.
-<5> `enabled_in_config` - Specifies if the connector type is enabled or enabled in the {kib} .yml file.
+<5> `enabled_in_config` - Specifies if the connector type is enabled or enabled in the {kib} `.yml` file.
<6> `enabled_in_license` - Specifies if the connector type is enabled or disabled in the license.
diff --git a/docs/api/actions-and-connectors/update.asciidoc b/docs/api/actions-and-connectors/update.asciidoc
index 7ccb10714f474..58056cb8085f9 100644
--- a/docs/api/actions-and-connectors/update.asciidoc
+++ b/docs/api/actions-and-connectors/update.asciidoc
@@ -1,20 +1,27 @@
[[update-connector-api]]
-=== Update connector API
+== Update connector API
++++
Update connector
++++
-Updates the attributes for an existing connector.
+Updates the attributes for a connector.
[[update-connector-api-request]]
-==== Request
+=== {api-request-title}
`PUT :/api/actions/connector/`
`PUT :/s//api/actions/connector/`
+[discrete]
+=== {api-prereq-title}
+
+You must have `all` privileges for the *Actions and Connectors* feature in the
+*Management* section of the
+<>.
+
[[update-connector-api-params]]
-==== Path parameters
+=== {api-path-parms-title}
`id`::
(Required, string) The ID of the connector.
@@ -22,36 +29,49 @@ 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.
+[role="child_attributes"]
[[update-connector-api-request-body]]
-==== Request body
-
-`name`::
- (Required, string) The new name of the connector.
+=== {api-request-body-title}
`config`::
- (Required, object) The new connector configuration. Configuration properties vary depending on the connector type. For information about the configuration properties, refer to <>.
+(Required, object) The new connector configuration. Configuration properties
+vary depending on the connector type. For example:
++
+--
+include::create.asciidoc[tag=connector-config]
+--
+
+`name`::
+(Required, string) The new name of the 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 <>.
+(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
+<>.
++
+--
+include::create.asciidoc[tag=connector-secrets]
+--
[[update-connector-api-codes]]
-==== Response code
+=== {api-response-codes-title}
`200`::
Indicates a successful call.
[[update-connector-api-example]]
-==== Example
+=== {api-examples-title}
[source,sh]
--------------------------------------------------
-$ curl -X PUT api/actions/connector/c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
+PUT api/actions/connector/c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad
{
"name": "updated-connector",
"config": {
"index": "updated-index"
}
-}'
+}
--------------------------------------------------
// KIBANA
diff --git a/docs/api/cases/cases-api-create.asciidoc b/docs/api/cases/cases-api-create.asciidoc
index b39125cf7538e..402521a4c31e7 100644
--- a/docs/api/cases/cases-api-create.asciidoc
+++ b/docs/api/cases/cases-api-create.asciidoc
@@ -162,13 +162,9 @@ categorize cases. It can be an empty array.
--------------------------------------------------
POST api/cases
{
- "description": "James Bond clicked on a highly suspicious email
- banner advertising cheap holidays for underpaid civil servants.",
- "title": "This case will self-destruct in 5 seconds",
- "tags": [
- "phishing",
- "social engineering"
- ],
+ "description": "A case description.",
+ "title": "Case title 1",
+ "tags": [ "tag 1" ],
"connector": {
"id": "131d4448-abe0-4789-939d-8ef60680b498",
"name": "My connector",
@@ -182,7 +178,7 @@ POST api/cases
"settings": {
"syncAlerts": true
},
- "owner": "securitySolution"
+ "owner": "cases"
}
--------------------------------------------------
// KIBANA
@@ -198,26 +194,22 @@ the case identifier, version, and creation time. For example:
"comments": [],
"totalComment": 0,
"totalAlerts": 0,
- "title": "This case will self-destruct in 5 seconds",
- "tags": [
- "phishing",
- "social engineering",
- "bubblegum"
- ],
+ "title": "Case title 1",
+ "tags": [ "tag 1" ],
"settings": {
"syncAlerts": true
},
- "owner": "securitySolution",
- "description": "James Bond clicked on a highly suspicious email banner advertising cheap holidays for underpaid civil servants. Operation bubblegum is active. Repeat - operation bubblegum is now active",
+ "owner": "cases",
+ "description": "A case description.",
"duration": null,
"severity": "low",
"closed_at": null,
"closed_by": null,
"created_at": "2022-05-13T09:16:17.416Z",
"created_by": {
- "email": "ahunley@imf.usa.gov",
- "full_name": "Alan Hunley",
- "username": "ahunley"
+ "email": null,
+ "full_name": null,
+ "username": "elastic"
},
"status": "open",
"updated_at": null,
diff --git a/docs/api/cases/cases-api-find-cases.asciidoc b/docs/api/cases/cases-api-find-cases.asciidoc
index c643bc64cb982..d7ae5fed35b0f 100644
--- a/docs/api/cases/cases-api-find-cases.asciidoc
+++ b/docs/api/cases/cases-api-find-cases.asciidoc
@@ -95,12 +95,12 @@ Defaults to `desc`.
=== {api-examples-title}
-Retrieve the first five cases with the `phishing` tag, in ascending order by
+Retrieve the first five cases with the `tag-1` tag, in ascending order by
last update time:
[source,sh]
--------------------------------------------------
-GET api/cases/_find?page=1&perPage=5&sortField=updatedAt&sortOrder=asc&tags=phishing
+GET api/cases/_find?page=1&perPage=5&sortField=updatedAt&sortOrder=asc&tags=tag-1
--------------------------------------------------
// KIBANA
@@ -120,11 +120,11 @@ The API returns a JSON object listing the retrieved cases. For example:
"totalComment": 1,
"totalAlerts": 0,
"title": "Case title",
- "tags": [ "phishing" ],
+ "tags": [ "tag-1" ],
"description": "Case description",
"settings": { "syncAlerts": true },
"owner": "securitySolution",
- "duration": null,
+ "duration": null, <1>
"severity": "low",
"closed_at": null,
"closed_by": null,
@@ -155,3 +155,7 @@ The API returns a JSON object listing the retrieved cases. For example:
"count_closed_cases": 0
}
--------------------------------------------------
+<1> Duration represents the elapsed time from the creation of the case to its
+closure (in seconds). If the case has not been closed, the duration is set to
+`null`. If the case was closed after less than half a second, the duration is
+rounded down to zero.
\ No newline at end of file
diff --git a/docs/api/cases/cases-api-get-case.asciidoc b/docs/api/cases/cases-api-get-case.asciidoc
index a3adc90fe09bf..70cc7f5bab60c 100644
--- a/docs/api/cases/cases-api-get-case.asciidoc
+++ b/docs/api/cases/cases-api-get-case.asciidoc
@@ -92,11 +92,15 @@ The API returns a JSON object with the retrieved case. For example:
},
"owner": "securitySolution",
"severity": "low",
- "duration": null,
+ "duration": null, <1>
"tags": [
"phishing",
"social engineering",
"bubblegum"
]
}
---------------------------------------------------
\ No newline at end of file
+--------------------------------------------------
+<1> Duration represents the elapsed time from the creation of the case to its
+closure (in seconds). If the case has not been closed, the duration is set to
+`null`. If the case was closed after less than half a second, the duration is
+rounded down to zero.
\ No newline at end of file
diff --git a/docs/api/cases/cases-api-get-cases-by-alert.asciidoc b/docs/api/cases/cases-api-get-cases-by-alert.asciidoc
index 3bd2e8debb3cd..01aec7a7e4c77 100644
--- a/docs/api/cases/cases-api-get-cases-by-alert.asciidoc
+++ b/docs/api/cases/cases-api-get-cases-by-alert.asciidoc
@@ -61,12 +61,8 @@ For example:
--------------------------------------------------
[
{
- "id": "8af6ac20-74f6-11ea-b83a-553aecdb28b6",
- "title": "Case 1"
- },
- {
- "id": "a18b38a0-71b0-11ea-a0b2-c51ea50a58e2",
- "title": "Case 2"
+ "id": "06116b80-e1c3-11ec-be9b-9b1838238ee6",
+ "title":"security_case"
}
]
--------------------------------------------------
\ No newline at end of file
diff --git a/docs/api/cases/cases-api-get-configuration.asciidoc b/docs/api/cases/cases-api-get-configuration.asciidoc
index 778e95949e3f5..46cb11dc63b03 100644
--- a/docs/api/cases/cases-api-get-configuration.asciidoc
+++ b/docs/api/cases/cases-api-get-configuration.asciidoc
@@ -44,7 +44,7 @@ read.
[source,sh]
--------------------------------------------------
-GET api/cases/configure?owner=securitySolution
+GET api/cases/configure?owner=cases
--------------------------------------------------
// KIBANA
@@ -54,19 +54,19 @@ The API returns the following type of information:
--------------------------------------------------
[
{
- "owner": "securitySolution",
"closure_type": "close-by-user",
- "created_at": "2020-03-30T13:31:38.083Z",
+ "owner": "cases",
+ "created_at": "2022-06-01T17:07:17.767Z",
"created_by": {
- "email": "admin@hms.gov.uk",
- "full_name": "Mr Admin",
- "username": "admin"
+ "email": "null",
+ "full_name": "null",
+ "username": "elastic"
},
"updated_at": null,
"updated_by": null,
"connector": {
"id": "131d4448-abe0-4789-939d-8ef60680b498",
- "name": "my-jira",
+ "name": "my-jira-connector",
"type": ".jira",
"fields": null
},
diff --git a/docs/api/cases/cases-api-set-configuration.asciidoc b/docs/api/cases/cases-api-set-configuration.asciidoc
index 6a7a7c26c66d2..89ec6f0600717 100644
--- a/docs/api/cases/cases-api-set-configuration.asciidoc
+++ b/docs/api/cases/cases-api-set-configuration.asciidoc
@@ -109,9 +109,9 @@ POST api/cases/configure
{
"owner": "cases",
"connector": {
- "id": "131d4448-abe0-4789-939d-8ef60680b498",
- "name": "my-serviceNow",
- "type": ".servicenow",
+ "id": "5e656730-e1ca-11ec-be9b-9b1838238ee6",
+ "name": "my-jira-connector",
+ "type": ".jira",
"fields": null,
},
"closure_type": "close-by-user"
@@ -123,41 +123,41 @@ The API returns the following response:
[source,json]
--------------------------------------------------
{
- "owner": "cases",
"closure_type": "close-by-user",
- "created_at": "2022-04-02T01:09:02.303Z",
+ "owner": "cases",
+ "created_at": "2022-06-01T17:07:17.767Z",
"created_by": {
- "email": "moneypenny@hms.gov.uk",
- "full_name": "Ms Moneypenny",
- "username": "moneypenny"
+ "username": "elastic",
+ "email": null,
+ "full_name": null
},
"updated_at": null,
"updated_by": null,
"connector": {
- "id": "131d4448-abe0-4789-939d-8ef60680b498",
- "name": "my-serviceNow",
- "type": ".servicenow",
- "fields": null,
+ "id": "5e656730-e1ca-11ec-be9b-9b1838238ee6",
+ "name": "my-jira-connector",
+ "type": ".jira",
+ "fields": null
},
"mappings": [
{
- "source": "title",
- "target": "short_description",
+ "source": "title",
+ "target": "summary",
"action_type": "overwrite"
},
{
- "source":"description",
- "target":"description",
- "action_type":"overwrite"
+ "source": "description",
+ "target": "description",
+ "action_type": "overwrite"
},
{
- "source":"comments",
- "target":"work_notes",
- "action_type":"append"
+ "source": "comments",
+ "target": "comments",
+ "action_type": "append"
}
],
- "version": "WzE3NywxXQ==",
+ "version": "WzIwNzMsMV0=",
"error": null,
- "id": "7349772f-421a-4de3-b8bb-2d9b22ccee30",
+ "id": "4a97a440-e1cd-11ec-be9b-9b1838238ee6"
}
--------------------------------------------------
diff --git a/docs/api/cases/cases-api-update-configuration.asciidoc b/docs/api/cases/cases-api-update-configuration.asciidoc
index cf7d2ea7d8cfd..c1dcb2a71e57c 100644
--- a/docs/api/cases/cases-api-update-configuration.asciidoc
+++ b/docs/api/cases/cases-api-update-configuration.asciidoc
@@ -101,19 +101,19 @@ The API returns the following:
[source,json]
--------------------------------------------------
{
- "closure_type": "close-by-user",
+ "closure_type": "close-by-pushing",
"owner": "cases",
- "created_at": "2022-04-06T20:57:40.746Z",
+ "created_at": "2022-06-01T17:07:17.767Z",
"created_by": {
- "email": "admin@hms.gov.uk",
- "full_name": "Ms Admin",
- "username": "admin"
+ "email": "null",
+ "full_name": "null",
+ "username": "elastic"
},
- "updated_at": "2022-04-12T22:41:09.262Z",
+ "updated_at": "2022-06-01T19:58:48.169Z",
"updated_by": {
- "email": "admin@hms.gov.uk",
- "full_name": "Ms Admin",
- "username": "admin"
+ "email": "null",
+ "full_name": "null",
+ "username": "elastic"
},
"connector": {
"id": "none",
diff --git a/docs/api/cases/cases-api-update.asciidoc b/docs/api/cases/cases-api-update.asciidoc
index ea33394a6ee63..687622cce8ddd 100644
--- a/docs/api/cases/cases-api-update.asciidoc
+++ b/docs/api/cases/cases-api-update.asciidoc
@@ -159,7 +159,8 @@ and `open`.
(Optional, string) A title for the case.
`version`::
-(Required, string) The current version of the case. To determine this value, use <> or <>.
+(Required, string) The current version of the case. To determine this value, use
+<> or <>.
====
=== {api-response-codes-title}
@@ -190,15 +191,8 @@ PATCH api/cases
"parent": null
}
},
- "description": "James Bond clicked on a highly suspicious email
- banner advertising cheap holidays for underpaid civil servants.
- Operation bubblegum is active. Repeat - operation bubblegum is
- now active!",
- "tags": [
- "phishing",
- "social engineering",
- "bubblegum"
- ],
+ "description": "A new description.",
+ "tags": [ "tag-1", "tag-2" ],
"settings": {
"syncAlerts": true
}
@@ -219,33 +213,29 @@ The API returns the updated case with a new `version` value. For example:
"comments": [],
"totalComment": 0,
"totalAlerts": 0,
- "title": "This case will self-destruct in 5 seconds",
- "tags": [
- "phishing",
- "social engineering",
- "bubblegum"
- ],
+ "title": "Case title 1",
+ "tags": [ "tag-1", "tag-2" ],
"settings": {
"syncAlerts": true
},
- "owner": "securitySolution",
- "description": "James Bond clicked on a highly suspicious email banner advertising cheap holidays for underpaid civil servants. Operation bubblegum is active. Repeat - operation bubblegum is now active!",
+ "owner": "cases",
+ "description": "A new description.",
"duration": null,
"severity": "low",
"closed_at": null,
"closed_by": null,
"created_at": "2022-05-13T09:16:17.416Z",
"created_by": {
- "email": "ahunley@imf.usa.gov",
- "full_name": "Alan Hunley",
- "username": "ahunley"
+ "email": null,
+ "full_name": null,
+ "username": "elastic"
},
"status": "open",
"updated_at": "2022-05-13T09:48:33.043Z",
"updated_by": {
- "email": "classified@hms.oo.gov.uk",
- "full_name": "Classified",
- "username": "M"
+ "email": null,
+ "full_name": null,
+ "username": "elastic"
},
"connector": {
"id": "131d4448-abe0-4789-939d-8ef60680b498",
@@ -260,9 +250,9 @@ The API returns the updated case with a new `version` value. For example:
"external_service": {
"external_title": "IS-4",
"pushed_by": {
- "full_name": "Classified",
- "email": "classified@hms.oo.gov.uk",
- "username": "M"
+ "full_name": null,
+ "email": null,
+ "username": "elastic"
},
"external_url": "https://hms.atlassian.net/browse/IS-4",
"pushed_at": "2022-05-13T09:20:40.672Z",
diff --git a/docs/api/data-views.asciidoc b/docs/api/data-views.asciidoc
index d7380cbd97c99..cf9524d4fdf30 100644
--- a/docs/api/data-views.asciidoc
+++ b/docs/api/data-views.asciidoc
@@ -11,6 +11,7 @@ WARNING: Use the data views APIs for managing data views instead of lower-level
The following data views APIs are available:
* Data views
+ ** <> to retrieve a list of data views
** <> to retrieve a single data view
** <> to create data view
** <> to partially updated data view
@@ -27,6 +28,7 @@ The following data views APIs are available:
** <> to partially update an existing runtime field
** <> to delete a runtime field
+include::data-views/get-all.asciidoc[]
include::data-views/get.asciidoc[]
include::data-views/create.asciidoc[]
include::data-views/update.asciidoc[]
diff --git a/docs/api/data-views/get-all.asciidoc b/docs/api/data-views/get-all.asciidoc
new file mode 100644
index 0000000000000..42727c38f6d98
--- /dev/null
+++ b/docs/api/data-views/get-all.asciidoc
@@ -0,0 +1,60 @@
+[[data-views-api-get-all]]
+=== Get all data views API
+++++
+Get all data views
+++++
+
+experimental[] Retrieve a list of all data views.
+
+
+[[data-views-api-get-all-request]]
+==== Request
+
+`GET :/api/data_views`
+
+`GET :/s//api/data_views`
+
+
+[[data-views-api-get-all-codes]]
+==== Response code
+
+`200`::
+Indicates a successful call.
+
+
+[[data-views-api-get-all-example]]
+==== Example
+
+Retrieve the list of data views:
+
+[source,sh]
+--------------------------------------------------
+$ curl -X GET api/data_views
+--------------------------------------------------
+// KIBANA
+
+The API returns a list of data views:
+
+[source,sh]
+--------------------------------------------------
+{
+ "data_view": [
+ {
+ "id": "e9e024f0-d098-11ec-bbe9-c753adcb34bc",
+ "namespaces": [
+ "default"
+ ],
+ "title": "tmp*",
+ "type": "rollup",
+ "typeMeta": {}
+ },
+ {
+ "id": "90943e30-9a47-11e8-b64d-95841ca0b247",
+ "namespaces": [
+ "default"
+ ],
+ "title": "kibana_sample_data_logs"
+ }
+ ]
+}
+--------------------------------------------------
diff --git a/docs/apm/apm-spaces.asciidoc b/docs/apm/apm-spaces.asciidoc
new file mode 100644
index 0000000000000..c43a512768fad
--- /dev/null
+++ b/docs/apm/apm-spaces.asciidoc
@@ -0,0 +1,415 @@
+[role="xpack"]
+[[apm-spaces]]
+=== Control access to APM data
+
+Starting in version 8.2.0, the APM app is <> aware.
+This allows you to separate your data--and access to that data--by team, use case, service environment,
+or any other filter that you choose.
+
+To take advantage of this feature, your APM data needs to be written to different data steams.
+One way to accomplish this is with different namespaces.
+For example, you can send production data to an APM integration with a namespace of `production`,
+while sending staging data to a different APM integration with a namespace of `staging`.
+
+Multiple APM integration instances is not required though. The simplest way to take advantage of this feature
+is by creating filtered aliases. See the guide below for more information.
+
+[float]
+[[apm-spaces-example]]
+=== Guide: Separate staging and production data
+
+This guide will explain how to separate your staging and production data.
+This can be helpful to either remove noise when troubleshooting a production issue,
+or to create more granular access control for certain data.
+
+This guide assumes that you:
+
+* Are sending both staging and production APM data to an {es} cluster.
+* Have configured the `environment` variable in your APM agent configurations.
+This variable sets the `service.environment` field in APM documents.
+You should have documents where `service.environment: production` and `service.environment: staging`.
+If this field is empty, see <> to learn how to set this value.
+
+[float]
+==== Step 1: Create filtered aliases
+
+The APM app uses index patterns to query your APM data. An index pattern can match data streams, indices, and/or aliases.
+The default values are:
+
+[options="header"]
+|====
+| Index setting | Default index pattern
+| Error | `logs-apm*`
+| Span/Transaction | `traces-apm*`
+| Metrics | `metrics-apm*`
+|====
+
+NOTE: The default index settings also query the `apm-*` data view.
+This data view matches APM data shipped in earlier versions of APM (prior to v8.0).
+
+Instead of querying the default APM data views, we can create filtered aliases for the APM app to query.
+A filtered alias is a secondary name for a group of data streams that has a user-defined
+filter to limit the documents that the alias can access.
+
+To separate `staging` and `production` APM data, we'd need to create six filtered aliases--three
+aliases for each service environment:
+
+[options="header"]
+|====
+| Index setting | `production` env | `staging` evn
+| Error | `production-logs-apm` | `staging-logs-apm`
+| Span/Transaction | `production-traces-apm` | `staging-traces-apm`
+| Metrics | `production-metrics-apm` | `staging-metrics-apm`
+|====
+
+The `production--apm` aliases will contain a filter that only provides access to documents
+where the `service.environment` is `production`.
+Similarly, the `staging--apm` aliases will contain a filter that only provides access to documents
+where the `service.environment` is `staging`.
+
+To create these six filtered aliases, use the {es} {ref}/indices-aliases.html[Aliases API].
+In {kib}, open **Dev Tools** and run the following POST requests.
+
+[%collapsible%open]
+.`traces-apm*` production alias example
+====
+[source, console]
+----
+POST /_aliases?pretty
+{
+ "actions": [
+ {
+ "add": {
+ "index": "traces-apm*", <1>
+ "alias": "production-traces-apm", <2>
+ "filter": {
+ "term": {
+ "service.environment": {
+ "value": "production" <3>
+ }
+ }
+ }
+ }
+ }
+ ]
+}
+----
+<1> This example matches the APM traces data stream
+<2> The alias must not match the default APM index (`traces-apm*,apm-*`)
+<3> Only match documents where `service.environment: production`
+====
+
+[%collapsible]
+.`logs-apm*` production alias example
+====
+[source, console]
+----
+POST /_aliases?pretty
+{
+ "actions": [
+ {
+ "add": {
+ "index": "logs-apm*", <1>
+ "alias": "production-logs-apm", <2>
+ "filter": {
+ "term": {
+ "service.environment": {
+ "value": "production" <3>
+ }
+ }
+ }
+ }
+ }
+ ]
+}
+----
+<1> This example matches the APM logs data stream
+<2> The alias must not match the default APM index (`logs-apm*,apm-*`)
+<3> Only match documents where `service.environment: production`
+====
+
+[%collapsible]
+.`metrics-apm*` production alias example
+====
+[source, console]
+----
+POST /_aliases?pretty
+{
+ "actions": [
+ {
+ "add": {
+ "index": "metrics-apm*", <1>
+ "alias": "production-metrics-apm", <2>
+ "filter": {
+ "term": {
+ "service.environment": {
+ "value": "production" <3>
+ }
+ }
+ }
+ }
+ }
+ ]
+}
+----
+<1> This example matches the APM metrics data stream
+<2> The alias must not match the default APM index (`metrics-apm*,apm-*`)
+<3> Only match documents where `service.environment: production`
+====
+
+[%collapsible]
+.`traces-apm*` staging alias example
+====
+[source, console]
+----
+POST /_aliases?pretty
+{
+ "actions": [
+ {
+ "add": {
+ "index": "traces-apm*", <1>
+ "alias": "staging-traces-apm", <2>
+ "filter": {
+ "term": {
+ "service.environment": {
+ "value": "staging" <3>
+ }
+ }
+ }
+ }
+ }
+ ]
+}
+----
+<1> This example matches the APM traces data stream
+<2> The alias must not match the default APM index (`traces-apm*,apm-*`)
+<3> Only match documents where `service.environment: staging`
+====
+
+[%collapsible]
+.`logs-apm*` staging alias example
+====
+[source, console]
+----
+POST /_aliases?pretty
+{
+ "actions": [
+ {
+ "add": {
+ "index": "logs-apm*", <1>
+ "alias": "staging-logs-apm", <2>
+ "filter": {
+ "term": {
+ "service.environment": {
+ "value": "staging" <3>
+ }
+ }
+ }
+ }
+ }
+ ]
+}
+----
+<1> This example matches the APM logs data stream
+<2> The alias must not match the default APM index (`logs-apm*,apm-*`)
+<3> Only match documents where `service.environment: staging`
+====
+
+[%collapsible]
+.`metrics-apm*` staging alias example
+====
+[source, console]
+----
+POST /_aliases?pretty
+{
+ "actions": [
+ {
+ "add": {
+ "index": "metrics-apm*", <1>
+ "alias": "staging-metrics-apm", <2>
+ "filter": {
+ "term": {
+ "service.environment": {
+ "value": "staging" <3>
+ }
+ }
+ }
+ }
+ }
+ ]
+}
+----
+<1> This example matches the APM metrics data stream
+<2> The alias must not match the default APM index (`metrics-apm*,apm-*`)
+<3> Only match documents where `service.environment: staging`
+====
+
+[float]
+==== Step 2: Create {kib} spaces
+
+Next, you'll need to create a {Kib} space for each service environment.
+To create these spaces, navigate to **Stack Management** > **Spaces** > **Create a space**.
+For this guide, we've created two Kibana spaces, one named `production` and one named `staging`.
+
+See <> for more information on creating a space.
+
+[float]
+==== Step 3: Update APM index settings in each space
+
+Now we can change the default data views that the APM app queries in each space.
+
+Open the APM app and navigate to **Settings** > **Indices**.
+Use the table below to update your settings for each space.
+The values in each column match the names of the filtered aliases we created in step one.
+
+[options="header"]
+|====
+| Index setting | `production` space | `staging` space
+| Error indices | `production-logs-apm` | `staging-logs-apm`
+| Span indices | `production-traces-apm` | `staging-traces-apm`
+| Transaction indices | `production-traces-apm` | `staging-traces-apm`
+| Metrics indices | `production-metrics-apm` | `staging-metrics-apm`
+|====
+
+[role="screenshot"]
+image::settings/images/apm-settings.png[APM app settings in Kibana]
+
+[float]
+==== Step 4: Create {kib} access roles
+
+In {kib}, navigate to **Stack Management** > **Roles** and click **Create role**.
+
+You'll need to create two roles: one for `staging` users (we'll call this role `staging_apm_viewer`)
+and one for `production` users (we'll call this role `production_apm_viewer`).
+
+Using the table below, assign each role the following privileges:
+
+[options="header"]
+|====
+| Privileges | `production_apm_viewer` | `staging_apm_viewer`
+| Index privileges | index: `production-*-apm`, privilege: `read` | index: `staging-*-apm`, privilege: `read`
+| Kibana privileges | space: `production`, feature privileges: `APM and User Experience: read` | space: `staging`, feature privileges: `APM and User Experience: read`
+|====
+
+[role="screenshot"]
+image::./images/apm-roles-config.png[APM role config example]
+
+Alternatively, you can use the
+{es} {ref}/security-api-put-role.html[Create or update roles API]:
+
+[%collapsible%open]
+.Create a `production_apm_viewer` role
+====
+This request creates a `production_apm_viewer` role:
+
+[source, console]
+----
+POST /_security/role/production_apm_viewer
+{
+ "cluster": [ ],
+ "indices": [
+ {
+ "names": ["production-*-apm"], <1>
+ "privileges": ["read"]
+ }
+ ],
+ "applications": [
+ {
+ "application" : "kibana-.kibana",
+ "privileges" : [
+ "feature_apm.read" <2>
+ ],
+ "resources" : [
+ "space:production" <3>
+ ]
+ }
+ ]
+}
+----
+<1> This data view matches all of the production aliases created in step one.
+<2> Assigns `read` privileges for the APM and User Experience apps.
+<3> Provides access to the space named `production`.
+====
+
+[%collapsible]
+.Create a `staging_apm_viewer` role
+====
+This request creates a `staging_apm_viewer` role:
+
+[source, console]
+----
+POST /_security/role/staging_apm_viewer
+{
+ "cluster": [ ],
+ "indices": [
+ {
+ "names": ["staging-*-apm"], <1>
+ "privileges": ["read"]
+ }
+ ],
+ "applications": [
+ {
+ "application" : "kibana-.kibana",
+ "privileges" : [
+ "feature_apm.read" <2>
+ ],
+ "resources" : [
+ "space:staging" <3>
+ ]
+ }
+ ]
+}
+----
+<1> This data view matches all of the staging aliases created in step one.
+<2> Assigns `read` privileges for the APM and User Experience apps.
+<3> Provides access to the space named `staging`.
+====
+
+[float]
+==== Step 5: Assign users to roles
+
+The last thing to do is assign users to the newly created roles above.
+Users will only have access to the data within the spaces that they are granted.
+
+For information on how to create users and assign them roles with the {kib} UI,
+see <>.
+
+Alternatively, you can use the
+{es} {ref}/security-api-put-user.html[Create or update users API].
+
+This example creates a new user and assigns them the `production_apm_viewer` role created in the previous step.
+This user will only have access to the production space and data with a `service.environment` of `production`.
+Remember to change the `password`, `full_name`, and `email` fields.
+
+[source, console]
+----
+POST /_security/user/production-apm-user
+{
+ "password" : "l0ng-r4nd0m-p@ssw0rd",
+ "roles" : [ "production_apm_viewer" ], <1>
+ "full_name" : "Jane Production Smith",
+ "email" : "janesmith@example.com"
+}
+----
+<1> Assigns the previously created `production_apm_viewer` role.
+
+This example creates a new user and assigns them the `staging_apm_viewer` role created in the previous step.
+This user will only have access to the staging space and data with a `service.environment` of `staging`.
+Remember to change the `password`, `full_name`, and `email` fields.
+
+[source, console]
+----
+POST /_security/user/staging-apm-user
+{
+ "password" : "l0ng-r4nd0m-p@ssw0rd",
+ "roles" : [ "staging_apm_viewer" ], <1>
+ "full_name" : "John Staging Doe",
+ "email" : "johndoe@example.com"
+}
+----
+<1> Assigns the previously created `staging_apm_viewer` role.
+
+[float]
+==== Step 6: Marvel
+
+That's it! Head back to the APM app and marvel at your space-specific data.
diff --git a/docs/apm/how-to-guides.asciidoc b/docs/apm/how-to-guides.asciidoc
index b4e49a69d5a7e..b634c937588b0 100644
--- a/docs/apm/how-to-guides.asciidoc
+++ b/docs/apm/how-to-guides.asciidoc
@@ -6,6 +6,7 @@ Learn how to perform common APM app tasks.
* <>
+* <>
* <>
* <>
* <>
@@ -17,6 +18,8 @@ Learn how to perform common APM app tasks.
include::agent-configuration.asciidoc[]
+include::apm-spaces.asciidoc[]
+
include::apm-alerts.asciidoc[]
include::custom-links.asciidoc[]
diff --git a/docs/apm/images/apm-integration-config.png b/docs/apm/images/apm-integration-config.png
new file mode 100644
index 0000000000000..7ff5cb5e9d0ba
Binary files /dev/null and b/docs/apm/images/apm-integration-config.png differ
diff --git a/docs/apm/images/apm-roles-config.png b/docs/apm/images/apm-roles-config.png
new file mode 100644
index 0000000000000..ebd992abe9303
Binary files /dev/null and b/docs/apm/images/apm-roles-config.png differ
diff --git a/docs/apm/images/apm-settings.png b/docs/apm/images/apm-settings.png
index 2201ed5fcaa72..2c8ebace287b8 100644
Binary files a/docs/apm/images/apm-settings.png and b/docs/apm/images/apm-settings.png differ
diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc
index 837e8845ec542..919727dfe8625 100644
--- a/docs/developer/plugin-list.asciidoc
+++ b/docs/developer/plugin-list.asciidoc
@@ -291,6 +291,10 @@ In general this plugin provides:
- Exposing a context menu for the user to choose the appropriate action when there are multiple actions attached to a single trigger.
+|{kib-repo}blob/{branch}/src/plugins/ui_actions_enhanced/README.md[uiActionsEnhanced]
+|Registers commercially licensed generic actions like per panel time range and contains some code that supports drilldown work.
+
+
|{kib-repo}blob/{branch}/src/plugins/unified_search/README.md[unifiedSearch]
|Contains all the components of Kibana's unified search experience. Specifically:
@@ -649,10 +653,6 @@ For adding localizations and instrument a ui to support translated content, see
As a developer you can reuse and extend built-in alerts and actions UI functionality:
-|{kib-repo}blob/{branch}/x-pack/plugins/ui_actions_enhanced/README.md[uiActionsEnhanced]
-|Registers commercially licensed generic actions like per panel time range and contains some code that supports drilldown work.
-
-
|{kib-repo}blob/{branch}/x-pack/plugins/upgrade_assistant/README.md[upgradeAssistant]
|Upgrade Assistant helps users prepare their Stack for being upgraded to the next major. It will only be enabled on the last minor before the next major release. This is controlled via the config: xpack.upgrade_assistant.readonly (#101296).
diff --git a/docs/development/core/public/kibana-plugin-core-public.chromehelpmenuactions.hidehelpmenu.md b/docs/development/core/public/kibana-plugin-core-public.chromehelpmenuactions.hidehelpmenu.md
index 9bd8b107b2a0a..bcd67a8fe6f21 100644
--- a/docs/development/core/public/kibana-plugin-core-public.chromehelpmenuactions.hidehelpmenu.md
+++ b/docs/development/core/public/kibana-plugin-core-public.chromehelpmenuactions.hidehelpmenu.md
@@ -4,8 +4,6 @@
## ChromeHelpMenuActions.hideHelpMenu property
-The action provides the capability to hide the help menu from within the help extension content components.
-
Signature:
```typescript
diff --git a/docs/development/core/public/kibana-plugin-core-public.chromehelpmenuactions.md b/docs/development/core/public/kibana-plugin-core-public.chromehelpmenuactions.md
index 3cf33deb3db15..f33581cda5879 100644
--- a/docs/development/core/public/kibana-plugin-core-public.chromehelpmenuactions.md
+++ b/docs/development/core/public/kibana-plugin-core-public.chromehelpmenuactions.md
@@ -4,6 +4,7 @@
## ChromeHelpMenuActions interface
+
Signature:
```typescript
@@ -15,3 +16,4 @@ export interface ChromeHelpMenuActions
| Property | Type | Description |
| --- | --- | --- |
| [hideHelpMenu](./kibana-plugin-core-public.chromehelpmenuactions.hidehelpmenu.md) | () => void | |
+
diff --git a/docs/development/core/public/kibana-plugin-core-public.coresetup.injectedmetadata.md b/docs/development/core/public/kibana-plugin-core-public.coresetup.injectedmetadata.md
index b416670a17210..661702f2d466e 100644
--- a/docs/development/core/public/kibana-plugin-core-public.coresetup.injectedmetadata.md
+++ b/docs/development/core/public/kibana-plugin-core-public.coresetup.injectedmetadata.md
@@ -4,17 +4,9 @@
## CoreSetup.injectedMetadata property
-> Warning: This API is now obsolete.
->
-> 8.8.0
->
-
-exposed temporarily until https://github.com/elastic/kibana/issues/41990 done use \*only\* to retrieve config values. There is no way to set injected values in the new platform.
Signature:
```typescript
-injectedMetadata: {
- getInjectedVar: (name: string, defaultValue?: any) => unknown;
- };
+injectedMetadata: InjectedMetadataSetup;
```
diff --git a/docs/development/core/public/kibana-plugin-core-public.coresetup.md b/docs/development/core/public/kibana-plugin-core-public.coresetup.md
index 0298ac904f952..d83fe780a5a6f 100644
--- a/docs/development/core/public/kibana-plugin-core-public.coresetup.md
+++ b/docs/development/core/public/kibana-plugin-core-public.coresetup.md
@@ -22,7 +22,7 @@ export interface CoreSetup Warning: This API is now obsolete.
->
-> 8.8.0
->
-
-exposed temporarily until https://github.com/elastic/kibana/issues/41990 done use \*only\* to retrieve config values. There is no way to set injected values in the new platform.
Signature:
```typescript
-injectedMetadata: {
- getInjectedVar: (name: string, defaultValue?: any) => unknown;
- };
+injectedMetadata: InjectedMetadataStart;
```
diff --git a/docs/development/core/public/kibana-plugin-core-public.corestart.md b/docs/development/core/public/kibana-plugin-core-public.corestart.md
index 34576c4df2e40..19d4c7115417e 100644
--- a/docs/development/core/public/kibana-plugin-core-public.corestart.md
+++ b/docs/development/core/public/kibana-plugin-core-public.corestart.md
@@ -25,7 +25,7 @@ export interface CoreStart
| [fatalErrors](./kibana-plugin-core-public.corestart.fatalerrors.md) | FatalErrorsStart | [FatalErrorsStart](./kibana-plugin-core-public.fatalerrorsstart.md) |
| [http](./kibana-plugin-core-public.corestart.http.md) | HttpStart | [HttpStart](./kibana-plugin-core-public.httpstart.md) |
| [i18n](./kibana-plugin-core-public.corestart.i18n.md) | I18nStart | [I18nStart](./kibana-plugin-core-public.i18nstart.md) |
-| [injectedMetadata](./kibana-plugin-core-public.corestart.injectedmetadata.md) | { getInjectedVar: (name: string, defaultValue?: any) => unknown; } | exposed temporarily until https://github.com/elastic/kibana/issues/41990 done use \*only\* to retrieve config values. There is no way to set injected values in the new platform. |
+| [injectedMetadata](./kibana-plugin-core-public.corestart.injectedmetadata.md) | InjectedMetadataStart | |
| [notifications](./kibana-plugin-core-public.corestart.notifications.md) | NotificationsStart | [NotificationsStart](./kibana-plugin-core-public.notificationsstart.md) |
| [overlays](./kibana-plugin-core-public.corestart.overlays.md) | OverlayStart | [OverlayStart](./kibana-plugin-core-public.overlaystart.md) |
| [savedObjects](./kibana-plugin-core-public.corestart.savedobjects.md) | SavedObjectsStart | [SavedObjectsStart](./kibana-plugin-core-public.savedobjectsstart.md) |
diff --git a/docs/development/core/public/kibana-plugin-core-public.md b/docs/development/core/public/kibana-plugin-core-public.md
index 4f119d543543e..4c5cd8378af60 100644
--- a/docs/development/core/public/kibana-plugin-core-public.md
+++ b/docs/development/core/public/kibana-plugin-core-public.md
@@ -46,7 +46,7 @@ The plugin integrates with the core system via lifecycle events: `setup`
| [ChromeHelpExtensionMenuDiscussLink](./kibana-plugin-core-public.chromehelpextensionmenudiscusslink.md) | |
| [ChromeHelpExtensionMenuDocumentationLink](./kibana-plugin-core-public.chromehelpextensionmenudocumentationlink.md) | |
| [ChromeHelpExtensionMenuGitHubLink](./kibana-plugin-core-public.chromehelpextensionmenugithublink.md) | |
-| [ChromeHelpMenuActions](./kibana-plugin-core-public.chromehelpmenuactions.md) | List of actions in order to manipulate with the help menu from the help extensions content components. |
+| [ChromeHelpMenuActions](./kibana-plugin-core-public.chromehelpmenuactions.md) | |
| [ChromeNavControl](./kibana-plugin-core-public.chromenavcontrol.md) | |
| [ChromeNavControls](./kibana-plugin-core-public.chromenavcontrols.md) | [APIs](./kibana-plugin-core-public.chromenavcontrols.md) for registering new controls to be displayed in the navigation bar. |
| [ChromeNavLink](./kibana-plugin-core-public.chromenavlink.md) | |
diff --git a/docs/development/core/server/kibana-plugin-core-server.discoveredplugin.configpath.md b/docs/development/core/server/kibana-plugin-core-server.discoveredplugin.configpath.md
deleted file mode 100644
index f58c717c80395..0000000000000
--- a/docs/development/core/server/kibana-plugin-core-server.discoveredplugin.configpath.md
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [DiscoveredPlugin](./kibana-plugin-core-server.discoveredplugin.md) > [configPath](./kibana-plugin-core-server.discoveredplugin.configpath.md)
-
-## DiscoveredPlugin.configPath property
-
-Root configuration path used by the plugin, defaults to "id" in snake\_case format.
-
-Signature:
-
-```typescript
-readonly configPath: ConfigPath;
-```
diff --git a/docs/development/core/server/kibana-plugin-core-server.discoveredplugin.enabledonanonymouspages.md b/docs/development/core/server/kibana-plugin-core-server.discoveredplugin.enabledonanonymouspages.md
deleted file mode 100644
index 472bac3dde7d8..0000000000000
--- a/docs/development/core/server/kibana-plugin-core-server.discoveredplugin.enabledonanonymouspages.md
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [DiscoveredPlugin](./kibana-plugin-core-server.discoveredplugin.md) > [enabledOnAnonymousPages](./kibana-plugin-core-server.discoveredplugin.enabledonanonymouspages.md)
-
-## DiscoveredPlugin.enabledOnAnonymousPages property
-
-Specifies whether this plugin - and its required dependencies - will be enabled for anonymous pages (login page, status page when configured, etc.) Default is false.
-
-Signature:
-
-```typescript
-readonly enabledOnAnonymousPages?: boolean;
-```
diff --git a/docs/development/core/server/kibana-plugin-core-server.discoveredplugin.id.md b/docs/development/core/server/kibana-plugin-core-server.discoveredplugin.id.md
deleted file mode 100644
index 0a2d091a31fba..0000000000000
--- a/docs/development/core/server/kibana-plugin-core-server.discoveredplugin.id.md
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [DiscoveredPlugin](./kibana-plugin-core-server.discoveredplugin.md) > [id](./kibana-plugin-core-server.discoveredplugin.id.md)
-
-## DiscoveredPlugin.id property
-
-Identifier of the plugin.
-
-Signature:
-
-```typescript
-readonly id: PluginName;
-```
diff --git a/docs/development/core/server/kibana-plugin-core-server.discoveredplugin.md b/docs/development/core/server/kibana-plugin-core-server.discoveredplugin.md
deleted file mode 100644
index 258acfa9ddc36..0000000000000
--- a/docs/development/core/server/kibana-plugin-core-server.discoveredplugin.md
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [DiscoveredPlugin](./kibana-plugin-core-server.discoveredplugin.md)
-
-## DiscoveredPlugin interface
-
-Small container object used to expose information about discovered plugins that may or may not have been started.
-
-Signature:
-
-```typescript
-export interface DiscoveredPlugin
-```
-
-## Properties
-
-| Property | Type | Description |
-| --- | --- | --- |
-| [configPath](./kibana-plugin-core-server.discoveredplugin.configpath.md) | ConfigPath | Root configuration path used by the plugin, defaults to "id" in snake\_case format. |
-| [enabledOnAnonymousPages?](./kibana-plugin-core-server.discoveredplugin.enabledonanonymouspages.md) | boolean | (Optional) Specifies whether this plugin - and its required dependencies - will be enabled for anonymous pages (login page, status page when configured, etc.) Default is false. |
-| [id](./kibana-plugin-core-server.discoveredplugin.id.md) | PluginName | Identifier of the plugin. |
-| [optionalPlugins](./kibana-plugin-core-server.discoveredplugin.optionalplugins.md) | readonly PluginName\[\] | An optional list of the other plugins that if installed and enabled \*\*may be\*\* leveraged by this plugin for some additional functionality but otherwise are not required for this plugin to work properly. |
-| [requiredBundles](./kibana-plugin-core-server.discoveredplugin.requiredbundles.md) | readonly PluginName\[\] | List of plugin ids that this plugin's UI code imports modules from that are not in requiredPlugins. |
-| [requiredPlugins](./kibana-plugin-core-server.discoveredplugin.requiredplugins.md) | readonly PluginName\[\] | An optional list of the other plugins that \*\*must be\*\* installed and enabled for this plugin to function properly. |
-| [type](./kibana-plugin-core-server.discoveredplugin.type.md) | PluginType | Type of the plugin, defaults to standard. |
-
diff --git a/docs/development/core/server/kibana-plugin-core-server.discoveredplugin.optionalplugins.md b/docs/development/core/server/kibana-plugin-core-server.discoveredplugin.optionalplugins.md
deleted file mode 100644
index 0fc42048be90c..0000000000000
--- a/docs/development/core/server/kibana-plugin-core-server.discoveredplugin.optionalplugins.md
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [DiscoveredPlugin](./kibana-plugin-core-server.discoveredplugin.md) > [optionalPlugins](./kibana-plugin-core-server.discoveredplugin.optionalplugins.md)
-
-## DiscoveredPlugin.optionalPlugins property
-
-An optional list of the other plugins that if installed and enabled \*\*may be\*\* leveraged by this plugin for some additional functionality but otherwise are not required for this plugin to work properly.
-
-Signature:
-
-```typescript
-readonly optionalPlugins: readonly PluginName[];
-```
diff --git a/docs/development/core/server/kibana-plugin-core-server.discoveredplugin.requiredbundles.md b/docs/development/core/server/kibana-plugin-core-server.discoveredplugin.requiredbundles.md
deleted file mode 100644
index 6d54adb5236ea..0000000000000
--- a/docs/development/core/server/kibana-plugin-core-server.discoveredplugin.requiredbundles.md
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [DiscoveredPlugin](./kibana-plugin-core-server.discoveredplugin.md) > [requiredBundles](./kibana-plugin-core-server.discoveredplugin.requiredbundles.md)
-
-## DiscoveredPlugin.requiredBundles property
-
-List of plugin ids that this plugin's UI code imports modules from that are not in `requiredPlugins`.
-
-Signature:
-
-```typescript
-readonly requiredBundles: readonly PluginName[];
-```
-
-## Remarks
-
-The plugins listed here will be loaded in the browser, even if the plugin is disabled. Required by `@kbn/optimizer` to support cross-plugin imports. "core" and plugins already listed in `requiredPlugins` do not need to be duplicated here.
-
diff --git a/docs/development/core/server/kibana-plugin-core-server.discoveredplugin.requiredplugins.md b/docs/development/core/server/kibana-plugin-core-server.discoveredplugin.requiredplugins.md
deleted file mode 100644
index b039891904669..0000000000000
--- a/docs/development/core/server/kibana-plugin-core-server.discoveredplugin.requiredplugins.md
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [DiscoveredPlugin](./kibana-plugin-core-server.discoveredplugin.md) > [requiredPlugins](./kibana-plugin-core-server.discoveredplugin.requiredplugins.md)
-
-## DiscoveredPlugin.requiredPlugins property
-
-An optional list of the other plugins that \*\*must be\*\* installed and enabled for this plugin to function properly.
-
-Signature:
-
-```typescript
-readonly requiredPlugins: readonly PluginName[];
-```
diff --git a/docs/development/core/server/kibana-plugin-core-server.discoveredplugin.type.md b/docs/development/core/server/kibana-plugin-core-server.discoveredplugin.type.md
deleted file mode 100644
index 0a33be0d63f5c..0000000000000
--- a/docs/development/core/server/kibana-plugin-core-server.discoveredplugin.type.md
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [DiscoveredPlugin](./kibana-plugin-core-server.discoveredplugin.md) > [type](./kibana-plugin-core-server.discoveredplugin.type.md)
-
-## DiscoveredPlugin.type property
-
-Type of the plugin, defaults to `standard`.
-
-Signature:
-
-```typescript
-readonly type: PluginType;
-```
diff --git a/docs/development/core/server/kibana-plugin-core-server.kibanaresponsefactory.md b/docs/development/core/server/kibana-plugin-core-server.kibanaresponsefactory.md
index be28cd76b16ee..e02f208ae86ac 100644
--- a/docs/development/core/server/kibana-plugin-core-server.kibanaresponsefactory.md
+++ b/docs/development/core/server/kibana-plugin-core-server.kibanaresponsefactory.md
@@ -10,7 +10,7 @@ Set of helpers used to create `KibanaResponse` to form HTTP response on an incom
```typescript
kibanaResponseFactory: {
- custom: | Error | Buffer | {
+ custom: | Buffer | Error | {
message: string | Error;
attributes?: ResponseErrorAttributes | undefined;
} | Stream | undefined>(options: CustomHttpResponseOptions) => KibanaResponse;
@@ -34,7 +34,7 @@ kibanaResponseFactory: {
message: string | Error;
attributes?: ResponseErrorAttributes | undefined;
}>;
- customError: (options: CustomHttpResponseOptions) => KibanaResponse) => KibanaResponse;
diff --git a/docs/development/core/server/kibana-plugin-core-server.md b/docs/development/core/server/kibana-plugin-core-server.md
index 124f744b08032..7a923aca3a771 100644
--- a/docs/development/core/server/kibana-plugin-core-server.md
+++ b/docs/development/core/server/kibana-plugin-core-server.md
@@ -37,7 +37,6 @@ The plugin integrates with the core system via lifecycle events: `setup`
| --- | --- |
| [AuthResultType](./kibana-plugin-core-server.authresulttype.md) | |
| [AuthStatus](./kibana-plugin-core-server.authstatus.md) | Status indicating an outcome of the authentication. |
-| [PluginType](./kibana-plugin-core-server.plugintype.md) | |
## Interfaces
@@ -68,7 +67,6 @@ The plugin integrates with the core system via lifecycle events: `setup`
| [DeprecationsClient](./kibana-plugin-core-server.deprecationsclient.md) | Server-side client that provides access to fetch all Kibana deprecations |
| [DeprecationSettings](./kibana-plugin-core-server.deprecationsettings.md) | UiSettings deprecation field options. |
| [DeprecationsServiceSetup](./kibana-plugin-core-server.deprecationsservicesetup.md) | The deprecations service provides a way for the Kibana platform to communicate deprecated features and configs with its users. These deprecations are only communicated if the deployment is using these features. Allowing for a user tailored experience for upgrading the stack version.The Deprecation service is consumed by the upgrade assistant to assist with the upgrade experience.If a deprecated feature can be resolved without manual user intervention. Using correctiveActions.api allows the Upgrade Assistant to use this api to correct the deprecation upon a user trigger. |
-| [DiscoveredPlugin](./kibana-plugin-core-server.discoveredplugin.md) | Small container object used to expose information about discovered plugins that may or may not have been started. |
| [DocLinksServiceSetup](./kibana-plugin-core-server.doclinksservicesetup.md) | |
| [ElasticsearchConfigPreboot](./kibana-plugin-core-server.elasticsearchconfigpreboot.md) | A limited set of Elasticsearch configuration entries exposed to the preboot plugins at setup. |
| [ElasticsearchErrorDetails](./kibana-plugin-core-server.elasticsearcherrordetails.md) | |
diff --git a/docs/development/core/server/kibana-plugin-core-server.plugintype.md b/docs/development/core/server/kibana-plugin-core-server.plugintype.md
deleted file mode 100644
index e4a252a392949..0000000000000
--- a/docs/development/core/server/kibana-plugin-core-server.plugintype.md
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [PluginType](./kibana-plugin-core-server.plugintype.md)
-
-## PluginType enum
-
-
-Signature:
-
-```typescript
-export declare enum PluginType
-```
-
-## Enumeration Members
-
-| Member | Value | Description |
-| --- | --- | --- |
-| preboot | "preboot" | Preboot plugins are special-purpose plugins that only function during preboot stage. |
-| standard | "standard" | Standard plugins are plugins that start to function as soon as Kibana is fully booted and are active until it shuts down. |
-
diff --git a/docs/management/cases/images/cases-visualization.png b/docs/management/cases/images/cases-visualization.png
index 77f249f26d091..53c4893bcc598 100644
Binary files a/docs/management/cases/images/cases-visualization.png and b/docs/management/cases/images/cases-visualization.png differ
diff --git a/docs/management/cases/images/cases.png b/docs/management/cases/images/cases.png
index b244b3df16a20..a69f21c2ec9f8 100644
Binary files a/docs/management/cases/images/cases.png and b/docs/management/cases/images/cases.png differ
diff --git a/docs/settings/apm-settings.asciidoc b/docs/settings/apm-settings.asciidoc
index 2cfd3169b45a3..65f291a1c11cb 100644
--- a/docs/settings/apm-settings.asciidoc
+++ b/docs/settings/apm-settings.asciidoc
@@ -18,9 +18,14 @@ It is enabled by default.
// Any changes made in this file will be seen there as well.
// tag::apm-indices-settings[]
-Index defaults can be changed in the APM app. Select **Settings** > **Indices**.
+The APM app uses data views to query APM indices.
+To change the default APM indices that the APM app queries, open the APM app and select **Settings** > **Indices**.
Index settings in the APM app take precedence over those set in `kibana.yml`.
+Starting in version 8.2.0, APM indices are {kib} Spaces-aware;
+Changes to APM index settings will only apply to the currently enabled space.
+See <> for more information.
+
[role="screenshot"]
image::settings/images/apm-settings.png[APM app settings in Kibana]
@@ -72,7 +77,7 @@ Maximum number of child items displayed when viewing trace details. Defaults to
Index name where Observability annotations are stored. Defaults to `observability-annotations`.
`xpack.apm.searchAggregatedTransactions` {ess-icon}::
-Enables Transaction histogram metrics. Defaults to `auto` so the UI will use metric indices over transaction indices for transactions if aggregated transactions are found. When set to `always`, additional configuration in APM Server is required. When set to `never` and aggregated transactions are not used.
+Enables Transaction histogram metrics. Defaults to `auto` so the UI will use metric indices over transaction indices for transactions if aggregated transactions are found. When set to `always`, additional configuration in APM Server is required. When set to `never` and aggregated transactions are not used.
+
See {apm-guide-ref}/transaction-metrics.html[Configure transaction metrics] for more information.
diff --git a/docs/settings/images/apm-settings.png b/docs/settings/images/apm-settings.png
index 876f135da9356..f3adae184348f 100644
Binary files a/docs/settings/images/apm-settings.png and b/docs/settings/images/apm-settings.png differ
diff --git a/docs/setup/upgrade/resolving-migration-failures.asciidoc b/docs/setup/upgrade/resolving-migration-failures.asciidoc
index 2c3f66f2354dd..10aabdcabd5e2 100644
--- a/docs/setup/upgrade/resolving-migration-failures.asciidoc
+++ b/docs/setup/upgrade/resolving-migration-failures.asciidoc
@@ -89,9 +89,8 @@ The dashboard with the `e3c5fc71-ac71-4805-bcab-2bcc9cc93275` ID that belongs to
[[unknown-saved-object-types]]
==== Documents for unknown saved objects
Migrations will fail if saved objects belong to an unknown
-saved object type. Unknown saved objects are typically caused by
-to the {es} index, or by disabling a plugin that had previously
-created a saved object.
+saved object type. Unknown saved objects are typically caused by performing manual modifications
+to the {es} index (no longer allowed in 8.x), or by disabling a plugin that had previously created a saved object.
We recommend using the {kibana-ref-all}/7.17/upgrade-assistant.html[Upgrade Assistant]
to discover and remedy any unknown saved object types. {kib} version 7.17.0 deployments containing unknown saved
@@ -106,7 +105,20 @@ If you fail to remedy this, your upgrade to 8.0+ will fail with a message like:
[source,sh]
--------------------------------------------
-Unable to complete saved object migrations for the [.kibana] index: Migration failed because documents were found for unknown saved object types. To proceed with the migration, please delete these documents from the ".kibana_7.17.0_001" index.
+Unable to complete saved object migrations for the [.kibana] index: Migration failed because some documents were found which use unknown saved object types:
+- "firstDocId" (type "someType")
+- "secondtDocId" (type "someType")
+- "thirdDocId" (type "someOtherType")
+
+To proceed with the migration you can configure Kibana to discard unknown saved objects for this migration.
+--------------------------------------------
+
+To proceed with the migration, re-enable any plugins that previously created these saved objects. Alternatively, carefully review the list of unknown saved objects in the Kibana log entry. If the corresponding disabled plugins and their associated saved objects will no longer be used, they can be deleted by setting the configuration option `migrations.discardUnknownObjects` to the version you are upgrading to.
+For instance, for an upgrade to 8.3.0, you can define the following setting in kibana.yml:
+
+[source,yaml]
+--------------------------------------------
+migrations.discardUnknownObjects: "8.3.0"
--------------------------------------------
[float]
@@ -181,7 +193,7 @@ PUT /_cluster/settings
{
"transient": {
"cluster.routing.allocation.enable": null
- },
+ },
"persistent": {
"cluster.routing.allocation.enable": null
}
@@ -193,4 +205,4 @@ PUT /_cluster/settings
==== {es} cluster shard limit exceeded
When upgrading, {kib} creates new indices requiring a small number of new shards. If the amount of open {es} shards approaches or exceeds the {es} `cluster.max_shards_per_node` setting, {kib} is unable to complete the upgrade. Ensure that {kib} is able to add at least 10 more shards by removing indices to clear up resources, or by increasing the `cluster.max_shards_per_node` setting.
-For more information, refer to the documentation on {ref}/allocation-total-shards.html[total shards per node].
\ No newline at end of file
+For more information, refer to the documentation on {ref}/allocation-total-shards.html[total shards per node].
diff --git a/fleet_packages.json b/fleet_packages.json
index 5c62d96953a1a..9fefb0aa9a2c2 100644
--- a/fleet_packages.json
+++ b/fleet_packages.json
@@ -15,11 +15,11 @@
[
{
"name": "apm",
- "version": "8.2.0"
+ "version": "8.3.0"
},
{
"name": "elastic_agent",
- "version": "1.3.1"
+ "version": "1.3.3"
},
{
"name": "endpoint",
@@ -27,7 +27,7 @@
},
{
"name": "fleet_server",
- "version": "1.1.1"
+ "version": "1.2.0"
},
{
"name": "synthetics",
diff --git a/nav-kibana-dev.docnav.json b/nav-kibana-dev.docnav.json
index 9a170aac79e58..0f2a349e60f01 100644
--- a/nav-kibana-dev.docnav.json
+++ b/nav-kibana-dev.docnav.json
@@ -184,7 +184,8 @@
{ "id": "kibDevDocsOpsTypeSummarizer" },
{ "id": "kibDevDocsOpsBabelPluginSyntheticPackages" },
{ "id": "kibDevDocsOpsUiSharedDepsNpm" },
- { "id": "kibDevDocsOpsUiSharedDepsSrc" }
+ { "id": "kibDevDocsOpsUiSharedDepsSrc" },
+ { "id": "kibDevDocsOpsPluginDiscovery" }
]
},
{
@@ -205,7 +206,9 @@
{ "id": "kibDevDocsOpsAmbientStorybookTypes" },
{ "id": "kibDevDocsOpsAmbientUiTypes" },
{ "id": "kibDevDocsOpsTestSubjSelector" },
- { "id": "kibDevDocsOpsBazelRunner" }
+ { "id": "kibDevDocsOpsBazelRunner" },
+ { "id": "kibDevDocsOpsCliDevMode" },
+ { "id": "kibDevDocsOpsEs" }
]
}
]
diff --git a/package.json b/package.json
index 6b8b832fd91a9..25f8918cb11c9 100644
--- a/package.json
+++ b/package.json
@@ -109,7 +109,7 @@
"@elastic/charts": "46.0.1",
"@elastic/datemath": "5.0.3",
"@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@8.2.0-canary.2",
- "@elastic/ems-client": "8.3.2",
+ "@elastic/ems-client": "8.3.3",
"@elastic/eui": "58.0.0",
"@elastic/filesaver": "1.1.2",
"@elastic/node-crypto": "1.2.1",
@@ -151,6 +151,10 @@
"@kbn/core-base-common": "link:bazel-bin/packages/core/base/core-base-common",
"@kbn/core-base-common-internal": "link:bazel-bin/packages/core/base/core-base-common-internal",
"@kbn/core-base-server-internal": "link:bazel-bin/packages/core/base/core-base-server-internal",
+ "@kbn/core-injected-metadata-browser": "link:bazel-bin/packages/core/injected-metadata/core-injected-metadata-browser",
+ "@kbn/core-injected-metadata-browser-internal": "link:bazel-bin/packages/core/injected-metadata/core-injected-metadata-browser-internal",
+ "@kbn/core-injected-metadata-browser-mocks": "link:bazel-bin/packages/core/injected-metadata/core-injected-metadata-browser-mocks",
+ "@kbn/core-injected-metadata-common-internal": "link:bazel-bin/packages/core/injected-metadata/core-injected-metadata-common-internal",
"@kbn/crypto": "link:bazel-bin/packages/kbn-crypto",
"@kbn/datemath": "link:bazel-bin/packages/kbn-datemath",
"@kbn/doc-links": "link:bazel-bin/packages/kbn-doc-links",
@@ -205,6 +209,7 @@
"@kbn/ui-shared-deps-src": "link:bazel-bin/packages/kbn-ui-shared-deps-src",
"@kbn/ui-theme": "link:bazel-bin/packages/kbn-ui-theme",
"@kbn/utility-types": "link:bazel-bin/packages/kbn-utility-types",
+ "@kbn/utility-types-jest": "link:bazel-bin/packages/kbn-utility-types-jest",
"@kbn/utils": "link:bazel-bin/packages/kbn-utils",
"@loaders.gl/core": "^2.3.1",
"@loaders.gl/json": "^2.3.1",
@@ -647,6 +652,10 @@
"@types/kbn__core-base-server": "link:bazel-bin/packages/core/base/core-base-server/npm_module_types",
"@types/kbn__core-base-server-internal": "link:bazel-bin/packages/core/base/core-base-server-internal/npm_module_types",
"@types/kbn__core-common-internal-base": "link:bazel-bin/packages/core/common/internal-base/npm_module_types",
+ "@types/kbn__core-injected-metadata-browser": "link:bazel-bin/packages/core/injected-metadata/core-injected-metadata-browser/npm_module_types",
+ "@types/kbn__core-injected-metadata-browser-internal": "link:bazel-bin/packages/core/injected-metadata/core-injected-metadata-browser-internal/npm_module_types",
+ "@types/kbn__core-injected-metadata-browser-mocks": "link:bazel-bin/packages/core/injected-metadata/core-injected-metadata-browser-mocks/npm_module_types",
+ "@types/kbn__core-injected-metadata-common-internal": "link:bazel-bin/packages/core/injected-metadata/core-injected-metadata-common-internal/npm_module_types",
"@types/kbn__core-public-internal-base": "link:bazel-bin/packages/core/public/internal-base/npm_module_types",
"@types/kbn__core-server-internal-base": "link:bazel-bin/packages/core/server/internal-base/npm_module_types",
"@types/kbn__crypto": "link:bazel-bin/packages/kbn-crypto/npm_module_types",
@@ -720,6 +729,7 @@
"@types/kbn__ui-shared-deps-src": "link:bazel-bin/packages/kbn-ui-shared-deps-src/npm_module_types",
"@types/kbn__ui-theme": "link:bazel-bin/packages/kbn-ui-theme/npm_module_types",
"@types/kbn__utility-types": "link:bazel-bin/packages/kbn-utility-types/npm_module_types",
+ "@types/kbn__utility-types-jest": "link:bazel-bin/packages/kbn-utility-types-jest/npm_module_types",
"@types/kbn__utils": "link:bazel-bin/packages/kbn-utils/npm_module_types",
"@types/license-checker": "15.0.0",
"@types/listr": "^0.14.0",
@@ -777,7 +787,7 @@
"@types/redux-logger": "^3.0.8",
"@types/resolve": "^1.20.1",
"@types/seedrandom": ">=2.0.0 <4.0.0",
- "@types/selenium-webdriver": "^4.1.0",
+ "@types/selenium-webdriver": "^4.1.1",
"@types/semver": "^7",
"@types/set-value": "^2.0.0",
"@types/sinon": "^7.0.13",
@@ -953,7 +963,7 @@
"resolve": "^1.22.0",
"rxjs-marbles": "^5.0.6",
"sass-loader": "^10.2.0",
- "selenium-webdriver": "^4.1.2",
+ "selenium-webdriver": "^4.2.0",
"shelljs": "^0.8.4",
"simple-git": "1.116.0",
"sinon": "^7.4.2",
diff --git a/packages/BUILD.bazel b/packages/BUILD.bazel
index f8c070b31328d..8f814fd9e7a3a 100644
--- a/packages/BUILD.bazel
+++ b/packages/BUILD.bazel
@@ -18,6 +18,10 @@ filegroup(
"//packages/core/base/core-base-common-internal:build",
"//packages/core/base/core-base-common:build",
"//packages/core/base/core-base-server-internal:build",
+ "//packages/core/injected-metadata/core-injected-metadata-browser-internal:build",
+ "//packages/core/injected-metadata/core-injected-metadata-browser-mocks:build",
+ "//packages/core/injected-metadata/core-injected-metadata-browser:build",
+ "//packages/core/injected-metadata/core-injected-metadata-common-internal:build",
"//packages/elastic-apm-synthtrace:build",
"//packages/elastic-safer-lodash-set:build",
"//packages/kbn-ace:build",
@@ -117,6 +121,7 @@ filegroup(
"//packages/kbn-ui-shared-deps-npm:build",
"//packages/kbn-ui-shared-deps-src:build",
"//packages/kbn-ui-theme:build",
+ "//packages/kbn-utility-types-jest:build",
"//packages/kbn-utility-types:build",
"//packages/kbn-utils:build",
"//packages/shared-ux/avatar/solution:build",
@@ -140,6 +145,10 @@ filegroup(
"//packages/core/base/core-base-common-internal:build_types",
"//packages/core/base/core-base-common:build_types",
"//packages/core/base/core-base-server-internal:build_types",
+ "//packages/core/injected-metadata/core-injected-metadata-browser-internal:build_types",
+ "//packages/core/injected-metadata/core-injected-metadata-browser-mocks:build_types",
+ "//packages/core/injected-metadata/core-injected-metadata-browser:build_types",
+ "//packages/core/injected-metadata/core-injected-metadata-common-internal:build_types",
"//packages/elastic-apm-synthtrace:build_types",
"//packages/elastic-safer-lodash-set:build_types",
"//packages/kbn-ace:build_types",
@@ -224,6 +233,7 @@ filegroup(
"//packages/kbn-ui-shared-deps-npm:build_types",
"//packages/kbn-ui-shared-deps-src:build_types",
"//packages/kbn-ui-theme:build_types",
+ "//packages/kbn-utility-types-jest:build_types",
"//packages/kbn-utility-types:build_types",
"//packages/kbn-utils:build_types",
"//packages/shared-ux/avatar/solution:build_types",
diff --git a/packages/core/base/core-base-common-internal/BUILD.bazel b/packages/core/base/core-base-common-internal/BUILD.bazel
index 9eb3de99f77c6..9095c8da9f311 100644
--- a/packages/core/base/core-base-common-internal/BUILD.bazel
+++ b/packages/core/base/core-base-common-internal/BUILD.bazel
@@ -26,29 +26,10 @@ NPM_MODULE_EXTRA_FILES = [
"package.json",
]
-# In this array place runtime dependencies, including other packages and NPM packages
-# which must be available for this code to run.
-#
-# To reference other packages use:
-# "//repo/relative/path/to/package"
-# eg. "//packages/kbn-utils"
-#
-# To reference a NPM package use:
-# "@npm//name-of-package"
-# eg. "@npm//lodash"
RUNTIME_DEPS = [
"@npm//react"
]
-# In this array place dependencies necessary to build the types, which will include the
-# :npm_module_types target of other packages and packages from NPM, including @types/*
-# packages.
-#
-# To reference the types for another package use:
-# "//repo/relative/path/to/package:npm_module_types"
-# eg. "//packages/kbn-utils:npm_module_types"
-#
-# References to NPM packages work the same as RUNTIME_DEPS
TYPES_DEPS = [
"@npm//@types/node",
"@npm//@types/jest",
diff --git a/packages/core/base/core-base-common/BUILD.bazel b/packages/core/base/core-base-common/BUILD.bazel
index b9c1910856d2c..118e7dbd8f2be 100644
--- a/packages/core/base/core-base-common/BUILD.bazel
+++ b/packages/core/base/core-base-common/BUILD.bazel
@@ -25,31 +25,13 @@ NPM_MODULE_EXTRA_FILES = [
"package.json",
]
-# In this array place runtime dependencies, including other packages and NPM packages
-# which must be available for this code to run.
-#
-# To reference other packages use:
-# "//repo/relative/path/to/package"
-# eg. "//packages/kbn-utils"
-#
-# To reference a NPM package use:
-# "@npm//name-of-package"
-# eg. "@npm//lodash"
RUNTIME_DEPS = [
]
-# In this array place dependencies necessary to build the types, which will include the
-# :npm_module_types target of other packages and packages from NPM, including @types/*
-# packages.
-#
-# To reference the types for another package use:
-# "//repo/relative/path/to/package:npm_module_types"
-# eg. "//packages/kbn-utils:npm_module_types"
-#
-# References to NPM packages work the same as RUNTIME_DEPS
TYPES_DEPS = [
"@npm//@types/node",
"@npm//@types/jest",
+ "//packages/kbn-config:npm_module_types",
]
jsts_transpiler(
diff --git a/packages/core/base/core-base-common/src/index.ts b/packages/core/base/core-base-common/src/index.ts
index e1bb28de40f51..7524448e91c20 100644
--- a/packages/core/base/core-base-common/src/index.ts
+++ b/packages/core/base/core-base-common/src/index.ts
@@ -6,4 +6,5 @@
* Side Public License, v 1.
*/
-export type { PluginOpaqueId, PluginName } from './plugins';
+export type { PluginOpaqueId, PluginName, DiscoveredPlugin } from './plugins';
+export { PluginType } from './plugins';
diff --git a/packages/core/base/core-base-common/src/plugins.ts b/packages/core/base/core-base-common/src/plugins.ts
index 7fe34d79e0e21..61e44374d514d 100644
--- a/packages/core/base/core-base-common/src/plugins.ts
+++ b/packages/core/base/core-base-common/src/plugins.ts
@@ -6,6 +6,8 @@
* Side Public License, v 1.
*/
+import { ConfigPath } from '@kbn/config';
+
/**
* Dedicated type for plugin name/id that is supposed to make Map/Set/Arrays
* that use it as a key or value more obvious.
@@ -16,3 +18,68 @@ export type PluginName = string;
/** @public */
export type PluginOpaqueId = symbol;
+
+/** @public */
+export enum PluginType {
+ /**
+ * Preboot plugins are special-purpose plugins that only function during preboot stage.
+ */
+ preboot = 'preboot',
+ /**
+ * Standard plugins are plugins that start to function as soon as Kibana is fully booted and are active until it shuts down.
+ */
+ standard = 'standard',
+}
+
+/**
+ * Small container object used to expose information about discovered plugins that may
+ * or may not have been started.
+ * @public
+ */
+export interface DiscoveredPlugin {
+ /**
+ * Identifier of the plugin.
+ */
+ readonly id: PluginName;
+
+ /**
+ * Root configuration path used by the plugin, defaults to "id" in snake_case format.
+ */
+ readonly configPath: ConfigPath;
+
+ /**
+ * Type of the plugin, defaults to `standard`.
+ */
+ readonly type: PluginType;
+
+ /**
+ * An optional list of the other plugins that **must be** installed and enabled
+ * for this plugin to function properly.
+ */
+ readonly requiredPlugins: readonly PluginName[];
+
+ /**
+ * An optional list of the other plugins that if installed and enabled **may be**
+ * leveraged by this plugin for some additional functionality but otherwise are
+ * not required for this plugin to work properly.
+ */
+ readonly optionalPlugins: readonly PluginName[];
+
+ /**
+ * List of plugin ids that this plugin's UI code imports modules from that are
+ * not in `requiredPlugins`.
+ *
+ * @remarks
+ * The plugins listed here will be loaded in the browser, even if the plugin is
+ * disabled. Required by `@kbn/optimizer` to support cross-plugin imports.
+ * "core" and plugins already listed in `requiredPlugins` do not need to be
+ * duplicated here.
+ */
+ readonly requiredBundles: readonly PluginName[];
+
+ /**
+ * Specifies whether this plugin - and its required dependencies - will be enabled for anonymous pages (login page, status page when
+ * configured, etc.) Default is false.
+ */
+ readonly enabledOnAnonymousPages?: boolean;
+}
diff --git a/packages/core/injected-metadata/core-injected-metadata-browser-internal/BUILD.bazel b/packages/core/injected-metadata/core-injected-metadata-browser-internal/BUILD.bazel
new file mode 100644
index 0000000000000..a83771bb84744
--- /dev/null
+++ b/packages/core/injected-metadata/core-injected-metadata-browser-internal/BUILD.bazel
@@ -0,0 +1,109 @@
+load("@npm//@bazel/typescript:index.bzl", "ts_config")
+load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
+load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project")
+
+PKG_DIRNAME = "core-injected-metadata-browser-internal"
+PKG_REQUIRE_NAME = "@kbn/core-injected-metadata-browser-internal"
+
+SOURCE_FILES = glob(
+ [
+ "src/**/*.ts",
+ "src/**/*.tsx",
+ ],
+ exclude = [
+ "**/*.test.*",
+ ],
+)
+
+SRCS = SOURCE_FILES
+
+filegroup(
+ name = "srcs",
+ srcs = SRCS,
+)
+
+NPM_MODULE_EXTRA_FILES = [
+ "package.json",
+]
+
+RUNTIME_DEPS = [
+ "@npm//lodash",
+ "//packages/kbn-std",
+]
+
+TYPES_DEPS = [
+ "@npm//@types/node",
+ "@npm//@types/jest",
+ "@npm//@types/lodash",
+ "//packages/kbn-std:npm_module_types",
+ "//packages/core/base/core-base-common:npm_module_types",
+ "//packages/core/injected-metadata/core-injected-metadata-common-internal:npm_module_types",
+]
+
+jsts_transpiler(
+ name = "target_node",
+ srcs = SRCS,
+ build_pkg_name = package_name(),
+)
+
+jsts_transpiler(
+ name = "target_web",
+ srcs = SRCS,
+ build_pkg_name = package_name(),
+ web = True,
+)
+
+ts_config(
+ name = "tsconfig",
+ src = "tsconfig.json",
+ deps = [
+ "//:tsconfig.base.json",
+ "//:tsconfig.bazel.json",
+ ],
+)
+
+ts_project(
+ name = "tsc_types",
+ args = ['--pretty'],
+ srcs = SRCS,
+ deps = TYPES_DEPS,
+ declaration = True,
+ emit_declaration_only = True,
+ out_dir = "target_types",
+ root_dir = "src",
+ tsconfig = ":tsconfig",
+)
+
+js_library(
+ name = PKG_DIRNAME,
+ srcs = NPM_MODULE_EXTRA_FILES,
+ deps = RUNTIME_DEPS + [":target_node", ":target_web"],
+ package_name = PKG_REQUIRE_NAME,
+ visibility = ["//visibility:public"],
+)
+
+pkg_npm(
+ name = "npm_module",
+ deps = [":" + PKG_DIRNAME],
+)
+
+filegroup(
+ name = "build",
+ srcs = [":npm_module"],
+ visibility = ["//visibility:public"],
+)
+
+pkg_npm_types(
+ name = "npm_module_types",
+ srcs = SRCS,
+ deps = [":tsc_types"],
+ package_name = PKG_REQUIRE_NAME,
+ tsconfig = ":tsconfig",
+ visibility = ["//visibility:public"],
+)
+
+filegroup(
+ name = "build_types",
+ srcs = [":npm_module_types"],
+ visibility = ["//visibility:public"],
+)
diff --git a/packages/core/injected-metadata/core-injected-metadata-browser-internal/README.md b/packages/core/injected-metadata/core-injected-metadata-browser-internal/README.md
new file mode 100644
index 0000000000000..9945379eceebf
--- /dev/null
+++ b/packages/core/injected-metadata/core-injected-metadata-browser-internal/README.md
@@ -0,0 +1,3 @@
+# @kbn/core-injected-metadata-browser-internal
+
+This package contains the implementation and internal types of the browser-side injectedMedata service.
diff --git a/packages/core/injected-metadata/core-injected-metadata-browser-internal/jest.config.js b/packages/core/injected-metadata/core-injected-metadata-browser-internal/jest.config.js
new file mode 100644
index 0000000000000..0d957a7a3d5a2
--- /dev/null
+++ b/packages/core/injected-metadata/core-injected-metadata-browser-internal/jest.config.js
@@ -0,0 +1,13 @@
+/*
+ * 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.
+ */
+
+module.exports = {
+ preset: '@kbn/test',
+ rootDir: '../../../..',
+ roots: ['/packages/core/injected-metadata/core-injected-metadata-browser-internal'],
+};
diff --git a/packages/core/injected-metadata/core-injected-metadata-browser-internal/package.json b/packages/core/injected-metadata/core-injected-metadata-browser-internal/package.json
new file mode 100644
index 0000000000000..3fcac1793fcad
--- /dev/null
+++ b/packages/core/injected-metadata/core-injected-metadata-browser-internal/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@kbn/core-injected-metadata-browser-internal",
+ "private": true,
+ "version": "1.0.0",
+ "main": "./target_node/index.js",
+ "browser": "./target_web/index.js",
+ "license": "SSPL-1.0 OR Elastic License 2.0"
+}
diff --git a/src/core/public/injected_metadata/index.ts b/packages/core/injected-metadata/core-injected-metadata-browser-internal/src/index.ts
similarity index 80%
rename from src/core/public/injected_metadata/index.ts
rename to packages/core/injected-metadata/core-injected-metadata-browser-internal/src/index.ts
index b2c4413ed5ff3..2fa0580e742f5 100644
--- a/src/core/public/injected_metadata/index.ts
+++ b/packages/core/injected-metadata/core-injected-metadata-browser-internal/src/index.ts
@@ -5,10 +5,10 @@
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
+
export { InjectedMetadataService } from './injected_metadata_service';
export type {
+ InternalInjectedMetadataSetup,
+ InternalInjectedMetadataStart,
InjectedMetadataParams,
- InjectedMetadataSetup,
- InjectedMetadataStart,
- InjectedPluginMetadata,
-} from './injected_metadata_service';
+} from './types';
diff --git a/src/core/public/injected_metadata/injected_metadata_service.test.ts b/packages/core/injected-metadata/core-injected-metadata-browser-internal/src/injected_metadata_service.test.ts
similarity index 99%
rename from src/core/public/injected_metadata/injected_metadata_service.test.ts
rename to packages/core/injected-metadata/core-injected-metadata-browser-internal/src/injected_metadata_service.test.ts
index ba0e2470d7f26..00e73a8a6fe8c 100644
--- a/src/core/public/injected_metadata/injected_metadata_service.test.ts
+++ b/packages/core/injected-metadata/core-injected-metadata-browser-internal/src/injected_metadata_service.test.ts
@@ -6,7 +6,7 @@
* Side Public License, v 1.
*/
-import { DiscoveredPlugin } from '../../server';
+import type { DiscoveredPlugin } from '@kbn/core-base-common';
import { InjectedMetadataService } from './injected_metadata_service';
describe('setup.getElasticsearchInfo()', () => {
diff --git a/packages/core/injected-metadata/core-injected-metadata-browser-internal/src/injected_metadata_service.ts b/packages/core/injected-metadata/core-injected-metadata-browser-internal/src/injected_metadata_service.ts
new file mode 100644
index 0000000000000..9c6ef8dea4982
--- /dev/null
+++ b/packages/core/injected-metadata/core-injected-metadata-browser-internal/src/injected_metadata_service.ts
@@ -0,0 +1,100 @@
+/*
+ * 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 { get } from 'lodash';
+import { deepFreeze } from '@kbn/std';
+import type { InjectedMetadata } from '@kbn/core-injected-metadata-common-internal';
+import type {
+ InjectedMetadataParams,
+ InternalInjectedMetadataSetup,
+ InternalInjectedMetadataStart,
+} from './types';
+
+/**
+ * Provides access to the metadata that is injected by the
+ * server into the page. The metadata is actually defined
+ * in the entry file for the bundle containing the new platform
+ * and is read from the DOM in most cases.
+ *
+ * @internal
+ */
+export class InjectedMetadataService {
+ private state: InjectedMetadata;
+
+ constructor(private readonly params: InjectedMetadataParams) {
+ this.state = deepFreeze(this.params.injectedMetadata) as InjectedMetadata;
+ }
+
+ public start(): InternalInjectedMetadataSetup {
+ return this.setup();
+ }
+
+ public setup(): InternalInjectedMetadataStart {
+ return {
+ getBasePath: () => {
+ return this.state.basePath;
+ },
+
+ getServerBasePath: () => {
+ return this.state.serverBasePath;
+ },
+
+ getPublicBaseUrl: () => {
+ return this.state.publicBaseUrl;
+ },
+
+ getAnonymousStatusPage: () => {
+ return this.state.anonymousStatusPage;
+ },
+
+ getKibanaVersion: () => {
+ return this.state.version;
+ },
+
+ getCspConfig: () => {
+ return this.state.csp;
+ },
+
+ getExternalUrlConfig: () => {
+ return this.state.externalUrl;
+ },
+
+ getPlugins: () => {
+ return this.state.uiPlugins;
+ },
+
+ getLegacyMetadata: () => {
+ return this.state.legacyMetadata;
+ },
+
+ getInjectedVar: (name: string, defaultValue?: any): unknown => {
+ return get(this.state.vars, name, defaultValue);
+ },
+
+ getInjectedVars: () => {
+ return this.state.vars;
+ },
+
+ getKibanaBuildNumber: () => {
+ return this.state.buildNumber;
+ },
+
+ getKibanaBranch: () => {
+ return this.state.branch;
+ },
+
+ getTheme: () => {
+ return this.state.theme;
+ },
+
+ getElasticsearchInfo: () => {
+ return this.state.clusterInfo;
+ },
+ };
+ }
+}
diff --git a/packages/core/injected-metadata/core-injected-metadata-browser-internal/src/types.ts b/packages/core/injected-metadata/core-injected-metadata-browser-internal/src/types.ts
new file mode 100644
index 0000000000000..679673bd2b0d4
--- /dev/null
+++ b/packages/core/injected-metadata/core-injected-metadata-browser-internal/src/types.ts
@@ -0,0 +1,63 @@
+/*
+ * 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 { ThemeVersion } from '@kbn/ui-shared-deps-npm';
+import {
+ InjectedMetadata,
+ InjectedMetadataClusterInfo,
+ InjectedMetadataExternalUrlPolicy,
+ InjectedMetadataPlugin,
+} from '@kbn/core-injected-metadata-common-internal';
+
+/** @internal */
+export interface InjectedMetadataParams {
+ injectedMetadata: InjectedMetadata;
+}
+
+/**
+ * Provides access to the metadata injected by the server into the page
+ *
+ * @internal
+ */
+export interface InternalInjectedMetadataSetup {
+ getBasePath: () => string;
+ getServerBasePath: () => string;
+ getPublicBaseUrl: () => string | undefined;
+ getKibanaBuildNumber: () => number;
+ getKibanaBranch: () => string;
+ getKibanaVersion: () => string;
+ getCspConfig: () => {
+ warnLegacyBrowsers: boolean;
+ };
+ getExternalUrlConfig: () => {
+ policy: InjectedMetadataExternalUrlPolicy[];
+ };
+ getTheme: () => {
+ darkMode: boolean;
+ version: ThemeVersion;
+ };
+ getElasticsearchInfo: () => InjectedMetadataClusterInfo;
+ /**
+ * An array of frontend plugins in topological order.
+ */
+ getPlugins: () => InjectedMetadataPlugin[];
+ getAnonymousStatusPage: () => boolean;
+ getLegacyMetadata: () => {
+ uiSettings: {
+ defaults: Record;
+ user?: Record | undefined;
+ };
+ };
+ getInjectedVar: (name: string, defaultValue?: any) => unknown;
+ getInjectedVars: () => {
+ [key: string]: unknown;
+ };
+}
+
+/** @internal */
+export type InternalInjectedMetadataStart = InternalInjectedMetadataSetup;
diff --git a/packages/core/injected-metadata/core-injected-metadata-browser-internal/tsconfig.json b/packages/core/injected-metadata/core-injected-metadata-browser-internal/tsconfig.json
new file mode 100644
index 0000000000000..dc20b641b1989
--- /dev/null
+++ b/packages/core/injected-metadata/core-injected-metadata-browser-internal/tsconfig.json
@@ -0,0 +1,18 @@
+{
+ "extends": "../../../../tsconfig.bazel.json",
+ "compilerOptions": {
+ "declaration": true,
+ "emitDeclarationOnly": true,
+ "outDir": "target_types",
+ "rootDir": "src",
+ "stripInternal": false,
+ "types": [
+ "jest",
+ "node",
+ "react"
+ ]
+ },
+ "include": [
+ "src/**/*"
+ ]
+}
diff --git a/packages/core/injected-metadata/core-injected-metadata-browser-mocks/BUILD.bazel b/packages/core/injected-metadata/core-injected-metadata-browser-mocks/BUILD.bazel
new file mode 100644
index 0000000000000..f4788208b932d
--- /dev/null
+++ b/packages/core/injected-metadata/core-injected-metadata-browser-mocks/BUILD.bazel
@@ -0,0 +1,105 @@
+load("@npm//@bazel/typescript:index.bzl", "ts_config")
+load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
+load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project")
+
+PKG_DIRNAME = "core-injected-metadata-browser-mocks"
+PKG_REQUIRE_NAME = "@kbn/core-injected-metadata-browser-mocks"
+
+SOURCE_FILES = glob(
+ [
+ "src/**/*.ts",
+ "src/**/*.tsx",
+ ],
+ exclude = [
+ "**/*.test.*",
+ ],
+)
+
+SRCS = SOURCE_FILES
+
+filegroup(
+ name = "srcs",
+ srcs = SRCS,
+)
+
+NPM_MODULE_EXTRA_FILES = [
+ "package.json",
+]
+
+RUNTIME_DEPS = [
+]
+
+TYPES_DEPS = [
+ "@npm//@types/node",
+ "@npm//@types/jest",
+ "//packages/core/injected-metadata/core-injected-metadata-browser-internal:npm_module_types",
+
+]
+
+jsts_transpiler(
+ name = "target_node",
+ srcs = SRCS,
+ build_pkg_name = package_name(),
+)
+
+jsts_transpiler(
+ name = "target_web",
+ srcs = SRCS,
+ build_pkg_name = package_name(),
+ web = True,
+)
+
+ts_config(
+ name = "tsconfig",
+ src = "tsconfig.json",
+ deps = [
+ "//:tsconfig.base.json",
+ "//:tsconfig.bazel.json",
+ ],
+)
+
+ts_project(
+ name = "tsc_types",
+ args = ['--pretty'],
+ srcs = SRCS,
+ deps = TYPES_DEPS,
+ declaration = True,
+ emit_declaration_only = True,
+ out_dir = "target_types",
+ root_dir = "src",
+ tsconfig = ":tsconfig",
+)
+
+js_library(
+ name = PKG_DIRNAME,
+ srcs = NPM_MODULE_EXTRA_FILES,
+ deps = RUNTIME_DEPS + [":target_node", ":target_web"],
+ package_name = PKG_REQUIRE_NAME,
+ visibility = ["//visibility:public"],
+)
+
+pkg_npm(
+ name = "npm_module",
+ deps = [":" + PKG_DIRNAME],
+)
+
+filegroup(
+ name = "build",
+ srcs = [":npm_module"],
+ visibility = ["//visibility:public"],
+)
+
+pkg_npm_types(
+ name = "npm_module_types",
+ srcs = SRCS,
+ deps = [":tsc_types"],
+ package_name = PKG_REQUIRE_NAME,
+ tsconfig = ":tsconfig",
+ visibility = ["//visibility:public"],
+)
+
+filegroup(
+ name = "build_types",
+ srcs = [":npm_module_types"],
+ visibility = ["//visibility:public"],
+)
diff --git a/packages/core/injected-metadata/core-injected-metadata-browser-mocks/README.md b/packages/core/injected-metadata/core-injected-metadata-browser-mocks/README.md
new file mode 100644
index 0000000000000..2fa98ee0d1ca0
--- /dev/null
+++ b/packages/core/injected-metadata/core-injected-metadata-browser-mocks/README.md
@@ -0,0 +1,3 @@
+# @kbn/core-injected-metadata-browser-mocks
+
+This package contains the public and internal mocks for the injected medata service.
diff --git a/packages/core/injected-metadata/core-injected-metadata-browser-mocks/jest.config.js b/packages/core/injected-metadata/core-injected-metadata-browser-mocks/jest.config.js
new file mode 100644
index 0000000000000..6ffcfd6c82a74
--- /dev/null
+++ b/packages/core/injected-metadata/core-injected-metadata-browser-mocks/jest.config.js
@@ -0,0 +1,13 @@
+/*
+ * 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.
+ */
+
+module.exports = {
+ preset: '@kbn/test',
+ rootDir: '../../../..',
+ roots: ['/packages/core/injected-metadata/core-injected-metadata-browser-mocks'],
+};
diff --git a/packages/core/injected-metadata/core-injected-metadata-browser-mocks/package.json b/packages/core/injected-metadata/core-injected-metadata-browser-mocks/package.json
new file mode 100644
index 0000000000000..e8a4db9f1e47c
--- /dev/null
+++ b/packages/core/injected-metadata/core-injected-metadata-browser-mocks/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@kbn/core-injected-metadata-browser-mocks",
+ "private": true,
+ "version": "1.0.0",
+ "main": "./target_node/index.js",
+ "browser": "./target_web/index.js",
+ "license": "SSPL-1.0 OR Elastic License 2.0"
+}
diff --git a/src/core/server/ui_settings/create_or_upgrade_saved_config/get_upgradeable_config.test.mock.ts b/packages/core/injected-metadata/core-injected-metadata-browser-mocks/src/index.ts
similarity index 69%
rename from src/core/server/ui_settings/create_or_upgrade_saved_config/get_upgradeable_config.test.mock.ts
rename to packages/core/injected-metadata/core-injected-metadata-browser-mocks/src/index.ts
index cb3fb360befeb..c10e5837765f8 100644
--- a/src/core/server/ui_settings/create_or_upgrade_saved_config/get_upgradeable_config.test.mock.ts
+++ b/packages/core/injected-metadata/core-injected-metadata-browser-mocks/src/index.ts
@@ -6,7 +6,4 @@
* Side Public License, v 1.
*/
-export const getUpgradeableConfigMock = jest.fn();
-jest.doMock('./get_upgradeable_config', () => ({
- getUpgradeableConfig: getUpgradeableConfigMock,
-}));
+export { injectedMetadataServiceMock } from './injected_metadata_service.mock';
diff --git a/src/core/public/injected_metadata/injected_metadata_service.mock.ts b/packages/core/injected-metadata/core-injected-metadata-browser-mocks/src/injected_metadata_service.mock.ts
similarity index 91%
rename from src/core/public/injected_metadata/injected_metadata_service.mock.ts
rename to packages/core/injected-metadata/core-injected-metadata-browser-mocks/src/injected_metadata_service.mock.ts
index 83903942df53d..ca510df64c1e2 100644
--- a/src/core/public/injected_metadata/injected_metadata_service.mock.ts
+++ b/packages/core/injected-metadata/core-injected-metadata-browser-mocks/src/injected_metadata_service.mock.ts
@@ -7,10 +7,13 @@
*/
import type { PublicMethodsOf } from '@kbn/utility-types';
-import { InjectedMetadataService, InjectedMetadataSetup } from './injected_metadata_service';
+import type {
+ InjectedMetadataService,
+ InternalInjectedMetadataSetup,
+} from '@kbn/core-injected-metadata-browser-internal';
const createSetupContractMock = () => {
- const setupContract: jest.Mocked = {
+ const setupContract: jest.Mocked = {
getBasePath: jest.fn(),
getServerBasePath: jest.fn(),
getPublicBaseUrl: jest.fn(),
diff --git a/packages/core/injected-metadata/core-injected-metadata-browser-mocks/tsconfig.json b/packages/core/injected-metadata/core-injected-metadata-browser-mocks/tsconfig.json
new file mode 100644
index 0000000000000..dc20b641b1989
--- /dev/null
+++ b/packages/core/injected-metadata/core-injected-metadata-browser-mocks/tsconfig.json
@@ -0,0 +1,18 @@
+{
+ "extends": "../../../../tsconfig.bazel.json",
+ "compilerOptions": {
+ "declaration": true,
+ "emitDeclarationOnly": true,
+ "outDir": "target_types",
+ "rootDir": "src",
+ "stripInternal": false,
+ "types": [
+ "jest",
+ "node",
+ "react"
+ ]
+ },
+ "include": [
+ "src/**/*"
+ ]
+}
diff --git a/packages/core/injected-metadata/core-injected-metadata-browser/BUILD.bazel b/packages/core/injected-metadata/core-injected-metadata-browser/BUILD.bazel
new file mode 100644
index 0000000000000..ace4ba52be72b
--- /dev/null
+++ b/packages/core/injected-metadata/core-injected-metadata-browser/BUILD.bazel
@@ -0,0 +1,124 @@
+load("@npm//@bazel/typescript:index.bzl", "ts_config")
+load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
+load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project")
+
+PKG_DIRNAME = "core-injected-metadata-browser"
+PKG_REQUIRE_NAME = "@kbn/core-injected-metadata-browser"
+
+SOURCE_FILES = glob(
+ [
+ "src/**/*.ts",
+ "src/**/*.tsx",
+ ],
+ exclude = [
+ "**/*.test.*",
+ ],
+)
+
+SRCS = SOURCE_FILES
+
+filegroup(
+ name = "srcs",
+ srcs = SRCS,
+)
+
+NPM_MODULE_EXTRA_FILES = [
+ "package.json",
+]
+
+# In this array place runtime dependencies, including other packages and NPM packages
+# which must be available for this code to run.
+#
+# To reference other packages use:
+# "//repo/relative/path/to/package"
+# eg. "//packages/kbn-utils"
+#
+# To reference a NPM package use:
+# "@npm//name-of-package"
+# eg. "@npm//lodash"
+RUNTIME_DEPS = [
+ "@npm//react"
+]
+
+# In this array place dependencies necessary to build the types, which will include the
+# :npm_module_types target of other packages and packages from NPM, including @types/*
+# packages.
+#
+# To reference the types for another package use:
+# "//repo/relative/path/to/package:npm_module_types"
+# eg. "//packages/kbn-utils:npm_module_types"
+#
+# References to NPM packages work the same as RUNTIME_DEPS
+TYPES_DEPS = [
+ "@npm//@types/node",
+ "@npm//@types/jest",
+ "@npm//@types/react"
+]
+
+jsts_transpiler(
+ name = "target_node",
+ srcs = SRCS,
+ build_pkg_name = package_name(),
+)
+
+jsts_transpiler(
+ name = "target_web",
+ srcs = SRCS,
+ build_pkg_name = package_name(),
+ web = True,
+)
+
+ts_config(
+ name = "tsconfig",
+ src = "tsconfig.json",
+ deps = [
+ "//:tsconfig.base.json",
+ "//:tsconfig.bazel.json",
+ ],
+)
+
+ts_project(
+ name = "tsc_types",
+ args = ['--pretty'],
+ srcs = SRCS,
+ deps = TYPES_DEPS,
+ declaration = True,
+ emit_declaration_only = True,
+ out_dir = "target_types",
+ root_dir = "src",
+ tsconfig = ":tsconfig",
+)
+
+js_library(
+ name = PKG_DIRNAME,
+ srcs = NPM_MODULE_EXTRA_FILES,
+ deps = RUNTIME_DEPS + [":target_node", ":target_web"],
+ package_name = PKG_REQUIRE_NAME,
+ visibility = ["//visibility:public"],
+)
+
+pkg_npm(
+ name = "npm_module",
+ deps = [":" + PKG_DIRNAME],
+)
+
+filegroup(
+ name = "build",
+ srcs = [":npm_module"],
+ visibility = ["//visibility:public"],
+)
+
+pkg_npm_types(
+ name = "npm_module_types",
+ srcs = SRCS,
+ deps = [":tsc_types"],
+ package_name = PKG_REQUIRE_NAME,
+ tsconfig = ":tsconfig",
+ visibility = ["//visibility:public"],
+)
+
+filegroup(
+ name = "build_types",
+ srcs = [":npm_module_types"],
+ visibility = ["//visibility:public"],
+)
diff --git a/packages/core/injected-metadata/core-injected-metadata-browser/README.md b/packages/core/injected-metadata/core-injected-metadata-browser/README.md
new file mode 100644
index 0000000000000..1008081481fd0
--- /dev/null
+++ b/packages/core/injected-metadata/core-injected-metadata-browser/README.md
@@ -0,0 +1,3 @@
+# @kbn/core-injected-metadata-browser
+
+This package contains the browser public types for the injectedMedata core service.
diff --git a/packages/core/injected-metadata/core-injected-metadata-browser/jest.config.js b/packages/core/injected-metadata/core-injected-metadata-browser/jest.config.js
new file mode 100644
index 0000000000000..211b9925953bd
--- /dev/null
+++ b/packages/core/injected-metadata/core-injected-metadata-browser/jest.config.js
@@ -0,0 +1,13 @@
+/*
+ * 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.
+ */
+
+module.exports = {
+ preset: '@kbn/test',
+ rootDir: '../../../..',
+ roots: ['/packages/core/injected-metadata/core-injected-metadata-browser'],
+};
diff --git a/packages/core/injected-metadata/core-injected-metadata-browser/package.json b/packages/core/injected-metadata/core-injected-metadata-browser/package.json
new file mode 100644
index 0000000000000..df5f22e5bf0d9
--- /dev/null
+++ b/packages/core/injected-metadata/core-injected-metadata-browser/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@kbn/core-injected-metadata-browser",
+ "private": true,
+ "version": "1.0.0",
+ "main": "./target_node/index.js",
+ "browser": "./target_web/index.js",
+ "license": "SSPL-1.0 OR Elastic License 2.0"
+}
diff --git a/packages/core/injected-metadata/core-injected-metadata-browser/src/contract.ts b/packages/core/injected-metadata/core-injected-metadata-browser/src/contract.ts
new file mode 100644
index 0000000000000..ac06c4e75310a
--- /dev/null
+++ b/packages/core/injected-metadata/core-injected-metadata-browser/src/contract.ts
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+
+/**
+ * exposed temporarily until https://github.com/elastic/kibana/issues/41990 done
+ * use *only* to retrieve config values. There is no way to set injected values
+ * in the new platform.
+ * @public
+ * @deprecated
+ * @removeBy 8.8.0
+ */
+export interface InjectedMetadataSetup {
+ getInjectedVar: (name: string, defaultValue?: any) => unknown;
+}
+
+/**
+ * exposed temporarily until https://github.com/elastic/kibana/issues/41990 done
+ * use *only* to retrieve config values. There is no way to set injected values
+ * in the new platform.
+ * @public
+ * @deprecated
+ * @removeBy 8.8.0
+ */
+export interface InjectedMetadataStart {
+ getInjectedVar: (name: string, defaultValue?: any) => unknown;
+}
diff --git a/packages/core/injected-metadata/core-injected-metadata-browser/src/index.ts b/packages/core/injected-metadata/core-injected-metadata-browser/src/index.ts
new file mode 100644
index 0000000000000..827fb634bb932
--- /dev/null
+++ b/packages/core/injected-metadata/core-injected-metadata-browser/src/index.ts
@@ -0,0 +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 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.
+ */
+
+export type { InjectedMetadataStart, InjectedMetadataSetup } from './contract';
diff --git a/packages/core/injected-metadata/core-injected-metadata-browser/tsconfig.json b/packages/core/injected-metadata/core-injected-metadata-browser/tsconfig.json
new file mode 100644
index 0000000000000..dc20b641b1989
--- /dev/null
+++ b/packages/core/injected-metadata/core-injected-metadata-browser/tsconfig.json
@@ -0,0 +1,18 @@
+{
+ "extends": "../../../../tsconfig.bazel.json",
+ "compilerOptions": {
+ "declaration": true,
+ "emitDeclarationOnly": true,
+ "outDir": "target_types",
+ "rootDir": "src",
+ "stripInternal": false,
+ "types": [
+ "jest",
+ "node",
+ "react"
+ ]
+ },
+ "include": [
+ "src/**/*"
+ ]
+}
diff --git a/packages/core/injected-metadata/core-injected-metadata-common-internal/BUILD.bazel b/packages/core/injected-metadata/core-injected-metadata-common-internal/BUILD.bazel
new file mode 100644
index 0000000000000..49bf853fea8de
--- /dev/null
+++ b/packages/core/injected-metadata/core-injected-metadata-common-internal/BUILD.bazel
@@ -0,0 +1,108 @@
+load("@npm//@bazel/typescript:index.bzl", "ts_config")
+load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
+load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project")
+
+PKG_DIRNAME = "core-injected-metadata-common-internal"
+PKG_REQUIRE_NAME = "@kbn/core-injected-metadata-common-internal"
+
+SOURCE_FILES = glob(
+ [
+ "src/**/*.ts",
+ "src/**/*.tsx",
+ ],
+ exclude = [
+ "**/*.test.*",
+ ],
+)
+
+SRCS = SOURCE_FILES
+
+filegroup(
+ name = "srcs",
+ srcs = SRCS,
+)
+
+NPM_MODULE_EXTRA_FILES = [
+ "package.json",
+]
+
+RUNTIME_DEPS = [
+ "@npm//react"
+]
+
+TYPES_DEPS = [
+ "@npm//@types/node",
+ "@npm//@types/jest",
+ "@npm//@types/react",
+ "//packages/kbn-config:npm_module_types",
+ "//packages/kbn-ui-shared-deps-npm:npm_module_types",
+ "//packages/core/base/core-base-common:npm_module_types",
+]
+
+jsts_transpiler(
+ name = "target_node",
+ srcs = SRCS,
+ build_pkg_name = package_name(),
+)
+
+jsts_transpiler(
+ name = "target_web",
+ srcs = SRCS,
+ build_pkg_name = package_name(),
+ web = True,
+)
+
+ts_config(
+ name = "tsconfig",
+ src = "tsconfig.json",
+ deps = [
+ "//:tsconfig.base.json",
+ "//:tsconfig.bazel.json",
+ ],
+)
+
+ts_project(
+ name = "tsc_types",
+ args = ['--pretty'],
+ srcs = SRCS,
+ deps = TYPES_DEPS,
+ declaration = True,
+ emit_declaration_only = True,
+ out_dir = "target_types",
+ root_dir = "src",
+ tsconfig = ":tsconfig",
+)
+
+js_library(
+ name = PKG_DIRNAME,
+ srcs = NPM_MODULE_EXTRA_FILES,
+ deps = RUNTIME_DEPS + [":target_node", ":target_web"],
+ package_name = PKG_REQUIRE_NAME,
+ visibility = ["//visibility:public"],
+)
+
+pkg_npm(
+ name = "npm_module",
+ deps = [":" + PKG_DIRNAME],
+)
+
+filegroup(
+ name = "build",
+ srcs = [":npm_module"],
+ visibility = ["//visibility:public"],
+)
+
+pkg_npm_types(
+ name = "npm_module_types",
+ srcs = SRCS,
+ deps = [":tsc_types"],
+ package_name = PKG_REQUIRE_NAME,
+ tsconfig = ":tsconfig",
+ visibility = ["//visibility:public"],
+)
+
+filegroup(
+ name = "build_types",
+ srcs = [":npm_module_types"],
+ visibility = ["//visibility:public"],
+)
diff --git a/packages/core/injected-metadata/core-injected-metadata-common-internal/README.md b/packages/core/injected-metadata/core-injected-metadata-common-internal/README.md
new file mode 100644
index 0000000000000..1066ac932eaa8
--- /dev/null
+++ b/packages/core/injected-metadata/core-injected-metadata-common-internal/README.md
@@ -0,0 +1,3 @@
+# @kbn/core-injected-metadata-common-internal
+
+This package contains the common internal types for the injectedMedata core domain.
diff --git a/packages/core/injected-metadata/core-injected-metadata-common-internal/jest.config.js b/packages/core/injected-metadata/core-injected-metadata-common-internal/jest.config.js
new file mode 100644
index 0000000000000..86617de17a2d9
--- /dev/null
+++ b/packages/core/injected-metadata/core-injected-metadata-common-internal/jest.config.js
@@ -0,0 +1,13 @@
+/*
+ * 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.
+ */
+
+module.exports = {
+ preset: '@kbn/test',
+ rootDir: '../../../..',
+ roots: ['/packages/core/injected-metadata/core-injected-metadata-common-internal'],
+};
diff --git a/packages/core/injected-metadata/core-injected-metadata-common-internal/package.json b/packages/core/injected-metadata/core-injected-metadata-common-internal/package.json
new file mode 100644
index 0000000000000..0d1d3b9866f0c
--- /dev/null
+++ b/packages/core/injected-metadata/core-injected-metadata-common-internal/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@kbn/core-injected-metadata-common-internal",
+ "private": true,
+ "version": "1.0.0",
+ "main": "./target_node/index.js",
+ "browser": "./target_web/index.js",
+ "license": "SSPL-1.0 OR Elastic License 2.0"
+}
diff --git a/packages/core/injected-metadata/core-injected-metadata-common-internal/src/index.ts b/packages/core/injected-metadata/core-injected-metadata-common-internal/src/index.ts
new file mode 100644
index 0000000000000..7809f1b4ec38a
--- /dev/null
+++ b/packages/core/injected-metadata/core-injected-metadata-common-internal/src/index.ts
@@ -0,0 +1,14 @@
+/*
+ * 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.
+ */
+
+export type {
+ InjectedMetadata,
+ InjectedMetadataClusterInfo,
+ InjectedMetadataExternalUrlPolicy,
+ InjectedMetadataPlugin,
+} from './types';
diff --git a/packages/core/injected-metadata/core-injected-metadata-common-internal/src/types.ts b/packages/core/injected-metadata/core-injected-metadata-common-internal/src/types.ts
new file mode 100644
index 0000000000000..77d7640f2ea17
--- /dev/null
+++ b/packages/core/injected-metadata/core-injected-metadata-common-internal/src/types.ts
@@ -0,0 +1,69 @@
+/*
+ * 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 type { PluginName, DiscoveredPlugin } from '@kbn/core-base-common';
+import type { ThemeVersion } from '@kbn/ui-shared-deps-npm';
+import type { EnvironmentMode, PackageInfo } from '@kbn/config';
+
+/** @internal */
+export interface InjectedMetadataClusterInfo {
+ cluster_uuid?: string;
+ cluster_name?: string;
+ cluster_version?: string;
+}
+
+/** @internal */
+export interface InjectedMetadataPlugin {
+ id: PluginName;
+ plugin: DiscoveredPlugin;
+ config?: {
+ [key: string]: unknown;
+ };
+}
+
+/** @internal */
+export interface InjectedMetadataExternalUrlPolicy {
+ allow: boolean;
+ host?: string;
+ protocol?: string;
+}
+
+/** @internal */
+export interface InjectedMetadata {
+ version: string;
+ buildNumber: number;
+ branch: string;
+ basePath: string;
+ serverBasePath: string;
+ publicBaseUrl?: string;
+ clusterInfo: InjectedMetadataClusterInfo;
+ env: {
+ mode: EnvironmentMode;
+ packageInfo: PackageInfo;
+ };
+ anonymousStatusPage: boolean;
+ i18n: {
+ translationsUrl: string;
+ };
+ theme: {
+ darkMode: boolean;
+ version: ThemeVersion;
+ };
+ csp: {
+ warnLegacyBrowsers: boolean;
+ };
+ externalUrl: { policy: InjectedMetadataExternalUrlPolicy[] };
+ vars: Record;
+ uiPlugins: InjectedMetadataPlugin[];
+ legacyMetadata: {
+ uiSettings: {
+ defaults: Record; // unreferencing UiSettingsParams here
+ user: Record; // unreferencing UserProvidedValues here
+ };
+ };
+}
diff --git a/packages/core/injected-metadata/core-injected-metadata-common-internal/tsconfig.json b/packages/core/injected-metadata/core-injected-metadata-common-internal/tsconfig.json
new file mode 100644
index 0000000000000..dc20b641b1989
--- /dev/null
+++ b/packages/core/injected-metadata/core-injected-metadata-common-internal/tsconfig.json
@@ -0,0 +1,18 @@
+{
+ "extends": "../../../../tsconfig.bazel.json",
+ "compilerOptions": {
+ "declaration": true,
+ "emitDeclarationOnly": true,
+ "outDir": "target_types",
+ "rootDir": "src",
+ "stripInternal": false,
+ "types": [
+ "jest",
+ "node",
+ "react"
+ ]
+ },
+ "include": [
+ "src/**/*"
+ ]
+}
diff --git a/packages/elastic-safer-lodash-set/LICENSE b/packages/elastic-safer-lodash-set/LICENSE
index ca79374b42cec..bae69c938a74c 100644
--- a/packages/elastic-safer-lodash-set/LICENSE
+++ b/packages/elastic-safer-lodash-set/LICENSE
@@ -7,13 +7,6 @@ Copyright (c) JS Foundation and other contributors
Lodash is based on Underscore.js, copyright Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors
-This software consists of voluntary contributions made by many
-individuals. For exact contribution history, see the revision history
-available at the following locations:
- - https://github.com/lodash/lodash
- - https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/lodash
- - https://github.com/elastic/kibana/tree/main/packages/elastic-safer-lodash-set
-
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
@@ -32,3 +25,10 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+This software consists of voluntary contributions made by many
+individuals. For exact contribution history, see the revision history
+available at the following locations:
+ - https://github.com/lodash/lodash
+ - https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/lodash
+ - https://github.com/elastic/kibana/tree/main/packages/elastic-safer-lodash-set
diff --git a/packages/kbn-cli-dev-mode/BUILD.bazel b/packages/kbn-cli-dev-mode/BUILD.bazel
index 4b45e34b7e9fa..e672f98d5b81d 100644
--- a/packages/kbn-cli-dev-mode/BUILD.bazel
+++ b/packages/kbn-cli-dev-mode/BUILD.bazel
@@ -21,7 +21,6 @@ filegroup(
NPM_MODULE_EXTRA_FILES = [
"package.json",
- "README.md"
]
RUNTIME_DEPS = [
diff --git a/packages/kbn-cli-dev-mode/README.md b/packages/kbn-cli-dev-mode/README.md
deleted file mode 100644
index 6ce41249674ce..0000000000000
--- a/packages/kbn-cli-dev-mode/README.md
+++ /dev/null
@@ -1,37 +0,0 @@
-# `CliDevMode`
-
-A class that manages the alternate behavior of the Kibana cli when using the `--dev` flag. This mode provides several useful features in a single CLI for a nice developer experience:
-
- - automatic server restarts when code changes
- - runs the `@kbn/optimizer` to build browser bundles
- - runs a base path proxy which helps developers test that they are writing code which is compatible with custom basePath settings while they work
- - pauses requests when the server or optimizer are not ready to handle requests so that when users load Kibana in the browser it's always using the code as it exists on disk
-
-To accomplish this, and to make it easier to test, the `CliDevMode` class manages several objects:
-
-## `Watcher`
-
-The `Watcher` manages a [chokidar](https://github.com/paulmillr/chokidar) instance to watch the server files, logs about file changes observed and provides an observable to the `DevServer` via its `serverShouldRestart$()` method.
-
-## `DevServer`
-
-The `DevServer` object is responsible for everything related to running and restarting the Kibana server process:
- - listens to restart notifications from the `Watcher` object, sending `SIGKILL` to the existing server and launching a new instance with the current code
- - writes the stdout/stderr logs from the Kibana server to the parent process
- - gracefully kills the process if the SIGINT signal is sent
- - kills the server if the SIGTERM signal is sent, process.exit() is used, a second SIGINT is sent, or the gracefull shutdown times out
- - proxies SIGHUP notifications to the child process, though the core team is working on migrating this functionality to the KP and making this unnecessary
-
-## `Optimizer`
-
-The `Optimizer` object manages a `@kbn/optimizer` instance, adapting its configuration and logging to the data available to the CLI.
-
-## `BasePathProxyServer`
-
-This proxy injects a random three character base path in the URL that Kibana is served from to help ensure that Kibana features
-are written to adapt to custom base path configurations from users.
-
-The basePathProxy also has another important job, ensuring that requests don't fail because the server is restarting and
-that the browser receives front-end assets containing all saved changes. We accomplish this by observing the ready state of
-the `Optimizer` and `DevServer` objects and pausing all requests through the proxy until both objects report that
-they aren't building/restarting based on recently saved changes.
\ No newline at end of file
diff --git a/packages/kbn-cli-dev-mode/README.mdx b/packages/kbn-cli-dev-mode/README.mdx
new file mode 100644
index 0000000000000..487dd19d7433e
--- /dev/null
+++ b/packages/kbn-cli-dev-mode/README.mdx
@@ -0,0 +1,57 @@
+---
+id: kibDevDocsOpsCliDevMode
+slug: /kibana-dev-docs/ops/cli-dev-mode
+title: "@kbn/cli-dev-mode"
+description: A package to manage the Kibana cli behavior when in development
+date: 2022-05-24
+tags: ['kibana', 'dev', 'contributor', 'operations', 'cli', 'dev', 'mode']
+---
+
+This package exposes a function that manages the alternate behavior of the Kibana cli when using
+the `--dev` flag. This mode provides several useful features in a single CLI for a nice developer
+experience:
+
+ - automatic server restarts when code changes
+ - runs the `@kbn/optimizer` to build browser bundles
+ - runs a base path proxy which helps developers test that they are writing code which is
+compatible with custom basePath settings while they work
+ - pauses requests when the server or optimizer are not ready to handle requests so that when
+users load Kibana in the browser it's always using the code as it exists on disk
+
+To accomplish this, and to make it easier to test, the `CliDevMode` class manages the following
+objects.
+
+## `Watcher`
+
+The `Watcher` manages a [chokidar](https://github.com/paulmillr/chokidar) instance to watch the
+server files, logs about file changes observed and provides an observable to the `DevServer` via
+its `serverShouldRestart$()` method.
+
+## `DevServer`
+
+The `DevServer` object is responsible for everything related to running and restarting the Kibana
+server process:
+ - listens to restart notifications from the `Watcher` object, sending `SIGKILL` to the existing
+server and launching a new instance with the current code
+ - writes the stdout/stderr logs from the Kibana server to the parent process
+ - gracefully kills the process if the SIGINT signal is sent
+ - kills the server if the SIGTERM signal is sent, process.exit() is used, a second SIGINT is
+sent, or the graceful shutdown times out
+ - proxies SIGHUP notifications to the child process, though the core team is working on
+migrating this functionality to the KP and making this unnecessary
+
+## `Optimizer`
+
+The `Optimizer` object manages a `@kbn/optimizer` instance, adapting its configuration and
+logging to the data available to the CLI.
+
+## `BasePathProxyServer`
+
+This proxy injects a random three character base path in the URL that Kibana is served from to
+help ensure that Kibana features are written to adapt to custom base path configurations from users.
+
+The basePathProxy also has another important job, ensuring that requests don't fail because the
+server is restarting and that the browser receives front-end assets containing all saved
+changes. We accomplish this by observing the ready state of the `Optimizer` and `DevServer`
+objects and pausing all requests through the proxy until both objects report that they
+aren't building/restarting based on recently saved changes.
\ No newline at end of file
diff --git a/packages/kbn-es-archiver/src/actions/save.ts b/packages/kbn-es-archiver/src/actions/save.ts
index 16f0cbc3c1846..9fcbe45946eb7 100644
--- a/packages/kbn-es-archiver/src/actions/save.ts
+++ b/packages/kbn-es-archiver/src/actions/save.ts
@@ -52,7 +52,7 @@ export async function saveAction({
// export and save the matching indices to mappings.json
createPromiseFromStreams([
createListStream(indices),
- createGenerateIndexRecordsStream({ client, stats, keepIndexNames }),
+ createGenerateIndexRecordsStream({ client, stats, keepIndexNames, log }),
...createFormatArchiveStreams(),
createWriteStream(resolve(outputDir, 'mappings.json')),
] as [Readable, ...Writable[]]),
diff --git a/packages/kbn-es-archiver/src/actions/unload.ts b/packages/kbn-es-archiver/src/actions/unload.ts
index 2d4b16d718689..e564bcbb1a703 100644
--- a/packages/kbn-es-archiver/src/actions/unload.ts
+++ b/packages/kbn-es-archiver/src/actions/unload.ts
@@ -45,7 +45,7 @@ export async function unloadAction({
await createPromiseFromStreams([
createReadStream(resolve(inputDir, filename)) as Readable,
...createParseArchiveStreams({ gzip: isGzip(filename) }),
- createFilterRecordsStream('index'),
+ createFilterRecordsStream((record) => ['index', 'data_stream'].includes(record.type)),
createDeleteIndexStream(client, stats, log),
] as [Readable, ...Writable[]]);
}
diff --git a/packages/kbn-es-archiver/src/lib/docs/generate_doc_records_stream.test.ts b/packages/kbn-es-archiver/src/lib/docs/generate_doc_records_stream.test.ts
index e102ac50c3876..386d6d4a088ce 100644
--- a/packages/kbn-es-archiver/src/lib/docs/generate_doc_records_stream.test.ts
+++ b/packages/kbn-es-archiver/src/lib/docs/generate_doc_records_stream.test.ts
@@ -36,16 +36,29 @@ interface SearchResponses {
}>;
}
-function createMockClient(responses: SearchResponses) {
+function createMockClient(responses: SearchResponses, hasDataStreams = false) {
// TODO: replace with proper mocked client
const client: any = {
helpers: {
scrollSearch: jest.fn(function* ({ index }) {
+ if (hasDataStreams) {
+ index = `.ds-${index}`;
+ }
+
while (responses[index] && responses[index].length) {
yield responses[index].shift()!;
}
}),
},
+ indices: {
+ get: jest.fn(async ({ index }) => {
+ return { [index]: { data_stream: hasDataStreams && index.substring(4) } };
+ }),
+ getDataStream: jest.fn(async ({ name }) => {
+ if (!hasDataStreams) return { data_streams: [] };
+ return { data_streams: [{ name }] };
+ }),
+ },
};
return client;
}
@@ -217,6 +230,35 @@ describe('esArchiver: createGenerateDocRecordsStream()', () => {
`);
});
+ it('supports data streams', async () => {
+ const hits = [
+ { _index: '.ds-foo-datastream', _id: '0', _source: {} },
+ { _index: '.ds-foo-datastream', _id: '1', _source: {} },
+ ];
+ const responses = {
+ '.ds-foo-datastream': [{ body: { hits: { hits, total: hits.length } } }],
+ };
+ const client = createMockClient(responses, true);
+
+ const stats = createStats('test', log);
+ const progress = new Progress();
+
+ const results = await createPromiseFromStreams([
+ createListStream(['foo-datastream']),
+ createGenerateDocRecordsStream({
+ client,
+ stats,
+ progress,
+ }),
+ createMapStream((record: any) => {
+ return `${record.value.data_stream}:${record.value.id}`;
+ }),
+ createConcatStream([]),
+ ]);
+
+ expect(results).toEqual(['foo-datastream:0', 'foo-datastream:1']);
+ });
+
describe('keepIndexNames', () => {
it('changes .kibana* index names if keepIndexNames is not enabled', async () => {
const hits = [{ _index: '.kibana_7.16.0_001', _id: '0', _source: {} }];
diff --git a/packages/kbn-es-archiver/src/lib/docs/generate_doc_records_stream.ts b/packages/kbn-es-archiver/src/lib/docs/generate_doc_records_stream.ts
index 40907bd0af238..6e3310a7347e7 100644
--- a/packages/kbn-es-archiver/src/lib/docs/generate_doc_records_stream.ts
+++ b/packages/kbn-es-archiver/src/lib/docs/generate_doc_records_stream.ts
@@ -47,6 +47,10 @@ export function createGenerateDocRecordsStream({
}
);
+ const hasDatastreams =
+ (await client.indices.getDataStream({ name: index })).data_streams.length > 0;
+ const indexToDatastream = new Map();
+
let remainingHits: number | null = null;
for await (const resp of interator) {
@@ -57,7 +61,17 @@ export function createGenerateDocRecordsStream({
for (const hit of resp.body.hits.hits) {
remainingHits -= 1;
- stats.archivedDoc(hit._index);
+
+ if (hasDatastreams && !indexToDatastream.has(hit._index)) {
+ const {
+ [hit._index]: { data_stream: dataStream },
+ } = await client.indices.get({ index: hit._index, filter_path: ['*.data_stream'] });
+ indexToDatastream.set(hit._index, dataStream);
+ }
+
+ const dataStream = indexToDatastream.get(hit._index);
+ stats.archivedDoc(dataStream || hit._index);
+
this.push({
type: 'doc',
value: {
@@ -65,6 +79,7 @@ export function createGenerateDocRecordsStream({
// when it is loaded it can skip migration, if possible
index:
hit._index.startsWith('.kibana') && !keepIndexNames ? '.kibana_1' : hit._index,
+ data_stream: dataStream,
id: hit._id,
source: hit._source,
},
diff --git a/packages/kbn-es-archiver/src/lib/docs/index_doc_records_stream.test.ts b/packages/kbn-es-archiver/src/lib/docs/index_doc_records_stream.test.ts
index 5dc9b4b7bd8dd..c1bb94ee13498 100644
--- a/packages/kbn-es-archiver/src/lib/docs/index_doc_records_stream.test.ts
+++ b/packages/kbn-es-archiver/src/lib/docs/index_doc_records_stream.test.ts
@@ -243,6 +243,55 @@ describe('bulk helper onDocument param', () => {
createIndexDocRecordsStream(client as any, stats, progress, true),
]);
});
+
+ it('returns create ops for data stream documents', async () => {
+ const records = [
+ {
+ type: 'doc',
+ value: {
+ index: '.ds-foo-ds',
+ data_stream: 'foo-ds',
+ id: '0',
+ source: {
+ hello: 'world',
+ },
+ },
+ },
+ {
+ type: 'doc',
+ value: {
+ index: '.ds-foo-ds',
+ data_stream: 'foo-ds',
+ id: '1',
+ source: {
+ hello: 'world',
+ },
+ },
+ },
+ ];
+ expect.assertions(records.length);
+
+ const client = new MockClient();
+ client.helpers.bulk.mockImplementation(async ({ datasource, onDocument }) => {
+ for (const d of datasource) {
+ const op = onDocument(d);
+ expect(op).toEqual({
+ create: {
+ _index: 'foo-ds',
+ _id: expect.stringMatching(/^\d$/),
+ },
+ });
+ }
+ });
+
+ const stats = createStats('test', log);
+ const progress = new Progress();
+
+ await createPromiseFromStreams([
+ createListStream(records),
+ createIndexDocRecordsStream(client as any, stats, progress),
+ ]);
+ });
});
describe('bulk helper onDrop param', () => {
diff --git a/packages/kbn-es-archiver/src/lib/docs/index_doc_records_stream.ts b/packages/kbn-es-archiver/src/lib/docs/index_doc_records_stream.ts
index 749bfd0872353..40e1c1932aeee 100644
--- a/packages/kbn-es-archiver/src/lib/docs/index_doc_records_stream.ts
+++ b/packages/kbn-es-archiver/src/lib/docs/index_doc_records_stream.ts
@@ -13,6 +13,11 @@ import { Stats } from '../stats';
import { Progress } from '../progress';
import { ES_CLIENT_HEADERS } from '../../client_headers';
+enum BulkOperation {
+ Create = 'create',
+ Index = 'index',
+}
+
export function createIndexDocRecordsStream(
client: Client,
stats: Stats,
@@ -20,7 +25,7 @@ export function createIndexDocRecordsStream(
useCreate: boolean = false
) {
async function indexDocs(docs: any[]) {
- const operation = useCreate === true ? 'create' : 'index';
+ const operation = useCreate === true ? BulkOperation.Create : BulkOperation.Index;
const ops = new WeakMap();
const errors: string[] = [];
@@ -29,9 +34,11 @@ export function createIndexDocRecordsStream(
retries: 5,
datasource: docs.map((doc) => {
const body = doc.source;
+ const op = doc.data_stream ? BulkOperation.Create : operation;
+ const index = doc.data_stream || doc.index;
ops.set(body, {
- [operation]: {
- _index: doc.index,
+ [op]: {
+ _index: index,
_id: doc.id,
},
});
@@ -56,7 +63,7 @@ export function createIndexDocRecordsStream(
}
for (const doc of docs) {
- stats.indexedDoc(doc.index);
+ stats.indexedDoc(doc.data_stream || doc.index);
}
}
diff --git a/packages/kbn-es-archiver/src/lib/index.ts b/packages/kbn-es-archiver/src/lib/index.ts
index ee37591e1f2c3..8a857fb24002a 100644
--- a/packages/kbn-es-archiver/src/lib/index.ts
+++ b/packages/kbn-es-archiver/src/lib/index.ts
@@ -33,3 +33,5 @@ export {
export { readDirectory } from './directory';
export { Progress } from './progress';
+
+export { getIndexTemplate } from './index_template';
diff --git a/packages/kbn-es-archiver/src/lib/index_template.test.ts b/packages/kbn-es-archiver/src/lib/index_template.test.ts
new file mode 100644
index 0000000000000..b8f5330663ee1
--- /dev/null
+++ b/packages/kbn-es-archiver/src/lib/index_template.test.ts
@@ -0,0 +1,105 @@
+/*
+ * 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 type { Client } from '@elastic/elasticsearch';
+
+import sinon from 'sinon';
+import { getIndexTemplate } from './index_template';
+
+describe('esArchiver: index template', () => {
+ describe('getIndexTemplate', () => {
+ it('returns the index template', async () => {
+ const client = {
+ indices: {
+ getIndexTemplate: sinon.stub().resolves({
+ index_templates: [
+ {
+ index_template: {
+ index_patterns: ['pattern-*'],
+ template: {
+ mappings: { properties: { foo: { type: 'keyword' } } },
+ },
+ priority: 500,
+ composed_of: [],
+ data_stream: { hidden: false },
+ },
+ },
+ ],
+ }),
+ },
+ } as unknown as Client;
+
+ const template = await getIndexTemplate(client, 'template-foo');
+
+ expect(template).toEqual({
+ name: 'template-foo',
+ index_patterns: ['pattern-*'],
+ template: {
+ mappings: { properties: { foo: { type: 'keyword' } } },
+ },
+ priority: 500,
+ data_stream: { hidden: false },
+ });
+ });
+
+ it('resolves component templates', async () => {
+ const client = {
+ indices: {
+ getIndexTemplate: sinon.stub().resolves({
+ index_templates: [
+ {
+ index_template: {
+ index_patterns: ['pattern-*'],
+ composed_of: ['the-settings', 'the-mappings'],
+ },
+ },
+ ],
+ }),
+ },
+ cluster: {
+ getComponentTemplate: sinon
+ .stub()
+ .onFirstCall()
+ .resolves({
+ component_templates: [
+ {
+ component_template: {
+ template: {
+ aliases: { 'foo-alias': {} },
+ },
+ },
+ },
+ ],
+ })
+ .onSecondCall()
+ .resolves({
+ component_templates: [
+ {
+ component_template: {
+ template: {
+ mappings: { properties: { foo: { type: 'keyword' } } },
+ },
+ },
+ },
+ ],
+ }),
+ },
+ } as unknown as Client;
+
+ const template = await getIndexTemplate(client, 'template-foo');
+
+ expect(template).toEqual({
+ name: 'template-foo',
+ index_patterns: ['pattern-*'],
+ template: {
+ aliases: { 'foo-alias': {} },
+ mappings: { properties: { foo: { type: 'keyword' } } },
+ },
+ });
+ });
+ });
+});
diff --git a/packages/kbn-es-archiver/src/lib/index_template.ts b/packages/kbn-es-archiver/src/lib/index_template.ts
new file mode 100644
index 0000000000000..9d67add9757db
--- /dev/null
+++ b/packages/kbn-es-archiver/src/lib/index_template.ts
@@ -0,0 +1,37 @@
+/*
+ * 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 { merge } from 'lodash';
+import type { Client } from '@elastic/elasticsearch';
+
+import { ES_CLIENT_HEADERS } from '../client_headers';
+
+export const getIndexTemplate = async (client: Client, templateName: string) => {
+ const { index_templates: indexTemplates } = await client.indices.getIndexTemplate(
+ { name: templateName },
+ { headers: ES_CLIENT_HEADERS }
+ );
+ const {
+ index_template: { template, composed_of: composedOf = [], ...indexTemplate },
+ } = indexTemplates[0];
+
+ const components = await Promise.all(
+ composedOf.map(async (component) => {
+ const { component_templates: componentTemplates } = await client.cluster.getComponentTemplate(
+ { name: component }
+ );
+ return componentTemplates[0].component_template.template;
+ })
+ );
+
+ return {
+ ...indexTemplate,
+ name: templateName,
+ template: merge(template, ...components),
+ };
+};
diff --git a/packages/kbn-es-archiver/src/lib/indices/__mocks__/stubs.ts b/packages/kbn-es-archiver/src/lib/indices/__mocks__/stubs.ts
index c60c920100174..1bfbc80f52a19 100644
--- a/packages/kbn-es-archiver/src/lib/indices/__mocks__/stubs.ts
+++ b/packages/kbn-es-archiver/src/lib/indices/__mocks__/stubs.ts
@@ -19,7 +19,9 @@ export const createStubStats = (): StubStats =>
({
createdIndex: sinon.stub(),
createdAliases: sinon.stub(),
+ createdDataStream: sinon.stub(),
deletedIndex: sinon.stub(),
+ deletedDataStream: sinon.stub(),
skippedIndex: sinon.stub(),
archivedIndex: sinon.stub(),
getTestSummary() {
@@ -47,6 +49,11 @@ export const createStubIndexRecord = (index: string, aliases = {}) => ({
value: { index, aliases },
});
+export const createStubDataStreamRecord = (dataStream: string, template: string) => ({
+ type: 'data_stream',
+ value: { data_stream: dataStream, template: { name: template } },
+});
+
export const createStubDocRecord = (index: string, id: number) => ({
type: 'doc',
value: { index, id },
@@ -140,5 +147,10 @@ export const createStubClient = (
exists: sinon.spy(async () => {
throw new Error('Do not use indices.exists(). React to errors instead.');
}),
+
+ createDataStream: sinon.spy(async ({ name }) => {}),
+ deleteDataStream: sinon.spy(async ({ name }) => {}),
+ putIndexTemplate: sinon.spy(async ({ name }) => {}),
+ deleteIndexTemplate: sinon.spy(async ({ name }) => {}),
},
} as any);
diff --git a/packages/kbn-es-archiver/src/lib/indices/create_index_stream.test.ts b/packages/kbn-es-archiver/src/lib/indices/create_index_stream.test.ts
index 615555b405e44..15efa53921743 100644
--- a/packages/kbn-es-archiver/src/lib/indices/create_index_stream.test.ts
+++ b/packages/kbn-es-archiver/src/lib/indices/create_index_stream.test.ts
@@ -17,6 +17,7 @@ import { createCreateIndexStream } from './create_index_stream';
import {
createStubStats,
createStubIndexRecord,
+ createStubDataStreamRecord,
createStubDocRecord,
createStubClient,
createStubLogger,
@@ -171,6 +172,19 @@ describe('esArchiver: createCreateIndexStream()', () => {
expect(output).toEqual(nonRecordValues);
});
+
+ it('creates data streams', async () => {
+ const client = createStubClient();
+ const stats = createStubStats();
+
+ await createPromiseFromStreams([
+ createListStream([createStubDataStreamRecord('foo-datastream', 'foo-template')]),
+ createCreateIndexStream({ client, stats, log }),
+ ]);
+
+ sinon.assert.calledOnce(client.indices.putIndexTemplate as sinon.SinonSpy);
+ sinon.assert.calledOnce(client.indices.createDataStream as sinon.SinonSpy);
+ });
});
describe('deleteKibanaIndices', () => {
diff --git a/packages/kbn-es-archiver/src/lib/indices/create_index_stream.ts b/packages/kbn-es-archiver/src/lib/indices/create_index_stream.ts
index 2ab53a2ca012c..38f4bed755262 100644
--- a/packages/kbn-es-archiver/src/lib/indices/create_index_stream.ts
+++ b/packages/kbn-es-archiver/src/lib/indices/create_index_stream.ts
@@ -13,15 +13,18 @@ import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type { Client } from '@elastic/elasticsearch';
import { ToolingLog } from '@kbn/tooling-log';
+import { IndicesPutIndexTemplateRequest } from '@elastic/elasticsearch/lib/api/types';
import { Stats } from '../stats';
import { deleteKibanaIndices } from './kibana_index';
import { deleteIndex } from './delete_index';
+import { deleteDataStream } from './delete_data_stream';
import { ES_CLIENT_HEADERS } from '../../client_headers';
interface DocRecord {
value: estypes.IndicesIndexState & {
index: string;
type: string;
+ template?: IndicesPutIndexTemplateRequest;
};
}
@@ -54,6 +57,43 @@ export function createCreateIndexStream({
stream.push(record);
}
+ async function handleDataStream(record: DocRecord, attempts = 1) {
+ if (docsOnly) return;
+
+ const { data_stream: dataStream, template } = record.value as {
+ data_stream: string;
+ template: IndicesPutIndexTemplateRequest;
+ };
+
+ try {
+ await client.indices.putIndexTemplate(template, {
+ headers: ES_CLIENT_HEADERS,
+ });
+
+ await client.indices.createDataStream(
+ { name: dataStream },
+ {
+ headers: ES_CLIENT_HEADERS,
+ }
+ );
+ stats.createdDataStream(dataStream, template.name, { template });
+ } catch (err) {
+ if (err?.meta?.body?.error?.type !== 'resource_already_exists_exception' || attempts >= 3) {
+ throw err;
+ }
+
+ if (skipExisting) {
+ skipDocsFromIndices.add(dataStream);
+ stats.skippedIndex(dataStream);
+ return;
+ }
+
+ await deleteDataStream(client, dataStream, template.name);
+ stats.deletedDataStream(dataStream, template.name);
+ await handleDataStream(record, attempts + 1);
+ }
+ }
+
async function handleIndex(record: DocRecord) {
const { index, settings, mappings, aliases } = record.value;
const isKibanaTaskManager = index.startsWith('.kibana_task_manager');
@@ -134,6 +174,10 @@ export function createCreateIndexStream({
await handleIndex(record);
break;
+ case 'data_stream':
+ await handleDataStream(record);
+ break;
+
case 'doc':
await handleDoc(this, record);
break;
diff --git a/packages/kbn-es-archiver/src/lib/indices/delete_data_stream.ts b/packages/kbn-es-archiver/src/lib/indices/delete_data_stream.ts
new file mode 100644
index 0000000000000..6aa68db4216f4
--- /dev/null
+++ b/packages/kbn-es-archiver/src/lib/indices/delete_data_stream.ts
@@ -0,0 +1,14 @@
+/*
+ * 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 type { Client } from '@elastic/elasticsearch';
+
+export async function deleteDataStream(client: Client, datastream: string, template: string) {
+ await client.indices.deleteDataStream({ name: datastream });
+ await client.indices.deleteIndexTemplate({ name: template });
+}
diff --git a/packages/kbn-es-archiver/src/lib/indices/delete_index_stream.test.ts b/packages/kbn-es-archiver/src/lib/indices/delete_index_stream.test.ts
index 241d4a8944546..4917deab542d4 100644
--- a/packages/kbn-es-archiver/src/lib/indices/delete_index_stream.test.ts
+++ b/packages/kbn-es-archiver/src/lib/indices/delete_index_stream.test.ts
@@ -16,6 +16,7 @@ import {
createStubStats,
createStubClient,
createStubIndexRecord,
+ createStubDataStreamRecord,
createStubLogger,
} from './__mocks__/stubs';
@@ -51,4 +52,25 @@ describe('esArchiver: createDeleteIndexStream()', () => {
sinon.assert.calledOnce(client.indices.delete as sinon.SinonSpy);
sinon.assert.notCalled(client.indices.exists as sinon.SinonSpy);
});
+
+ it('deletes data streams', async () => {
+ const stats = createStubStats();
+ const client = createStubClient([]);
+
+ await createPromiseFromStreams([
+ createListStream([createStubDataStreamRecord('foo-datastream', 'foo-template')]),
+ createDeleteIndexStream(client, stats, log),
+ ]);
+
+ sinon.assert.calledOnce(stats.deletedDataStream as sinon.SinonSpy);
+ sinon.assert.notCalled(client.indices.create as sinon.SinonSpy);
+ sinon.assert.calledOnce(client.indices.deleteDataStream as sinon.SinonSpy);
+ sinon.assert.calledWith(client.indices.deleteDataStream as sinon.SinonSpy, {
+ name: 'foo-datastream',
+ });
+ sinon.assert.calledOnce(client.indices.deleteIndexTemplate as sinon.SinonSpy);
+ sinon.assert.calledWith(client.indices.deleteIndexTemplate as sinon.SinonSpy, {
+ name: 'foo-template',
+ });
+ });
});
diff --git a/packages/kbn-es-archiver/src/lib/indices/delete_index_stream.ts b/packages/kbn-es-archiver/src/lib/indices/delete_index_stream.ts
index 450d575181529..c7633465ccc4c 100644
--- a/packages/kbn-es-archiver/src/lib/indices/delete_index_stream.ts
+++ b/packages/kbn-es-archiver/src/lib/indices/delete_index_stream.ts
@@ -13,6 +13,7 @@ import { ToolingLog } from '@kbn/tooling-log';
import { Stats } from '../stats';
import { deleteIndex } from './delete_index';
import { cleanKibanaIndices } from './kibana_index';
+import { deleteDataStream } from './delete_data_stream';
export function createDeleteIndexStream(client: Client, stats: Stats, log: ToolingLog) {
return new Transform({
@@ -20,7 +21,11 @@ export function createDeleteIndexStream(client: Client, stats: Stats, log: Tooli
writableObjectMode: true,
async transform(record, enc, callback) {
try {
- if (!record || record.type === 'index') {
+ if (!record) {
+ log.warning(`deleteIndexStream: empty index provided`);
+ return callback();
+ }
+ if (record.type === 'index') {
const { index } = record.value;
if (index.startsWith('.kibana')) {
@@ -28,6 +33,14 @@ export function createDeleteIndexStream(client: Client, stats: Stats, log: Tooli
} else {
await deleteIndex({ client, stats, log, index });
}
+ } else if (record.type === 'data_stream') {
+ const {
+ data_stream: dataStream,
+ template: { name },
+ } = record.value;
+
+ await deleteDataStream(client, dataStream, name);
+ stats.deletedDataStream(dataStream, name);
} else {
this.push(record);
}
diff --git a/packages/kbn-es-archiver/src/lib/indices/generate_index_records_stream.test.ts b/packages/kbn-es-archiver/src/lib/indices/generate_index_records_stream.test.ts
index fbd351cea63a9..566760b0ddf88 100644
--- a/packages/kbn-es-archiver/src/lib/indices/generate_index_records_stream.test.ts
+++ b/packages/kbn-es-archiver/src/lib/indices/generate_index_records_stream.test.ts
@@ -9,10 +9,12 @@
import sinon from 'sinon';
import { createListStream, createPromiseFromStreams, createConcatStream } from '@kbn/utils';
-import { createStubClient, createStubStats } from './__mocks__/stubs';
+import { createStubClient, createStubLogger, createStubStats } from './__mocks__/stubs';
import { createGenerateIndexRecordsStream } from './generate_index_records_stream';
+const log = createStubLogger();
+
describe('esArchiver: createGenerateIndexRecordsStream()', () => {
it('consumes index names and queries for the mapping of each', async () => {
const indices = ['index1', 'index2', 'index3', 'index4'];
@@ -21,7 +23,7 @@ describe('esArchiver: createGenerateIndexRecordsStream()', () => {
await createPromiseFromStreams([
createListStream(indices),
- createGenerateIndexRecordsStream({ client, stats }),
+ createGenerateIndexRecordsStream({ client, stats, log }),
]);
expect(stats.getTestSummary()).toEqual({
@@ -40,7 +42,7 @@ describe('esArchiver: createGenerateIndexRecordsStream()', () => {
await createPromiseFromStreams([
createListStream(['index1']),
- createGenerateIndexRecordsStream({ client, stats }),
+ createGenerateIndexRecordsStream({ client, stats, log }),
]);
const params = (client.indices.get as sinon.SinonSpy).args[0][0];
@@ -58,7 +60,7 @@ describe('esArchiver: createGenerateIndexRecordsStream()', () => {
const indexRecords = await createPromiseFromStreams([
createListStream(['index1', 'index2', 'index3']),
- createGenerateIndexRecordsStream({ client, stats }),
+ createGenerateIndexRecordsStream({ client, stats, log }),
createConcatStream([]),
]);
@@ -83,7 +85,7 @@ describe('esArchiver: createGenerateIndexRecordsStream()', () => {
const indexRecords = await createPromiseFromStreams([
createListStream(['index1']),
- createGenerateIndexRecordsStream({ client, stats }),
+ createGenerateIndexRecordsStream({ client, stats, log }),
createConcatStream([]),
]);
@@ -107,7 +109,7 @@ describe('esArchiver: createGenerateIndexRecordsStream()', () => {
const indexRecords = await createPromiseFromStreams([
createListStream(['.kibana_7.16.0_001']),
- createGenerateIndexRecordsStream({ client, stats }),
+ createGenerateIndexRecordsStream({ client, stats, log }),
createConcatStream([]),
]);
@@ -122,7 +124,7 @@ describe('esArchiver: createGenerateIndexRecordsStream()', () => {
const indexRecords = await createPromiseFromStreams([
createListStream(['.foo']),
- createGenerateIndexRecordsStream({ client, stats }),
+ createGenerateIndexRecordsStream({ client, stats, log }),
createConcatStream([]),
]);
@@ -137,7 +139,7 @@ describe('esArchiver: createGenerateIndexRecordsStream()', () => {
const indexRecords = await createPromiseFromStreams([
createListStream(['.kibana_7.16.0_001']),
- createGenerateIndexRecordsStream({ client, stats, keepIndexNames: true }),
+ createGenerateIndexRecordsStream({ client, stats, log, keepIndexNames: true }),
createConcatStream([]),
]);
diff --git a/packages/kbn-es-archiver/src/lib/indices/generate_index_records_stream.ts b/packages/kbn-es-archiver/src/lib/indices/generate_index_records_stream.ts
index e3efaa2851609..de32e93e27398 100644
--- a/packages/kbn-es-archiver/src/lib/indices/generate_index_records_stream.ts
+++ b/packages/kbn-es-archiver/src/lib/indices/generate_index_records_stream.ts
@@ -8,18 +8,28 @@
import type { Client } from '@elastic/elasticsearch';
import { Transform } from 'stream';
+import { ToolingLog } from '@kbn/tooling-log';
import { Stats } from '../stats';
import { ES_CLIENT_HEADERS } from '../../client_headers';
+import { getIndexTemplate } from '..';
+
+const headers = {
+ headers: ES_CLIENT_HEADERS,
+};
export function createGenerateIndexRecordsStream({
client,
stats,
keepIndexNames,
+ log,
}: {
client: Client;
stats: Stats;
keepIndexNames?: boolean;
+ log: ToolingLog;
}) {
+ const seenDatastreams = new Set();
+
return new Transform({
writableObjectMode: true,
readableObjectMode: true,
@@ -32,6 +42,7 @@ export function createGenerateIndexRecordsStream({
filter_path: [
'*.settings',
'*.mappings',
+ '*.data_stream',
// remove settings that aren't really settings
'-*.settings.index.creation_date',
'-*.settings.index.uuid',
@@ -44,37 +55,58 @@ export function createGenerateIndexRecordsStream({
],
},
{
- headers: ES_CLIENT_HEADERS,
+ ...headers,
meta: true,
}
)
).body;
- for (const [index, { settings, mappings }] of Object.entries(resp)) {
- const {
- body: {
- [index]: { aliases },
- },
- } = await client.indices.getAlias(
- { index },
- {
- headers: ES_CLIENT_HEADERS,
- meta: true,
+ for (const [index, { data_stream: dataStream, settings, mappings }] of Object.entries(
+ resp
+ )) {
+ if (dataStream) {
+ log.info(`${index} will be saved as data_stream ${dataStream}`);
+
+ if (seenDatastreams.has(dataStream)) {
+ log.info(`${dataStream} is already archived`);
+ continue;
}
- );
- stats.archivedIndex(index, { settings, mappings });
- this.push({
- type: 'index',
- value: {
- // if keepIndexNames is false, rewrite the .kibana_* index to .kibana_1 so that
- // when it is loaded it can skip migration, if possible
- index: index.startsWith('.kibana') && !keepIndexNames ? '.kibana_1' : index,
- settings,
- mappings,
- aliases,
- },
- });
+ const { data_streams: dataStreams } = await client.indices.getDataStream(
+ { name: dataStream },
+ headers
+ );
+ const template = await getIndexTemplate(client, dataStreams[0].template);
+
+ seenDatastreams.add(dataStream);
+ stats.archivedIndex(dataStream, { template });
+ this.push({
+ type: 'data_stream',
+ value: {
+ data_stream: dataStream,
+ template,
+ },
+ });
+ } else {
+ const {
+ body: {
+ [index]: { aliases },
+ },
+ } = await client.indices.getAlias({ index }, { ...headers, meta: true });
+
+ stats.archivedIndex(index, { settings, mappings });
+ this.push({
+ type: 'index',
+ value: {
+ // if keepIndexNames is false, rewrite the .kibana_* index to .kibana_1 so that
+ // when it is loaded it can skip migration, if possible
+ index: index.startsWith('.kibana') && !keepIndexNames ? '.kibana_1' : index,
+ settings,
+ mappings,
+ aliases,
+ },
+ });
+ }
}
callback();
diff --git a/packages/kbn-es-archiver/src/lib/records/filter_records_stream.test.ts b/packages/kbn-es-archiver/src/lib/records/filter_records_stream.test.ts
index 506507ba0b9e6..901664988d165 100644
--- a/packages/kbn-es-archiver/src/lib/records/filter_records_stream.test.ts
+++ b/packages/kbn-es-archiver/src/lib/records/filter_records_stream.test.ts
@@ -26,7 +26,7 @@ describe('esArchiver: createFilterRecordsStream()', () => {
},
chance.bool(),
]),
- createFilterRecordsStream('type'),
+ createFilterRecordsStream((record) => record.type === 'type'),
createConcatStream([]),
]);
@@ -45,7 +45,7 @@ describe('esArchiver: createFilterRecordsStream()', () => {
{ type: chance.word({ length: 10 }), value: {} },
{ type: chance.word({ length: 10 }), value: {} },
]),
- createFilterRecordsStream(type1),
+ createFilterRecordsStream((record) => record.type === type1),
createConcatStream([]),
]);
diff --git a/packages/kbn-es-archiver/src/lib/records/filter_records_stream.ts b/packages/kbn-es-archiver/src/lib/records/filter_records_stream.ts
index 69ab06454f93b..9ded38a6f2b58 100644
--- a/packages/kbn-es-archiver/src/lib/records/filter_records_stream.ts
+++ b/packages/kbn-es-archiver/src/lib/records/filter_records_stream.ts
@@ -8,13 +8,13 @@
import { Transform } from 'stream';
-export function createFilterRecordsStream(type: string) {
+export function createFilterRecordsStream(fn: (record: any) => boolean) {
return new Transform({
writableObjectMode: true,
readableObjectMode: true,
transform(record, enc, callback) {
- if (record && record.type === type) {
+ if (record && fn(record)) {
callback(undefined, record);
} else {
callback();
diff --git a/packages/kbn-es-archiver/src/lib/stats.ts b/packages/kbn-es-archiver/src/lib/stats.ts
index 9ff16d57b8661..1b533a18acade 100644
--- a/packages/kbn-es-archiver/src/lib/stats.ts
+++ b/packages/kbn-es-archiver/src/lib/stats.ts
@@ -83,6 +83,15 @@ export function createStats(name: string, log: ToolingLog) {
info('Deleted existing index %j', index);
}
+ /**
+ * Record that a data stream was deleted
+ * @param index
+ */
+ public deletedDataStream(stream: string, template: string) {
+ getOrCreate(stream).deleted = true;
+ info('Deleted existing data stream %j with index template %j', stream, template);
+ }
+
/**
* Record that an index was created
* @param index
@@ -95,6 +104,18 @@ export function createStats(name: string, log: ToolingLog) {
});
}
+ /**
+ * Record that a data stream was created
+ * @param index
+ */
+ public createdDataStream(stream: string, template: string, metadata: Record = {}) {
+ getOrCreate(stream).created = true;
+ info('Created data stream %j with index template %j', stream, template);
+ Object.keys(metadata).forEach((key) => {
+ debug('%j %s %j', stream, key, metadata[key]);
+ });
+ }
+
/**
* Record that an index was written to the archives
* @param index
diff --git a/packages/kbn-es-query/src/es_query/types.ts b/packages/kbn-es-query/src/es_query/types.ts
index f746e652d2183..14e091ed5b7f2 100644
--- a/packages/kbn-es-query/src/es_query/types.ts
+++ b/packages/kbn-es-query/src/es_query/types.ts
@@ -14,17 +14,19 @@ import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
*/
export type IFieldSubType = IFieldSubTypeMultiOptional | IFieldSubTypeNestedOptional;
-export interface IFieldSubTypeMultiOptional {
+// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
+export type IFieldSubTypeMultiOptional = {
multi?: { parent: string };
-}
+};
export interface IFieldSubTypeMulti {
multi: { parent: string };
}
-export interface IFieldSubTypeNestedOptional {
+// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
+export type IFieldSubTypeNestedOptional = {
nested?: { path: string };
-}
+};
export interface IFieldSubTypeNested {
nested: { path: string };
@@ -34,7 +36,8 @@ export interface IFieldSubTypeNested {
* A base interface for an index pattern field
* @public
*/
-export interface DataViewFieldBase {
+// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
+export type DataViewFieldBase = {
name: string;
/**
* Kibana field type
@@ -46,22 +49,23 @@ export interface DataViewFieldBase {
*/
script?: string;
/**
- * Scripted field langauge
+ * Scripted field language
* Painless is the only valid scripted field language
*/
lang?: estypes.ScriptLanguage;
scripted?: boolean;
-}
+};
/**
* A base interface for an index pattern
* @public
*/
-export interface DataViewBase {
+// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
+export type DataViewBase = {
fields: DataViewFieldBase[];
id?: string;
title: string;
-}
+};
export interface BoolQuery {
must: estypes.QueryDslQueryContainer[];
diff --git a/packages/kbn-es/BUILD.bazel b/packages/kbn-es/BUILD.bazel
index 2ea9c32858dd3..892cd43244de7 100644
--- a/packages/kbn-es/BUILD.bazel
+++ b/packages/kbn-es/BUILD.bazel
@@ -24,7 +24,6 @@ filegroup(
NPM_MODULE_EXTRA_FILES = [
"package.json",
- "README.md",
]
RUNTIME_DEPS = [
diff --git a/packages/kbn-es/README.md b/packages/kbn-es/README.mdx
similarity index 70%
rename from packages/kbn-es/README.md
rename to packages/kbn-es/README.mdx
index 80850c9e6a09c..a5392504490fe 100644
--- a/packages/kbn-es/README.md
+++ b/packages/kbn-es/README.mdx
@@ -1,6 +1,13 @@
-# @kbn/es
+---
+id: kibDevDocsOpsEs
+slug: /kibana-dev-docs/ops/es
+title: "@kbn/es"
+description: A cli package for running elasticsearch or building snapshot artifacts
+date: 2022-05-24
+tags: ['kibana', 'dev', 'contributor', 'operations', 'es']
+---
-> A command line utility for running elasticsearch from source or archive.
+> A command line utility for running elasticsearch from snapshot, source, archive or even building snapshot artifacts.
## Getting started
If running elasticsearch from source, elasticsearch needs to be cloned to a sibling directory of Kibana.
@@ -71,41 +78,20 @@ To use these steps you'll need to setup the google-cloud-sdk, which can be insta
1. Clone the elasticsearch repo somewhere
2. Checkout the branch you want to build
- 3. Run the following to delete old distributables
+ 3. Build the new artifacts
```
- find distribution/archives -type f \( -name 'elasticsearch-*-*.tar.gz' -o -name 'elasticsearch-*-*.zip' \) -not -path *no-jdk* -exec rm {} \;
+ node scripts/es build_snapshots --output=~/Downloads/tmp-artifacts --source-path=/path/to/es/repo
```
- 4. Build the new artifacts
-
- ```
- ./gradlew -p distribution/archives assemble --parallel
- ```
-
- 4. Copy new artifacts to your `~/Downloads/tmp-artifacts`
-
- ```
- rm -rf ~/Downloads/tmp-artifacts
- mkdir ~/Downloads/tmp-artifacts
- find distribution/archives -type f \( -name 'elasticsearch-*-*.tar.gz' -o -name 'elasticsearch-*-*.zip' \) -not -path *no-jdk* -exec cp {} ~/Downloads/tmp-artifacts \;
- ```
-
- 5. Calculate shasums of the uploads
-
- ```
- cd ~/Downloads/tmp-artifacts
- find * -exec bash -c "shasum -a 512 {} > {}.sha512" \;
- ```
-
- 6. Check that the files in `~/Downloads/tmp-artifacts` look reasonable
- 7. Upload the files to GCS
+ 4. Check that the files in `~/Downloads/tmp-artifacts` look reasonable
+ 5. Upload the files to GCS
```
gsutil -m rsync . gs://kibana-ci-tmp-artifacts/
```
- 8. Once the artifacts are uploaded, modify `packages/kbn-es/src/custom_snapshots.js` in a PR to use a URL formatted like:
+ 6. Once the artifacts are uploaded, modify `packages/kbn-es/src/custom_snapshots.js` in a PR to use a URL formatted like:
```
// force use of manually created snapshots until ReindexPutMappings fix
diff --git a/packages/kbn-es/src/cli_commands/build_snapshots.js b/packages/kbn-es/src/cli_commands/build_snapshots.js
index 070f11b8b5f84..b4a15a0645cce 100644
--- a/packages/kbn-es/src/cli_commands/build_snapshots.js
+++ b/packages/kbn-es/src/cli_commands/build_snapshots.js
@@ -6,6 +6,7 @@
* Side Public License, v 1.
*/
+const dedent = require('dedent');
const { resolve, basename } = require('path');
const { createHash } = require('crypto');
const { promisify } = require('util');
@@ -21,7 +22,16 @@ const pipelineAsync = promisify(pipeline);
exports.description = 'Build and collect ES snapshots';
-exports.help = () => ``;
+exports.help = () => dedent`
+ Options:
+
+ --output Path to create the built elasticsearch snapshots
+ --source-path Path where the elasticsearch repository is checked out
+
+ Example:
+
+ es build_snapshots --source-path=/path/to/es/checked/repo --output=/tmp/es-built-snapshots
+ `;
exports.run = async (defaults = {}) => {
const argv = process.argv.slice(2);
diff --git a/packages/kbn-eslint-config/.eslintrc.js b/packages/kbn-eslint-config/.eslintrc.js
index 4fd29b8b3672e..5a9d49934c255 100644
--- a/packages/kbn-eslint-config/.eslintrc.js
+++ b/packages/kbn-eslint-config/.eslintrc.js
@@ -102,6 +102,11 @@ module.exports = {
to: '@kbn/test-jest-helpers',
disallowedMessage: `import from @kbn/test-jest-helpers instead`
},
+ {
+ from: '@kbn/utility-types/jest',
+ to: '@kbn/utility-types-jest',
+ disallowedMessage: `import from @kbn/utility-types-jest instead`
+ },
],
],
diff --git a/packages/kbn-field-types/src/kbn_field_types_factory.ts b/packages/kbn-field-types/src/kbn_field_types_factory.ts
index 2ded968c3cdf4..02f7c7444862d 100644
--- a/packages/kbn-field-types/src/kbn_field_types_factory.ts
+++ b/packages/kbn-field-types/src/kbn_field_types_factory.ts
@@ -21,6 +21,7 @@ export const createKbnFieldTypes = (): KbnFieldType[] => [
esTypes: [
ES_FIELD_TYPES.STRING,
ES_FIELD_TYPES.TEXT,
+ ES_FIELD_TYPES.MATCH_ONLY_TEXT,
ES_FIELD_TYPES.KEYWORD,
ES_FIELD_TYPES.VERSION,
ES_FIELD_TYPES._TYPE,
diff --git a/packages/kbn-field-types/src/types.ts b/packages/kbn-field-types/src/types.ts
index c14e7e4b03661..0addc2c5bf077 100644
--- a/packages/kbn-field-types/src/types.ts
+++ b/packages/kbn-field-types/src/types.ts
@@ -23,6 +23,7 @@ export enum ES_FIELD_TYPES {
STRING = 'string',
TEXT = 'text',
+ MATCH_ONLY_TEXT = 'match_only_text',
KEYWORD = 'keyword',
VERSION = 'version',
diff --git a/packages/kbn-handlebars/LICENSE b/packages/kbn-handlebars/LICENSE
index 55b4f257a1e98..5d971a1754fea 100644
--- a/packages/kbn-handlebars/LICENSE
+++ b/packages/kbn-handlebars/LICENSE
@@ -3,12 +3,6 @@ The MIT License (MIT)
Copyright (c) Elasticsearch BV
Copyright (c) Copyright (C) 2011-2019 by Yehuda Katz
-This software consists of voluntary contributions made by many
-individuals. For exact contribution history, see the revision history
-available at the following locations:
- - https://github.com/handlebars-lang/handlebars.js
- - https://github.com/elastic/kibana/tree/main/packages/kbn-handlebars
-
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
@@ -27,3 +21,9 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+This software consists of voluntary contributions made by many
+individuals. For exact contribution history, see the revision history
+available at the following locations:
+ - https://github.com/handlebars-lang/handlebars.js
+ - https://github.com/elastic/kibana/tree/main/packages/kbn-handlebars
diff --git a/packages/kbn-plugin-discovery/README.md b/packages/kbn-plugin-discovery/README.md
deleted file mode 100644
index 7b433b0fdec72..0000000000000
--- a/packages/kbn-plugin-discovery/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# @kbn/plugin-discovery
-
-Logic used to find plugins in the repository.
diff --git a/packages/kbn-plugin-discovery/README.mdx b/packages/kbn-plugin-discovery/README.mdx
new file mode 100644
index 0000000000000..973db3fb2a1e1
--- /dev/null
+++ b/packages/kbn-plugin-discovery/README.mdx
@@ -0,0 +1,24 @@
+---
+id: kibDevDocsOpsPluginDiscovery
+slug: /kibana-dev-docs/ops/plugin-discovery
+title: "@kbn/plugin-discovery"
+description: A package with logic used to find plugins in the repository
+date: 2022-06-06
+tags: ['kibana', 'dev', 'contributor', 'operations', 'plugin', 'discovery']
+---
+
+At the moment plugins can live in a couple of different places and in the future will be able
+to live anywhere in the repository. This is a package that holds custom logic useful to find and
+parse those.
+
+## parseKibanaPlatformPlugin
+
+It returns a platform plugin for a given manifest path
+
+## getPluginSearchPaths
+
+It returns the paths where plugins will be searched for
+
+## simpleKibanaPlatformPluginDiscovery
+
+It finds and returns the new platform plugins
diff --git a/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_card/__snapshots__/elastic_agent_card.test.tsx.snap b/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_card/__snapshots__/elastic_agent_card.test.tsx.snap
index d13765d21af1f..dbdb652a10c1f 100644
--- a/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_card/__snapshots__/elastic_agent_card.test.tsx.snap
+++ b/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_card/__snapshots__/elastic_agent_card.test.tsx.snap
@@ -36,7 +36,11 @@ exports[`ElasticAgentCard renders 1`] = `
href="/app/integrations/browse"
rel="noreferrer"
>
- Add Elastic Agent
+
+ Add Elastic Agent
+