From fd3fe67d673fe4da9d748a67fa7abc891cdf1af7 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 8 Nov 2023 14:15:56 +0000 Subject: [PATCH] [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs' --- .buildkite/ftr_configs.yml | 33 ++++++-------- .../pipelines/on_merge_unsupported_ftrs.yml | 2 +- .../pull_request/exploratory_view_plugin.yml | 2 +- .../pull_request/synthetics_plugin.yml | 2 +- .../pipelines/pull_request/uptime_plugin.yml | 2 +- .../pipelines/pull_request/ux_plugin_e2e.yml | 2 +- .../scripts/steps/functional/apm_cypress.sh | 2 +- .../functional/exploratory_view_plugin.sh | 2 +- .../observability_onboarding_cypress.sh | 2 +- .../steps/functional/profiling_cypress.sh | 2 +- .../scripts/steps/functional/synthetics.sh | 2 +- .../steps/functional/synthetics_plugin.sh | 2 +- .../scripts/steps/functional/uptime_plugin.sh | 2 +- .../steps/functional/ux_synthetics_e2e.sh | 2 +- .github/CODEOWNERS | 18 ++++---- .github/paths-labeller.yml | 44 +++++++++---------- .gitignore | 4 +- TYPESCRIPT.md | 34 +++++++++----- docs/developer/plugin-list.asciidoc | 36 +++++++-------- ...get_i18n_identifier_from_file_path.test.ts | 12 +++-- .../get_i18n_identifier_from_file_path.ts | 11 ++++- .../helpers/get_app_name.test.ts | 7 ++- .../helpers/get_app_name.ts | 4 +- .../common/__fixtures__/README.md | 4 +- src/dev/precommit_hook/casing_check_config.js | 2 +- src/dev/storybook/aliases.ts | 13 +++--- src/plugins/guided_onboarding/README.md | 2 +- .../vis_types/timeseries/server/plugin.ts | 2 +- test/scripts/jenkins_apm_cypress.sh | 2 +- test/scripts/jenkins_uptime_playwright.sh | 2 +- test/scripts/jenkins_ux_synthetics.sh | 2 +- vars/tasks.groovy | 6 +-- x-pack/.i18nrc.json | 2 +- .../progress_controls/progress_controls.tsx | 2 +- .../queries/fetch_index_info.ts | 2 +- .../fetch_significant_term_p_values.ts | 2 +- .../utils/saved_search_utils.ts | 2 +- .../shared/log_stream/log_stream.tsx | 2 +- .../enterprise_search/server/plugin.ts | 2 +- .../apm/common/rules/apm_rule_types.ts | 8 ++-- .../apm/dev_docs/apm_queries.md | 12 ++--- .../apm/dev_docs/linting.md | 9 ++-- .../apm/dev_docs/local_setup.md | 2 +- .../apm/dev_docs/telemetry.md | 8 ++-- .../apm/dev_docs/testing.md | 20 ++++----- .../updating_functional_tests_archives.md | 4 +- .../apm/dev_docs/vscode_setup.md | 7 +-- .../apm/ftr_e2e/README.md | 4 +- .../observability_solution/apm/jest.config.js | 13 +++--- .../app/onboarding/introduction.tsx | 4 +- .../routing/templates/apm_main_template.tsx | 2 +- .../apm/public/plugin.ts | 2 +- .../scripts/infer_route_return_types/index.ts | 5 ++- .../apm/scripts/precommit.js | 5 ++- .../apm/scripts/telemetry/main.ts | 3 +- .../apm/scripts/test/e2e.js | 2 +- .../apm/server/tutorial/index.ts | 2 +- .../observability_solution/apm/tsconfig.json | 2 +- .../apm_data_access/jest.config.js | 4 +- .../apm_data_access/tsconfig.json | 2 +- .../exploratory_view/README.md | 2 +- .../exploratory_view/common/annotations.ts | 2 +- .../exploratory_view/e2e/README.md | 4 +- .../exploratory_view/jest.config.js | 13 +++--- .../shared/exploratory_view/README.md | 28 ++++++------ .../exploratory_view/tsconfig.json | 2 +- .../log_alerts/v1/chart_preview_data.ts | 4 +- .../infra/docs/telemetry/README.md | 4 +- .../infra/jest.config.js | 11 +++-- .../infra/public/pages/logs/page_content.tsx | 2 +- .../infra/public/plugin.ts | 6 +-- .../infra/tsconfig.json | 8 +++- .../log_explorer/jest.config.js | 11 +++-- .../log_explorer/tsconfig.json | 2 +- .../logs_shared/jest.config.js | 9 ++-- .../log_stream/log_stream.stories.mdx | 2 +- .../logs_shared/tsconfig.json | 8 +++- .../metrics_data_access/jest.config.js | 11 +++-- .../metrics_data_access/tsconfig.json | 2 +- .../observability/common/annotations.ts | 2 +- .../observability/docs/openapi/slo/README.md | 2 +- .../observability/jest.config.js | 13 +++--- .../observability/public/utils/datemath.ts | 2 +- .../observability/tsconfig.json | 2 +- .../observability_ai_assistant/jest.config.js | 8 ++-- .../observability_ai_assistant/tsconfig.json | 2 +- .../observability_log_explorer/jest.config.js | 8 ++-- .../observability_log_explorer/tsconfig.json | 2 +- .../observability_onboarding/e2e/README.md | 21 +++++---- .../e2e/ftr_config.ts | 4 +- .../e2e/tsconfig.json | 2 +- .../observability_onboarding/jest.config.js | 6 ++- .../scripts/test/e2e.js | 2 +- .../server/routes/logs/route.ts | 2 +- .../observability_onboarding/tsconfig.json | 2 +- .../observability_shared/jest.config.js | 13 +++--- .../public/components/tour/tour.tsx | 4 +- .../observability_shared/tsconfig.json | 2 +- .../profiling/README.md | 30 ++++++++----- .../profiling/common/__fixtures__/README.md | 4 +- .../profiling/e2e/README.md | 31 +++++++------ .../profiling/e2e/ftr_config.ts | 4 +- .../profiling/e2e/tsconfig.json | 2 +- .../profiling/jest.config.js | 11 +++-- .../profiling/scripts/test/e2e.js | 2 +- .../profiling_data_access/jest.config.js | 4 +- .../serverless_observability/tsconfig.json | 2 +- .../synthetics/.buildkite/pipelines/flaky.sh | 2 +- .../synthetics/README.md | 2 +- .../synthetics/e2e/README.md | 5 +-- .../synthetics/e2e/config.ts | 4 +- .../e2e/tasks/read_kibana_config.ts | 2 +- .../synthetics/e2e/tsconfig.json | 2 +- .../synthetics/jest.config.js | 11 +++-- .../synthetics/scripts/base_e2e.js | 6 +-- .../synthetics/tsconfig.json | 8 +++- .../uptime/.buildkite/pipelines/flaky.sh | 2 +- .../observability_solution/uptime/README.md | 2 +- .../uptime/e2e/README.md | 5 +-- .../uptime/e2e/config.ts | 4 +- .../uptime/e2e/tasks/read_kibana_config.ts | 2 +- .../uptime/e2e/tsconfig.json | 2 +- .../uptime/jest.config.js | 11 +++-- .../uptime/scripts/base_e2e.js | 6 +-- .../uptime/tsconfig.json | 2 +- .../ux/.buildkite/pipelines/flaky.sh | 2 +- .../observability_solution/ux/e2e/README.md | 4 +- .../observability_solution/ux/jest.config.js | 4 +- .../observability_solution/ux/readme.md | 6 +-- .../observability_solution/ux/tsconfig.json | 2 +- .../security/server/lib/flatten_object.ts | 2 +- .../calculate_timeseries_interval.ts | 2 +- .../tests/logs/environment.spec.ts | 4 +- 133 files changed, 459 insertions(+), 363 deletions(-) diff --git a/.buildkite/ftr_configs.yml b/.buildkite/ftr_configs.yml index c5028cd30ea29..64585a526b242 100644 --- a/.buildkite/ftr_configs.yml +++ b/.buildkite/ftr_configs.yml @@ -31,9 +31,9 @@ disabled: - x-pack/test/defend_workflows_cypress/cli_config.ts - x-pack/test/defend_workflows_cypress/config.ts - x-pack/test/defend_workflows_cypress/serverless_config.ts - - x-pack/plugins/observability_onboarding/e2e/ftr_config_open.ts - - x-pack/plugins/observability_onboarding/e2e/ftr_config_runner.ts - - x-pack/plugins/observability_onboarding/e2e/ftr_config.ts + - x-pack/plugins/observability_solution/observability_onboarding/e2e/ftr_config_open.ts + - x-pack/plugins/observability_solution/observability_onboarding/e2e/ftr_config_runner.ts + - x-pack/plugins/observability_solution/observability_onboarding/e2e/ftr_config.ts - x-pack/test/osquery_cypress/cli_config.ts - x-pack/test/osquery_cypress/serverless_cli_config.ts - x-pack/test/osquery_cypress/config.ts @@ -45,22 +45,22 @@ disabled: - x-pack/test/functional_enterprise_search/visual_config.ts - x-pack/test/functional_enterprise_search/cli_config.ts - x-pack/test_serverless/functional/test_suites/security/cypress/security_config.ts - - x-pack/plugins/apm/ftr_e2e/ftr_config_open.ts - - x-pack/plugins/apm/ftr_e2e/ftr_config_run.ts - - x-pack/plugins/apm/ftr_e2e/ftr_config.ts + - x-pack/plugins/observability_solution/apm/ftr_e2e/ftr_config_open.ts + - x-pack/plugins/observability_solution/apm/ftr_e2e/ftr_config_run.ts + - x-pack/plugins/observability_solution/apm/ftr_e2e/ftr_config.ts - x-pack/test_serverless/functional/test_suites/observability/cypress/config_headless.ts - x-pack/test_serverless/functional/test_suites/observability/cypress/config_runner.ts - x-pack/test/security_solution_cypress/serverless_config.ts - - x-pack/plugins/profiling/e2e/ftr_config_open.ts - - x-pack/plugins/profiling/e2e/ftr_config_runner.ts - - x-pack/plugins/profiling/e2e/ftr_config.ts + - x-pack/plugins/observability_solution/profiling/e2e/ftr_config_open.ts + - x-pack/plugins/observability_solution/profiling/e2e/ftr_config_runner.ts + - x-pack/plugins/observability_solution/profiling/e2e/ftr_config.ts # Elastic Synthetics configs - - x-pack/plugins/synthetics/e2e/config.ts - - x-pack/plugins/uptime/e2e/uptime/synthetics_run.ts - - x-pack/plugins/synthetics/e2e/synthetics/synthetics_run.ts - - x-pack/plugins/ux/e2e/synthetics_run.ts - - x-pack/plugins/exploratory_view/e2e/synthetics_run.ts + - x-pack/plugins/observability_solution/synthetics/e2e/config.ts + - x-pack/plugins/observability_solution/uptime/e2e/uptime/synthetics_run.ts + - x-pack/plugins/observability_solution/synthetics/e2e/synthetics/synthetics_run.ts + - x-pack/plugins/observability_solution/ux/e2e/synthetics_run.ts + - x-pack/plugins/observability_solution/exploratory_view/e2e/synthetics_run.ts # Configs that exist but weren't running in CI when this file was introduced - x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/config.ts @@ -462,8 +462,3 @@ enabled: - x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/actions/configs/ess.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/configs/serverless.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/configs/ess.config.ts - - - - - diff --git a/.buildkite/pipelines/on_merge_unsupported_ftrs.yml b/.buildkite/pipelines/on_merge_unsupported_ftrs.yml index 8221e27ea7502..131375e0de39b 100644 --- a/.buildkite/pipelines/on_merge_unsupported_ftrs.yml +++ b/.buildkite/pipelines/on_merge_unsupported_ftrs.yml @@ -54,7 +54,7 @@ steps: depends_on: build timeout_in_minutes: 120 artifact_paths: - - 'x-pack/plugins/synthetics/e2e/.journeys/**/*' + - 'x-pack/plugins/observability_solution/synthetics/e2e/.journeys/**/*' retry: automatic: - exit_status: '-1' diff --git a/.buildkite/pipelines/pull_request/exploratory_view_plugin.yml b/.buildkite/pipelines/pull_request/exploratory_view_plugin.yml index 0f572a98cefb3..552691a11aba2 100644 --- a/.buildkite/pipelines/pull_request/exploratory_view_plugin.yml +++ b/.buildkite/pipelines/pull_request/exploratory_view_plugin.yml @@ -6,7 +6,7 @@ steps: depends_on: build timeout_in_minutes: 60 artifact_paths: - - 'x-pack/plugins/exploratory_view/e2e/.journeys/**/*' + - 'x-pack/plugins/observability_solution/exploratory_view/e2e/.journeys/**/*' retry: automatic: - exit_status: '-1' diff --git a/.buildkite/pipelines/pull_request/synthetics_plugin.yml b/.buildkite/pipelines/pull_request/synthetics_plugin.yml index bfa3caa62f177..40f3dffa69af3 100644 --- a/.buildkite/pipelines/pull_request/synthetics_plugin.yml +++ b/.buildkite/pipelines/pull_request/synthetics_plugin.yml @@ -6,7 +6,7 @@ steps: depends_on: build timeout_in_minutes: 60 artifact_paths: - - 'x-pack/plugins/synthetics/e2e/.journeys/**/*' + - 'x-pack/plugins/observability_solution/synthetics/e2e/.journeys/**/*' retry: automatic: - exit_status: '-1' diff --git a/.buildkite/pipelines/pull_request/uptime_plugin.yml b/.buildkite/pipelines/pull_request/uptime_plugin.yml index cbd1c417fc852..faffeaaa86809 100644 --- a/.buildkite/pipelines/pull_request/uptime_plugin.yml +++ b/.buildkite/pipelines/pull_request/uptime_plugin.yml @@ -6,7 +6,7 @@ steps: depends_on: build timeout_in_minutes: 60 artifact_paths: - - 'x-pack/plugins/synthetics/e2e/.journeys/**/*' + - 'x-pack/plugins/observability_solution/synthetics/e2e/.journeys/**/*' retry: automatic: - exit_status: '-1' diff --git a/.buildkite/pipelines/pull_request/ux_plugin_e2e.yml b/.buildkite/pipelines/pull_request/ux_plugin_e2e.yml index 7542373c0f437..9dfce776229c9 100644 --- a/.buildkite/pipelines/pull_request/ux_plugin_e2e.yml +++ b/.buildkite/pipelines/pull_request/ux_plugin_e2e.yml @@ -6,7 +6,7 @@ steps: depends_on: build timeout_in_minutes: 60 artifact_paths: - - 'x-pack/plugins/ux/e2e/.journeys/**/*' + - 'x-pack/plugins/observability_solution/ux/e2e/.journeys/**/*' retry: automatic: - exit_status: '-1' diff --git a/.buildkite/scripts/steps/functional/apm_cypress.sh b/.buildkite/scripts/steps/functional/apm_cypress.sh index 55f99a819c076..400c39e72bf1c 100755 --- a/.buildkite/scripts/steps/functional/apm_cypress.sh +++ b/.buildkite/scripts/steps/functional/apm_cypress.sh @@ -30,6 +30,6 @@ echo "--- APM Cypress Tests" cd "$XPACK_DIR" -node plugins/apm/scripts/test/e2e.js \ +node plugins/observability_solution/apm/scripts/test/e2e.js \ --kibana-install-dir "$KIBANA_BUILD_LOCATION" \ $CYPRESS_ARGS diff --git a/.buildkite/scripts/steps/functional/exploratory_view_plugin.sh b/.buildkite/scripts/steps/functional/exploratory_view_plugin.sh index c3459020461dc..d14033883312f 100755 --- a/.buildkite/scripts/steps/functional/exploratory_view_plugin.sh +++ b/.buildkite/scripts/steps/functional/exploratory_view_plugin.sh @@ -13,4 +13,4 @@ echo "--- Exploratory View plugin @elastic/synthetics Tests" cd "$XPACK_DIR" -node plugins/exploratory_view/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"} +node plugins/observability_solution/exploratory_view/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"} diff --git a/.buildkite/scripts/steps/functional/observability_onboarding_cypress.sh b/.buildkite/scripts/steps/functional/observability_onboarding_cypress.sh index 1155cfdae07f7..095ef5c723392 100644 --- a/.buildkite/scripts/steps/functional/observability_onboarding_cypress.sh +++ b/.buildkite/scripts/steps/functional/observability_onboarding_cypress.sh @@ -13,5 +13,5 @@ echo "--- Observability onboarding Cypress Tests" cd "$XPACK_DIR" -node plugins/observability_onboarding/scripts/test/e2e.js \ +node plugins/observability_solution/observability_onboarding/scripts/test/e2e.js \ --kibana-install-dir "$KIBANA_BUILD_LOCATION" \ \ No newline at end of file diff --git a/.buildkite/scripts/steps/functional/profiling_cypress.sh b/.buildkite/scripts/steps/functional/profiling_cypress.sh index 1f6fb316b77ad..daad169069ae3 100644 --- a/.buildkite/scripts/steps/functional/profiling_cypress.sh +++ b/.buildkite/scripts/steps/functional/profiling_cypress.sh @@ -13,5 +13,5 @@ echo "--- Profiling Cypress Tests" cd "$XPACK_DIR" -NODE_OPTIONS=--openssl-legacy-provider node plugins/profiling/scripts/test/e2e.js \ +NODE_OPTIONS=--openssl-legacy-provider node plugins/observability_solution/profiling/scripts/test/e2e.js \ --kibana-install-dir "$KIBANA_BUILD_LOCATION" \ \ No newline at end of file diff --git a/.buildkite/scripts/steps/functional/synthetics.sh b/.buildkite/scripts/steps/functional/synthetics.sh index 699f80fd0483c..3d22131701762 100644 --- a/.buildkite/scripts/steps/functional/synthetics.sh +++ b/.buildkite/scripts/steps/functional/synthetics.sh @@ -13,4 +13,4 @@ echo "--- synthetics @elastic/synthetics Tests" cd "$XPACK_DIR" -node plugins/synthetics/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" --grep "MonitorManagement-monitor*" +node plugins/observability_solution/synthetics/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" --grep "MonitorManagement-monitor*" diff --git a/.buildkite/scripts/steps/functional/synthetics_plugin.sh b/.buildkite/scripts/steps/functional/synthetics_plugin.sh index 5473d2d9a2b8b..5ad02174ccd26 100755 --- a/.buildkite/scripts/steps/functional/synthetics_plugin.sh +++ b/.buildkite/scripts/steps/functional/synthetics_plugin.sh @@ -13,4 +13,4 @@ echo "--- Synthetics plugin @elastic/synthetics Tests" cd "$XPACK_DIR" -node plugins/synthetics/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"} +node plugins/observability_solution/synthetics/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"} diff --git a/.buildkite/scripts/steps/functional/uptime_plugin.sh b/.buildkite/scripts/steps/functional/uptime_plugin.sh index b1ae17ff3d9fc..3122953862c73 100755 --- a/.buildkite/scripts/steps/functional/uptime_plugin.sh +++ b/.buildkite/scripts/steps/functional/uptime_plugin.sh @@ -13,4 +13,4 @@ echo "--- Uptime plugin @elastic/synthetics Tests" cd "$XPACK_DIR" -node plugins/uptime/scripts/uptime_e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"} +node plugins/observability_solution/uptime/scripts/uptime_e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"} diff --git a/.buildkite/scripts/steps/functional/ux_synthetics_e2e.sh b/.buildkite/scripts/steps/functional/ux_synthetics_e2e.sh index f7d6a6276fb56..dbb3289f604e5 100755 --- a/.buildkite/scripts/steps/functional/ux_synthetics_e2e.sh +++ b/.buildkite/scripts/steps/functional/ux_synthetics_e2e.sh @@ -13,4 +13,4 @@ echo "--- User Experience @elastic/synthetics Tests" cd "$XPACK_DIR" -node plugins/ux/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"} +node plugins/observability_solution/ux/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"} diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 8e893d23708fe..1b265f76ec2f9 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -929,8 +929,8 @@ packages/kbn-monaco/src/esql @elastic/kibana-visualizations # Actionable observability x-pack/packages/observability/alert_details @elastic/actionable-observability x-pack/test/observability_functional @elastic/actionable-observability -x-pack/plugins/infra/public/alerting @elastic/actionable-observability -x-pack/plugins/infra/server/lib/alerting @elastic/actionable-observability +x-pack/plugins/observability_solution/infra/public/alerting @elastic/actionable-observability +x-pack/plugins/observability_solution/infra/server/lib/alerting @elastic/actionable-observability # Observability robots /.github/workflows/deploy-my-kibana.yml @elastic/observablt-robots @@ -975,16 +975,16 @@ x-pack/plugins/infra/server/lib/alerting @elastic/actionable-observability /x-pack/test/alerting_api_integration/observability/index.ts @elastic/uptime # Client Side Monitoring / Uptime (lives in APM directories but owned by Uptime) -/x-pack/plugins/apm/public/application/uxApp.tsx @elastic/uptime -/x-pack/plugins/apm/public/components/app/rum_dashboard @elastic/uptime +/x-pack/plugins/observability_solution/apm/public/application/uxApp.tsx @elastic/uptime +/x-pack/plugins/observability_solution/apm/public/components/app/rum_dashboard @elastic/uptime /x-pack/test/apm_api_integration/tests/csm/ @elastic/uptime # Observability onboarding tour -/x-pack/plugins/observability_shared/public/components/tour @elastic/platform-onboarding +/x-pack/plugins/observability_solution/observability_shared/public/components/tour @elastic/platform-onboarding /x-pack/test/functional/apps/infra/tour.ts @elastic/platform-onboarding # Observability settings -/x-pack/plugins/observability/server/ui_settings.ts @elastic/obs-docs +/x-pack/plugins/observability_solution/observability/server/ui_settings.ts @elastic/obs-docs ### END Observability Plugins @@ -1413,8 +1413,8 @@ x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_en **/*.scss @elastic/kibana-design # Observability design -/x-pack/plugins/apm/**/*.scss @elastic/observability-design -/x-pack/plugins/infra/**/*.scss @elastic/observability-design +/x-pack/plugins/observability_solution/apm/**/*.scss @elastic/observability-design +/x-pack/plugins/observability_solution/infra/**/*.scss @elastic/observability-design /x-pack/plugins/fleet/**/*.scss @elastic/observability-design /x-pack/plugins/monitoring/**/*.scss @elastic/observability-design @@ -1443,7 +1443,7 @@ x-pack/plugins/translations/translations x-pack/test/profiling_api_integration @elastic/profiling-ui # Observability shared profiling -x-pack/plugins/observability_shared/public/components/profiling @elastic/profiling-ui +x-pack/plugins/observability_solution/observability_shared/public/components/profiling @elastic/profiling-ui # Shared UX packages/react @elastic/appex-sharedux diff --git a/.github/paths-labeller.yml b/.github/paths-labeller.yml index 1c1b2742001b5..3c440e895bbc8 100644 --- a/.github/paths-labeller.yml +++ b/.github/paths-labeller.yml @@ -1,23 +1,23 @@ --- - - "Feature:Embedding": - - "src/plugins/embeddable/**/*.*" - - "src/plugins/dashboard_embeddable_container/**/*.*" - - "Feature:Drilldowns": - - "x-pack/plugins/drilldowns/**/*.*" - - "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/**/*.*" - - "Feature:ExpressionLanguage": - - "src/plugins/expressions/**/*.*" - - "src/plugins/bfetch/**/*.*" - - "Team:apm": - - "x-pack/plugins/apm/**/*.*" - - "x-pack/test/apm_api_integration/**/*.*" - - "packages/kbn-apm-synthtrace/**/*.*" - - "packages/kbn-apm-synthtrace-client/**/*.*" - - "packages/kbn-apm-utils/**/*.*" - - "Team:Fleet": - - "x-pack/plugins/fleet/**/*.*" - - "x-pack/test/fleet_api_integration/**/*.*" - - "Team:uptime": - - "x-pack/plugins/synthetics/**/*.*" - - "x-pack/plugins/ux/**/*.*" - - "x-pack/plugins/observability/public/components/shared/exploratory_view/**/*.*" +- 'Feature:Embedding': + - 'src/plugins/embeddable/**/*.*' + - 'src/plugins/dashboard_embeddable_container/**/*.*' +- 'Feature:Drilldowns': + - 'x-pack/plugins/drilldowns/**/*.*' + - 'x-pack/plugins/dashboard_enhanced/public/services/drilldowns/**/*.*' +- 'Feature:ExpressionLanguage': + - 'src/plugins/expressions/**/*.*' + - 'src/plugins/bfetch/**/*.*' +- 'Team:apm': + - 'x-pack/plugins/observability_solution/apm/**/*.*' + - 'x-pack/test/apm_api_integration/**/*.*' + - 'packages/kbn-apm-synthtrace/**/*.*' + - 'packages/kbn-apm-synthtrace-client/**/*.*' + - 'packages/kbn-apm-utils/**/*.*' +- 'Team:Fleet': + - 'x-pack/plugins/fleet/**/*.*' + - 'x-pack/test/fleet_api_integration/**/*.*' +- 'Team:uptime': + - 'x-pack/plugins/observability_solution/synthetics/**/*.*' + - 'x-pack/plugins/observability_solution/ux/**/*.*' + - 'x-pack/plugins/observability_solution/observability/public/components/shared/exploratory_view/**/*.*' diff --git a/.gitignore b/.gitignore index 3a5dda1378c2e..05803a82affaa 100644 --- a/.gitignore +++ b/.gitignore @@ -94,8 +94,8 @@ npm-debug.log* ## @cypress/snapshot from apm plugin /snapshots.js /apm-diagnostics*.json -/x-pack/plugins/apm/ftr_e2e/cypress/e2e/service_map/snapshots/*.actual.png -/x-pack/plugins/apm/ftr_e2e/cypress/e2e/service_map/snapshots/*.diff.png +/x-pack/plugins/observability_solution/apm/ftr_e2e/cypress/e2e/service_map/snapshots/*.actual.png +/x-pack/plugins/observability_solution/apm/ftr_e2e/cypress/e2e/service_map/snapshots/*.diff.png # transpiled cypress config x-pack/plugins/fleet/cypress.config.d.ts diff --git a/TYPESCRIPT.md b/TYPESCRIPT.md index 9edd11ff4f1b0..49e4130bed8c8 100644 --- a/TYPESCRIPT.md +++ b/TYPESCRIPT.md @@ -3,6 +3,7 @@ ### Converting existing code To convert existing code over to TypeScript: + 1. rename the file from `.js` to either `.ts` (if there is no html or jsx in the file) or `.tsx` (if there is). 2. Ensure eslint is running and installed in the IDE of your choice. There will usually be some linter errors after the file rename. 3. Auto-fix what you can. This will save you a lot of time! VSCode can be set to auto fix eslint errors when files are saved. @@ -36,8 +37,8 @@ Some background on the differences between module declaration and augmentation: In TypeScript module declarations can not be merged, which means each module can only be declared once. But it is possible to augment previously declared modules. The documentation about the distinction between module declaration and augmentation is sparse. The observed rules for `declare module '...' {}` in a `.d.ts` file seem to be: -* it is treated as a module declaration when the file itself is not a module -* it is treated as a module augmentation when the file itself is module +- it is treated as a module declaration when the file itself is not a module +- it is treated as a module augmentation when the file itself is module A `.d.ts` file is treated as a module if it contains any top-level `import` or `export` statements. That means that in order to write a module declaration the `import`s must be contained within the `declare` block and none must be located on the topmost level. Conversely, to write a module augmentation there must be at least one top-level `import` or `export` and the `declare` block must not contain any `import` statements. @@ -67,6 +68,7 @@ declare module '@elastic/eui' { For example: metadata.js: + ```js export let metadata = null; @@ -76,6 +78,7 @@ export function __newPlatformInit__(legacyMetadata) { ``` documentation_links.js: + ```js import { metadata } from './metadata'; @@ -85,6 +88,7 @@ export const DOC_LINK_VERSION = metadata.branch; To TypeScript `documentation_links.js` you'll need to add a type definition for `metadata.js` metadata.d.ts + ``` declare interface Metadata { public branch: string; @@ -110,7 +114,7 @@ If that happens, just pick the closest one. If yarn doesn't find the module it may not have types. For example, our `rison_node` package doesn't have types. In this case you have a few options: 1. Contribute types into the DefinitelyTyped repo itself, or -2. Create a top level `types` folder and point to that in the tsconfig. For example, Infra team already handled this for `rison_node` and added: `x-pack/legacy/plugins/infra/types/rison_node.d.ts`. Other code uses it too, so we will need to pull it up. Or, +2. Create a top level `types` folder and point to that in the tsconfig. For example, Infra team already handled this for `rison_node` and added: `x-pack/legacy/plugins/observability_solution/infra/types/rison_node.d.ts`. Other code uses it too, so we will need to pull it up. Or, 3. Add a `// @ts-ignore` line above the import. This should be used minimally, the above options are better. However, sometimes you have to resort to this method. ### TypeScripting react files @@ -118,6 +122,7 @@ If yarn doesn't find the module it may not have types. For example, our `rison_n React has its own concept of runtime types via `proptypes`. TypeScript gives you compile time types so I prefer those. Before: + ```jsx import PropTypes from 'prop-types'; @@ -138,8 +143,8 @@ import PropTypes from 'prop-types'; ``` After: -```tsx +```tsx interface Props { text: string; } @@ -148,15 +153,15 @@ interface State { buttonWasClicked: boolean; } - export class Button extends Component { - state = { - buttonWasClicked = false - }; +export class Button extends Component { + state = { + buttonWasClicked = false, + }; - render() { - return - } - } + render() { + return ; + } +} ``` Note that the name of `Props` and `State` doesn't matter, the order does. If you are exporting those interfaces to be used elsewhere, you probably should give them more fleshed out names, such as `ButtonProps` and `ButtonState`. @@ -174,6 +179,7 @@ In react proptypes, we often will use `PropTypes.func`. In TypeScript, a functio Especially since we often use the spread operator, this syntax is a little different and probably worth calling out. Before: + ```js function ({ title, description }) { ... @@ -181,6 +187,7 @@ function ({ title, description }) { ``` After: + ```ts function ({ title, description }: {title: string, description: string}) { ... @@ -205,6 +212,7 @@ Using any is sometimes valid, but should rarely be used, even if to make quicker If you use a variable that isn't initially defined, you should give it a type, or it will be `any` by default (and strangely this isn't a warning, even though I think it should be) Before - `color` will be type `any`: + ```js let color; @@ -216,6 +224,7 @@ if (danger) { ``` After - `color` will be type `string`: + ```ts let color: string; @@ -240,6 +249,7 @@ anySet.add('2'); ``` So we should explicitly define types for default constructors whenever possible: + ```ts const typedMap = new Map(); typedMap.set('1', 2); diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index 868ef59f47966..30f76c50cfb6c 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -446,11 +446,11 @@ The plugin exposes the static DefaultEditorController class to consume. |The Kibana Alerting plugin provides a common place to set up rules. You can: -|{kib-repo}blob/{branch}/x-pack/plugins/apm/readme.md[apm] +|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/apm/readme.md[apm] |This plugin provides access to App Monitoring features provided by Elastic. It allows you to monitor your software services and applications in real-time; visualize detailed performance information on your services, identify and analyze errors, and monitor host-level and APM agent-specific metrics like JVM and Go runtime metrics. -|{kib-repo}blob/{branch}/x-pack/plugins/apm_data_access[apmDataAccess] +|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/apm_data_access[apmDataAccess] |WARNING: Missing README. @@ -554,7 +554,7 @@ security and spaces filtering. activities. -|{kib-repo}blob/{branch}/x-pack/plugins/exploratory_view/README.md[exploratoryView] +|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/exploratory_view/README.md[exploratoryView] |A shared component for visualizing observability data types via lens embeddable. For further details. @@ -601,7 +601,7 @@ Index Management by running this series of requests in Console: |This service is exposed from the Index Management setup contract and can be used to add content to the indices list and the index details page. -|{kib-repo}blob/{branch}/x-pack/plugins/infra/README.md[infra] +|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/infra/README.md[infra] |This is the home of the infra plugin, which aims to provide a solution for the infrastructure monitoring use-case within Kibana. @@ -635,11 +635,11 @@ the infrastructure monitoring use-case within Kibana. using the CURL scripts in the scripts folder. -|{kib-repo}blob/{branch}/x-pack/plugins/log_explorer/README.md[logExplorer] +|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/log_explorer/README.md[logExplorer] |This plugin is home to the component and related types. It implements several of the underlying concepts that the Observability Log Explorer app builds upon. -|{kib-repo}blob/{branch}/x-pack/plugins/logs_shared/README.md[logsShared] +|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/logs_shared/README.md[logsShared] |Exposes the shared components and APIs to access and visualize logs. @@ -651,7 +651,7 @@ using the CURL scripts in the scripts folder. |Visualize geo data from Elasticsearch or 3rd party geo-services. -|{kib-repo}blob/{branch}/x-pack/plugins/metrics_data_access/README.md[metricsDataAccess] +|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/metrics_data_access/README.md[metricsDataAccess] |Exposes utilities to access metrics data. @@ -672,23 +672,23 @@ Elastic. |The Notifications plugin provides a set of services to help Solutions and plugins send notifications to users. -|{kib-repo}blob/{branch}/x-pack/plugins/observability/README.md[observability] +|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/observability/README.md[observability] |This plugin provides shared components and services for use across observability solutions, as well as the observability landing page UI. -|{kib-repo}blob/{branch}/x-pack/plugins/observability_ai_assistant/README.md[observabilityAIAssistant] +|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/observability_ai_assistant/README.md[observabilityAIAssistant] |This document gives an overview of the features of the Observability AI Assistant at the time of writing, and how to use them. At a high level, the Observability AI Assistant offers contextual insights, and a chat functionality that we enrich with function calling, allowing the LLM to hook into the user's data. We also allow the LLM to store things it considers new information as embeddings into Elasticsearch, and query this knowledge base when it decides it needs more information, using ELSER. -|{kib-repo}blob/{branch}/x-pack/plugins/observability_log_explorer/README.md[observabilityLogExplorer] +|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/observability_log_explorer/README.md[observabilityLogExplorer] |This plugin provides an app based on the LogExplorer component from the log_explorer plugin, but adds observability-specific affordances. -|{kib-repo}blob/{branch}/x-pack/plugins/observability_onboarding/README.md[observabilityOnboarding] +|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/observability_onboarding/README.md[observabilityOnboarding] |This plugin provides an onboarding framework for observability solutions: Logs and APM. -|{kib-repo}blob/{branch}/x-pack/plugins/observability_shared/README.md[observabilityShared] +|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/observability_shared/README.md[observabilityShared] |A plugin that contains components and utilities shared by all Observability plugins. @@ -700,11 +700,11 @@ Elastic. |This plugin helps users learn how to use the Painless scripting language. -|{kib-repo}blob/{branch}/x-pack/plugins/profiling/README.md[profiling] +|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/profiling/README.md[profiling] |Universal Profiling provides fleet-wide, whole-system, continuous profiling with zero instrumentation. Get a comprehensive understanding of what lines of code are consuming compute resources throughout your entire fleet by visualizing your data in Kibana using the flamegraph, stacktraces, and top functions views. -|{kib-repo}blob/{branch}/x-pack/plugins/profiling_data_access[profilingDataAccess] +|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/profiling_data_access[profilingDataAccess] |WARNING: Missing README. @@ -766,7 +766,7 @@ It leverages universal configuration and other APIs in the serverless plugin to | -|{kib-repo}blob/{branch}/x-pack/plugins/serverless_observability/README.mdx[serverlessObservability] +|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/serverless_observability/README.mdx[serverlessObservability] |This plugin contains configuration and code used to create a Serverless Observability project. It leverages universal configuration and other APIs in the serverless plugin to configure Kibana. @@ -797,7 +797,7 @@ routes, etc. |The stack_connectors plugin provides connector types shipped with Kibana, built on top of the framework provided in the actions plugin. -|{kib-repo}blob/{branch}/x-pack/plugins/synthetics/README.md[synthetics] +|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/synthetics/README.md[synthetics] |The purpose of this plugin is to provide users of Heartbeat more visibility of what's happening in their infrastructure. @@ -836,7 +836,7 @@ As a developer you can reuse and extend built-in alerts and actions UI functiona |Upgrade Assistant helps users prepare their Stack for being upgraded to the next version of the Elastic stack. -|{kib-repo}blob/{branch}/x-pack/plugins/uptime/README.md[uptime] +|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/uptime/README.md[uptime] |The purpose of this plugin is to provide users of Heartbeat more visibility of what's happening in their infrastructure. @@ -845,7 +845,7 @@ in their infrastructure. |NOTE: This plugin contains implementation of URL drilldown. For drilldowns infrastructure code refer to ui_actions_enhanced plugin. -|{kib-repo}blob/{branch}/x-pack/plugins/ux/readme.md[ux] +|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/ux/readme.md[ux] |https://docs.elastic.dev/kibana-dev-docs/welcome diff --git a/packages/kbn-eslint-plugin-i18n/helpers/get_i18n_identifier_from_file_path.test.ts b/packages/kbn-eslint-plugin-i18n/helpers/get_i18n_identifier_from_file_path.test.ts index 6e01b89b23565..417bc46147eda 100644 --- a/packages/kbn-eslint-plugin-i18n/helpers/get_i18n_identifier_from_file_path.test.ts +++ b/packages/kbn-eslint-plugin-i18n/helpers/get_i18n_identifier_from_file_path.test.ts @@ -11,11 +11,17 @@ import { getI18nIdentifierFromFilePath } from './get_i18n_identifier_from_file_p const SYSTEMPATH = 'systemPath'; const testMap = [ - ['x-pack/plugins/observability/foo/bar/baz/header_actions.tsx', 'xpack.observability'], - ['x-pack/plugins/apm/public/components/app/correlations/correlations_table.tsx', 'xpack.apm'], + [ + 'x-pack/plugins/observability_solution/observability/public/foo/bar/baz/header_actions.tsx', + 'xpack.observability', + ], + [ + 'x-pack/plugins/observability_solution/apm/public/components/app/correlations/correlations_table.tsx', + 'xpack.apm', + ], ['x-pack/plugins/cases/public/components/foo.tsx', 'xpack.cases'], [ - 'x-pack/plugins/synthetics/public/apps/synthetics/components/alerts/toggle_alert_flyout_button.tsx', + 'x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/toggle_alert_flyout_button.tsx', 'xpack.synthetics', ], [ diff --git a/packages/kbn-eslint-plugin-i18n/helpers/get_i18n_identifier_from_file_path.ts b/packages/kbn-eslint-plugin-i18n/helpers/get_i18n_identifier_from_file_path.ts index d23a42f4ebcfb..dd9d71862f45f 100644 --- a/packages/kbn-eslint-plugin-i18n/helpers/get_i18n_identifier_from_file_path.ts +++ b/packages/kbn-eslint-plugin-i18n/helpers/get_i18n_identifier_from_file_path.ts @@ -14,9 +14,16 @@ export function getI18nIdentifierFromFilePath(fileName: string, cwd: string) { const { dir } = parse(fileName); const relativePathToFile = dir.replace(cwd, ''); - const relativePathArray = relativePathToFile.split('/'); + const relativePathArray = relativePathToFile.split('/').slice(2); - const path = `${relativePathArray[2]}/${relativePathArray[3]}`; + const publicFolderIndex = relativePathArray.findIndex((el) => el === 'public'); + + const path = relativePathArray.reduce((acc, curr, index) => { + if (index < publicFolderIndex) { + return index === 0 ? curr : `${acc}/${curr}`; + } + return acc; + }, ''); const xpackRC = resolve(join(__dirname, '../../../'), 'x-pack/.i18nrc.json'); diff --git a/packages/kbn-eslint-plugin-telemetry/helpers/get_app_name.test.ts b/packages/kbn-eslint-plugin-telemetry/helpers/get_app_name.test.ts index 36790e883cce1..9c7c5baa40480 100644 --- a/packages/kbn-eslint-plugin-telemetry/helpers/get_app_name.test.ts +++ b/packages/kbn-eslint-plugin-telemetry/helpers/get_app_name.test.ts @@ -11,8 +11,11 @@ import { getAppName } from './get_app_name'; const SYSTEMPATH = 'systemPath'; const testMap = [ - ['x-pack/plugins/observability/foo/bar/baz/header_actions.tsx', 'o11y'], - ['x-pack/plugins/apm/public/components/app/correlations/correlations_table.tsx', 'apm'], + ['x-pack/plugins/observability_solution/observability/foo/bar/baz/header_actions.tsx', 'o11y'], + [ + 'x-pack/plugins/observability_solution/apm/public/components/app/correlations/correlations_table.tsx', + 'apm', + ], ['x-pack/plugins/cases/public/components/foo.tsx', 'cases'], ['packages/kbn-alerts-ui-shared/src/alert_lifecycle_status_badge/index.tsx', 'kbnAlertsUiShared'], ]; diff --git a/packages/kbn-eslint-plugin-telemetry/helpers/get_app_name.ts b/packages/kbn-eslint-plugin-telemetry/helpers/get_app_name.ts index e483a572be892..d4bb700e68997 100644 --- a/packages/kbn-eslint-plugin-telemetry/helpers/get_app_name.ts +++ b/packages/kbn-eslint-plugin-telemetry/helpers/get_app_name.ts @@ -27,7 +27,9 @@ export function getAppName(fileName: string, cwd: string) { }, new Set()) ); - const relativePathArray = relativePathToFile.split('/'); + const relativePathArray = relativePathToFile + .split('/') + .filter((el) => el !== 'observability_solution'); const appName = camelCase( packageDirs.reduce((acc, repoPath) => { diff --git a/packages/kbn-profiling-utils/common/__fixtures__/README.md b/packages/kbn-profiling-utils/common/__fixtures__/README.md index 1a26bca590668..2414eae2fdb49 100644 --- a/packages/kbn-profiling-utils/common/__fixtures__/README.md +++ b/packages/kbn-profiling-utils/common/__fixtures__/README.md @@ -1,6 +1,6 @@ The stacktrace fixtures in this directory are originally from Elasticsearch's `POST /_profiling/stacktraces` endpoint. They were subsequently filtered -through the `shrink_stacktrace_response.js` command in `x-pack/plugins/profiling/scripts/` +through the `shrink_stacktrace_response.js` command in `x-pack/plugins/observability_solution/profiling/scripts/` to reduce the size without losing sampling fidelity (see the script for further details). @@ -14,4 +14,4 @@ where `seconds` is the time span of the original query and `upsampling rate` is the reciprocal of the sampling rate returned from the original query. To add a new stacktrace fixture to the test suite, update `stacktraces.ts` -appropriately. \ No newline at end of file +appropriately. diff --git a/src/dev/precommit_hook/casing_check_config.js b/src/dev/precommit_hook/casing_check_config.js index 93eba1bb171b2..e63e66b207b27 100644 --- a/src/dev/precommit_hook/casing_check_config.js +++ b/src/dev/precommit_hook/casing_check_config.js @@ -69,7 +69,7 @@ export const IGNORE_FILE_GLOBS = [ 'x-pack/plugins/maps/server/fonts/**/*', - 'x-pack/plugins/profiling/Makefile', + 'x-pack/plugins/observability_solution/profiling/Makefile', // Bazel default files '**/WORKSPACE.bazel', diff --git a/src/dev/storybook/aliases.ts b/src/dev/storybook/aliases.ts index a43fd71d0004e..9f0380211ce50 100644 --- a/src/dev/storybook/aliases.ts +++ b/src/dev/storybook/aliases.ts @@ -11,7 +11,7 @@ // If you wish for your Storybook to be built and included in CI, also add your // alias to .buildkite/scripts/steps/storybooks/build_and_upload.ts export const storybookAliases = { - apm: 'x-pack/plugins/apm/.storybook', + apm: 'x-pack/plugins/observability_solution/apm/.storybook', canvas: 'x-pack/plugins/canvas/storybook', cases: 'packages/kbn-cases-components/.storybook', cell_actions: 'packages/kbn-cell-actions/.storybook', @@ -42,13 +42,14 @@ export const storybookAliases = { fleet: 'x-pack/plugins/fleet/.storybook', grouping: 'packages/kbn-securitysolution-grouping/.storybook', home: 'src/plugins/home/.storybook', - infra: 'x-pack/plugins/infra/.storybook', + infra: 'x-pack/plugins/observability_solution/infra/.storybook', kibana_react: 'src/plugins/kibana_react/.storybook', lists: 'x-pack/plugins/lists/.storybook', - log_explorer: 'x-pack/plugins/log_explorer/.storybook', + log_explorer: 'x-pack/plugins/observability_solution/log_explorer/.storybook', management: 'packages/kbn-management/storybook/config', - observability: 'x-pack/plugins/observability/.storybook', - observability_ai_assistant: 'x-pack/plugins/observability_ai_assistant/.storybook', + observability: 'x-pack/plugins/observability_solution/observability/.storybook', + observability_ai_assistant: + 'x-pack/plugins/observability_solution/observability_ai_assistant/.storybook', presentation: 'src/plugins/presentation_util/storybook', random_sampling: 'x-pack/packages/kbn-random-sampling/.storybook', text_based_editor: 'packages/kbn-text-based-editor/.storybook', @@ -60,5 +61,5 @@ export const storybookAliases = { triggers_actions_ui: 'x-pack/plugins/triggers_actions_ui/.storybook', ui_actions_enhanced: 'src/plugins/ui_actions_enhanced/.storybook', unified_search: 'src/plugins/unified_search/.storybook', - profiling: 'x-pack/plugins/profiling/.storybook', + profiling: 'x-pack/plugins/observability_solution/profiling/.storybook', }; diff --git a/src/plugins/guided_onboarding/README.md b/src/plugins/guided_onboarding/README.md index 50132b0a03e9d..a7d1447d6da8b 100755 --- a/src/plugins/guided_onboarding/README.md +++ b/src/plugins/guided_onboarding/README.md @@ -125,7 +125,7 @@ To use the API service, you need to know a guide ID (currently one of `appSearch The guided onboarding exposes a function `registerGuideConfig(guideId: GuideId, guideConfig: GuideConfig)` function in its setup contract. This function allows consumers to register a guide config for a specified guide ID. The function throws an error if a config already exists for the guide ID. See code examples in following plugins: - enterprise search: `x-pack/plugins/enterprise_search/server/plugin.ts` -- observability: `x-pack/plugins/observability/server/plugin.ts` +- observability: `x-pack/plugins/observability_solution/observability/server/plugin.ts` - security solution: `x-pack/plugins/security_solution/server/plugin.ts` ## Adding a new guide diff --git a/src/plugins/vis_types/timeseries/server/plugin.ts b/src/plugins/vis_types/timeseries/server/plugin.ts index 194c6388bac80..fc891c758d575 100644 --- a/src/plugins/vis_types/timeseries/server/plugin.ts +++ b/src/plugins/vis_types/timeseries/server/plugin.ts @@ -62,7 +62,7 @@ export interface VisTypeTimeseriesSetup { getVisData: ( requestContext: VisTypeTimeseriesRequestHandlerContext, fakeRequest: KibanaRequest, - // ideally this should be VisPayload type, but currently has inconsistencies with x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts + // ideally this should be VisPayload type, but currently has inconsistencies with x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts options: any ) => Promise; } diff --git a/test/scripts/jenkins_apm_cypress.sh b/test/scripts/jenkins_apm_cypress.sh index 2ccd7d760fba5..dec74cc186656 100755 --- a/test/scripts/jenkins_apm_cypress.sh +++ b/test/scripts/jenkins_apm_cypress.sh @@ -5,7 +5,7 @@ source test/scripts/jenkins_test_setup_xpack.sh echo " -> Running APM cypress tests" cd "$XPACK_DIR" -node plugins/apm/scripts/test/e2e.js +node plugins/observability_solution/apm/scripts/test/e2e.js echo "" echo "" diff --git a/test/scripts/jenkins_uptime_playwright.sh b/test/scripts/jenkins_uptime_playwright.sh index 5bea30a223cd4..3981573e6852d 100755 --- a/test/scripts/jenkins_uptime_playwright.sh +++ b/test/scripts/jenkins_uptime_playwright.sh @@ -5,7 +5,7 @@ source test/scripts/jenkins_test_setup_xpack.sh echo " -> Running synthetics @elastic/synthetics tests" cd "$XPACK_DIR" -node plugins/synthetics/scripts/e2e.js +node plugins/observability_solution/synthetics/scripts/e2e.js echo "" echo "" diff --git a/test/scripts/jenkins_ux_synthetics.sh b/test/scripts/jenkins_ux_synthetics.sh index acf2611e36b94..bd0597b21d230 100755 --- a/test/scripts/jenkins_ux_synthetics.sh +++ b/test/scripts/jenkins_ux_synthetics.sh @@ -5,7 +5,7 @@ source test/scripts/jenkins_test_setup_xpack.sh echo " -> Running User Experience plugin @elastic/synthetics tests" cd "$XPACK_DIR" -node plugins/ux/scripts/e2e.js +node plugins/observability_solution/ux/scripts/e2e.js echo "" echo "" diff --git a/vars/tasks.groovy b/vars/tasks.groovy index 9a1ea053e9c49..6165d84500e81 100644 --- a/vars/tasks.groovy +++ b/vars/tasks.groovy @@ -150,7 +150,7 @@ def functionalXpack(Map params = [:]) { } whenChanged([ - 'x-pack/plugins/apm/', + 'x-pack/plugins/observability_solution/apm/', ]) { if (githubPr.isPr()) { task(kibanaPipeline.functionalTestProcess('xpack-APMCypress', './test/scripts/jenkins_apm_cypress.sh')) @@ -158,7 +158,7 @@ def functionalXpack(Map params = [:]) { } whenChanged([ - 'x-pack/plugins/synthetics/', + 'x-pack/plugins/observability_solution/synthetics/', ]) { if (githubPr.isPr()) { task(kibanaPipeline.functionalTestProcess('xpack-UptimePlaywright', './test/scripts/jenkins_uptime_playwright.sh')) @@ -166,7 +166,7 @@ def functionalXpack(Map params = [:]) { } whenChanged([ - 'x-pack/plugins/ux/', + 'x-pack/plugins/observability_solution/ux/', ]) { if (githubPr.isPr()) { task(kibanaPipeline.functionalTestProcess('xpack-uxPluginSynthetics', './test/scripts/jenkins_ux_synthetics.sh')) diff --git a/x-pack/.i18nrc.json b/x-pack/.i18nrc.json index 26a66f97ed31a..71fa98eeccb98 100644 --- a/x-pack/.i18nrc.json +++ b/x-pack/.i18nrc.json @@ -51,7 +51,7 @@ "xpack.logstash": ["plugins/logstash"], "xpack.main": "legacy/plugins/xpack_main", "xpack.maps": ["plugins/maps"], - "xpack.metricsData": "plugins/metrics_data_access", + "xpack.metricsData": "plugins/observability_solution/metrics_data_access", "xpack.ml": [ "packages/ml/anomaly_utils", "packages/ml/data_grid", diff --git a/x-pack/packages/ml/aiops_components/src/progress_controls/progress_controls.tsx b/x-pack/packages/ml/aiops_components/src/progress_controls/progress_controls.tsx index 4a2e38a4f3acf..1dcc35a433eb2 100644 --- a/x-pack/packages/ml/aiops_components/src/progress_controls/progress_controls.tsx +++ b/x-pack/packages/ml/aiops_components/src/progress_controls/progress_controls.tsx @@ -24,7 +24,7 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { useAnimatedProgressBarBackground } from './use_animated_progress_bar_background'; // TODO Consolidate with duplicate component `CorrelationsProgressControls` in -// `x-pack/plugins/apm/public/components/app/correlations/progress_controls.tsx` +// `x-pack/plugins/observability_solution/apm/public/components/app/correlations/progress_controls.tsx` /** * Props for ProgressControlProps diff --git a/x-pack/plugins/aiops/server/routes/log_rate_analysis/queries/fetch_index_info.ts b/x-pack/plugins/aiops/server/routes/log_rate_analysis/queries/fetch_index_info.ts index cfb9426a739ad..0075289fc78f3 100644 --- a/x-pack/plugins/aiops/server/routes/log_rate_analysis/queries/fetch_index_info.ts +++ b/x-pack/plugins/aiops/server/routes/log_rate_analysis/queries/fetch_index_info.ts @@ -16,7 +16,7 @@ import { getQueryWithParams } from './get_query_with_params'; import { getRequestBase } from './get_request_base'; // TODO Consolidate with duplicate `fetchPValues` in -// `x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_field_candidates.ts` +// `x-pack/plugins/observability_solution/apm/server/routes/correlations/queries/fetch_duration_field_candidates.ts` const POPULATED_DOC_COUNT_SAMPLE_SIZE = 1000; diff --git a/x-pack/plugins/aiops/server/routes/log_rate_analysis/queries/fetch_significant_term_p_values.ts b/x-pack/plugins/aiops/server/routes/log_rate_analysis/queries/fetch_significant_term_p_values.ts index 00bcd918f48d9..379df16c6dd46 100644 --- a/x-pack/plugins/aiops/server/routes/log_rate_analysis/queries/fetch_significant_term_p_values.ts +++ b/x-pack/plugins/aiops/server/routes/log_rate_analysis/queries/fetch_significant_term_p_values.ts @@ -25,7 +25,7 @@ import { getQueryWithParams } from './get_query_with_params'; import { getRequestBase } from './get_request_base'; // TODO Consolidate with duplicate `fetchDurationFieldCandidates` in -// `x-pack/plugins/apm/server/routes/correlations/queries/fetch_failed_events_correlation_p_values.ts` +// `x-pack/plugins/observability_solution/apm/server/routes/correlations/queries/fetch_failed_events_correlation_p_values.ts` export const getSignificantTermRequest = ( params: AiopsLogRateAnalysisSchema, diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/utils/saved_search_utils.ts b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/utils/saved_search_utils.ts index 04bc52bf08057..e7c5af48dbc9a 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/utils/saved_search_utils.ts +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/utils/saved_search_utils.ts @@ -6,7 +6,7 @@ */ // TODO Consolidate with duplicate component `CorrelationsProgressControls` in -// `x-pack/plugins/apm/public/components/app/correlations/progress_controls.tsx` +// `x-pack/plugins/observability_solution/apm/public/components/app/correlations/progress_controls.tsx` import { cloneDeep } from 'lodash'; import { IUiSettingsClient } from '@kbn/core/public'; import { diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/log_stream/log_stream.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/log_stream/log_stream.tsx index 5f3af9a500b9b..79884fd02848f 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/log_stream/log_stream.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/log_stream/log_stream.tsx @@ -16,7 +16,7 @@ import { LogStream, LogStreamProps } from '@kbn/logs-shared-plugin/public'; * default for timestamps. All other props get passed as-is to the underlying LogStream. * * Documentation links for reference: - * - https://github.com/elastic/kibana/blob/main/x-pack/plugins/logs_shared/public/components/log_stream/log_stream.stories.mdx + * - https://github.com/elastic/kibana/blob/main/x-pack/plugins/observability_solution/logs_shared/public/components/log_stream/log_stream.stories.mdx * - Run `yarn storybook logsShared` for live docs */ diff --git a/x-pack/plugins/enterprise_search/server/plugin.ts b/x-pack/plugins/enterprise_search/server/plugin.ts index 4a5e3689ded5c..85d5fa0857da6 100644 --- a/x-pack/plugins/enterprise_search/server/plugin.ts +++ b/x-pack/plugins/enterprise_search/server/plugin.ts @@ -264,7 +264,7 @@ export class EnterpriseSearchPlugin implements Plugin { /* * Register logs source configuration, used by LogStream components - * @see https://github.com/elastic/kibana/blob/main/x-pack/plugins/logs_shared/public/components/log_stream/log_stream.stories.mdx#with-a-source-configuration + * @see https://github.com/elastic/kibana/blob/main/x-pack/plugins/observability_solution/logs_shared/public/components/log_stream/log_stream.stories.mdx#with-a-source-configuration */ logsShared.logViews.defineInternalLogView(ENTERPRISE_SEARCH_RELEVANCE_LOGS_SOURCE_ID, { logIndices: { diff --git a/x-pack/plugins/observability_solution/apm/common/rules/apm_rule_types.ts b/x-pack/plugins/observability_solution/apm/common/rules/apm_rule_types.ts index 39659f146db8b..6b49fcd94289d 100644 --- a/x-pack/plugins/observability_solution/apm/common/rules/apm_rule_types.ts +++ b/x-pack/plugins/observability_solution/apm/common/rules/apm_rule_types.ts @@ -295,9 +295,9 @@ export type AnomalyAlertSeverityType = ValuesType< >['type']; // Server side registrations -// x-pack/plugins/apm/server/lib/alerts/.ts -// x-pack/plugins/apm/server/lib/alerts/register_apm_alerts.ts +// x-pack/plugins/observability_solution/apm/server/lib/alerts/.ts +// x-pack/plugins/observability_solution/apm/server/lib/alerts/register_apm_alerts.ts // Client side registrations: -// x-pack/plugins/apm/public/components/alerting//index.tsx -// x-pack/plugins/apm/public/components/alerting/register_apm_alerts +// x-pack/plugins/observability_solution/apm/public/components/alerting//index.tsx +// x-pack/plugins/observability_solution/apm/public/components/alerting/register_apm_alerts diff --git a/x-pack/plugins/observability_solution/apm/dev_docs/apm_queries.md b/x-pack/plugins/observability_solution/apm/dev_docs/apm_queries.md index acd20597389d9..7b0fd244bfdd5 100644 --- a/x-pack/plugins/observability_solution/apm/dev_docs/apm_queries.md +++ b/x-pack/plugins/observability_solution/apm/dev_docs/apm_queries.md @@ -56,7 +56,7 @@ A pre-aggregated document where `_doc_count` is the number of transaction events You can find all the APM transaction fields [here](https://www.elastic.co/guide/en/apm/server/current/exported-fields-apm-transaction.html). -The decision to use aggregated transactions or not is determined in [`getSearchTransactionsEvents`](https://github.com/elastic/kibana/blob/a2ac439f56313b7a3fc4708f54a4deebf2615136/x-pack/plugins/apm/server/lib/helpers/aggregated_transactions/index.ts#L53-L79) and then used to specify [the transaction index](https://github.com/elastic/kibana/blob/a2ac439f56313b7a3fc4708f54a4deebf2615136/x-pack/plugins/apm/server/lib/suggestions/get_suggestions.ts#L30-L32) and [the latency field](https://github.com/elastic/kibana/blob/a2ac439f56313b7a3fc4708f54a4deebf2615136/x-pack/plugins/apm/server/lib/alerts/chart_preview/get_transaction_duration.ts#L62-L65) +The decision to use aggregated transactions or not is determined in [`getSearchTransactionsEvents`](https://github.com/elastic/kibana/blob/a2ac439f56313b7a3fc4708f54a4deebf2615136/x-pack/plugins/observability_solution/apm/server/lib/helpers/aggregated_transactions/index.ts#L53-L79) and then used to specify [the transaction index](https://github.com/elastic/kibana/blob/a2ac439f56313b7a3fc4708f54a4deebf2615136/x-pack/plugins/observability_solution/apm/server/lib/suggestions/get_suggestions.ts#L30-L32) and [the latency field](https://github.com/elastic/kibana/blob/a2ac439f56313b7a3fc4708f54a4deebf2615136/x-pack/plugins/observability_solution/apm/server/lib/alerts/chart_preview/get_transaction_duration.ts#L62-L65) ### Latency @@ -101,7 +101,7 @@ GET apm-*-metric-*,metrics-apm*/_search?terminate_after=1000 } ``` -Please note: `metricset.name: transaction` was only recently introduced. To retain backwards compatability we still use the old filter `{ "exists": { "field": "transaction.duration.histogram" }}` when filtering for aggregated transactions ([see example](https://github.com/elastic/kibana/blob/2c8686770e64b82cf8e1db5a22327d40d5f8ce45/x-pack/plugins/apm/server/lib/helpers/aggregated_transactions/index.ts#L89-L95)). +Please note: `metricset.name: transaction` was only recently introduced. To retain backwards compatability we still use the old filter `{ "exists": { "field": "transaction.duration.histogram" }}` when filtering for aggregated transactions ([see example](https://github.com/elastic/kibana/blob/2c8686770e64b82cf8e1db5a22327d40d5f8ce45/x-pack/plugins/observability_solution/apm/server/lib/helpers/aggregated_transactions/index.ts#L89-L95)). ### Throughput @@ -291,7 +291,7 @@ System metrics are captured periodically (every 60 seconds by default). You can ![image](https://user-images.githubusercontent.com/209966/135990500-f85bd8d9-b5a5-4b7c-b9e1-0759eefb8a29.png) -Used in: [Metrics section](https://github.com/elastic/kibana/blob/00bb59713ed115343eb70d4e39059476edafbade/x-pack/plugins/apm/server/lib/metrics/by_agent/shared/cpu/index.ts#L83) +Used in: [Metrics section](https://github.com/elastic/kibana/blob/00bb59713ed115343eb70d4e39059476edafbade/x-pack/plugins/observability_solution/apm/server/lib/metrics/by_agent/shared/cpu/index.ts#L83) Noteworthy fields: `system.cpu.total.norm.pct`, `system.process.cpu.total.norm.pct` @@ -377,7 +377,7 @@ GET apm-*-metric-*,metrics-apm*/_search?terminate_after=1000 } ``` -The above example is overly simplified. In reality [we do a bit more](https://github.com/elastic/kibana/blob/fe9b5332e157fd456f81aecfd4ffa78d9e511a66/x-pack/plugins/apm/server/lib/metrics/by_agent/shared/memory/index.ts#L51-L71) to properly calculate memory usage inside containers. Please note that an [Exists Query](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-exists-query.html) is used in the filter context in the query to ensure that the memory fields exist. +The above example is overly simplified. In reality [we do a bit more](https://github.com/elastic/kibana/blob/fe9b5332e157fd456f81aecfd4ffa78d9e511a66/x-pack/plugins/observability_solution/apm/server/lib/metrics/by_agent/shared/memory/index.ts#L51-L71) to properly calculate memory usage inside containers. Please note that an [Exists Query](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-exists-query.html) is used in the filter context in the query to ensure that the memory fields exist. # Span breakdown metrics @@ -387,7 +387,7 @@ Span breakdown metrics are used to power the "Time spent by span type" graph. Ag ![image](https://user-images.githubusercontent.com/209966/135990865-9077ae3e-a7a4-4b5d-bdce-41dc832689ea.png) -Used in: ["Time spent by span type" chart](https://github.com/elastic/kibana/blob/723370ab23573e50b3524a62c6b9998f2042423d/x-pack/plugins/apm/server/lib/transactions/breakdown/index.ts#L48-L87) +Used in: ["Time spent by span type" chart](https://github.com/elastic/kibana/blob/723370ab23573e50b3524a62c6b9998f2042423d/x-pack/plugins/observability_solution/apm/server/lib/transactions/breakdown/index.ts#L48-L87) Noteworthy fields: `transaction.name`, `transaction.type`, `span.type`, `span.subtype`, `span.self_time.*` @@ -447,7 +447,7 @@ These metrics measure the count and total duration of requests from one service ![image](https://user-images.githubusercontent.com/209966/135990117-170070da-2fc5-4014-a597-0dda0970854c.png) -Used in: [Dependencies (latency)](https://github.com/elastic/kibana/blob/00bb59713ed115343eb70d4e39059476edafbade/x-pack/plugins/apm/server/lib/backends/get_latency_charts_for_backend.ts#L68-L79), [Dependencies (throughput)](https://github.com/elastic/kibana/blob/00bb59713ed115343eb70d4e39059476edafbade/x-pack/plugins/apm/server/lib/backends/get_throughput_charts_for_backend.ts#L67-L74) and [Service Map](https://github.com/elastic/kibana/blob/00bb59713ed115343eb70d4e39059476edafbade/x-pack/plugins/apm/server/lib/service_map/get_service_map_backend_node_info.ts#L57-L67) +Used in: [Dependencies (latency)](https://github.com/elastic/kibana/blob/00bb59713ed115343eb70d4e39059476edafbade/x-pack/plugins/observability_solution/apm/server/lib/backends/get_latency_charts_for_backend.ts#L68-L79), [Dependencies (throughput)](https://github.com/elastic/kibana/blob/00bb59713ed115343eb70d4e39059476edafbade/x-pack/plugins/observability_solution/apm/server/lib/backends/get_throughput_charts_for_backend.ts#L67-L74) and [Service Map](https://github.com/elastic/kibana/blob/00bb59713ed115343eb70d4e39059476edafbade/x-pack/plugins/observability_solution/apm/server/lib/service_map/get_service_map_backend_node_info.ts#L57-L67) Noteworthy fields: `span.destination.service.*` diff --git a/x-pack/plugins/observability_solution/apm/dev_docs/linting.md b/x-pack/plugins/observability_solution/apm/dev_docs/linting.md index 3dbd7b5b27484..23f5fc2da22cd 100644 --- a/x-pack/plugins/observability_solution/apm/dev_docs/linting.md +++ b/x-pack/plugins/observability_solution/apm/dev_docs/linting.md @@ -5,26 +5,27 @@ _Note: Run the commands from the root of Kibana._ ### Typescript ``` -node scripts/type_check.js --project x-pack/plugins/apm/tsconfig.json +node scripts/type_check.js --project x-pack/plugins/observability_solution/apm/tsconfig.json ``` ### Prettier ``` -yarn prettier "./x-pack/plugins/apm/**/*.{tsx,ts,js}" --write +yarn prettier "./x-pack/plugins/observability_solution/apm/**/*.{tsx,ts,js}" --write ``` ### ESLint ``` -node scripts/eslint.js x-pack/plugins/apm +node scripts/eslint.js x-pack/plugins/observability_solution/apm ``` ## Install pre-commit hook (optional) + In case you want to run a couple of checks like linting or check the file casing of the files to commit, we provide a way to install a pre-commit hook. To configure it you just need to run the following: `node scripts/register_git_hook` After the script completes the pre-commit hook will be created within the file .git/hooks/pre-commit. If you choose to not install it, don’t worry, we still run a quick CI check to provide feedback earliest as we can about the same checks. -More information about linting can be found in the [Kibana Guide](https://www.elastic.co/guide/en/kibana/current/kibana-linting.html). \ No newline at end of file +More information about linting can be found in the [Kibana Guide](https://www.elastic.co/guide/en/kibana/current/kibana-linting.html). diff --git a/x-pack/plugins/observability_solution/apm/dev_docs/local_setup.md b/x-pack/plugins/observability_solution/apm/dev_docs/local_setup.md index 9f3553f3c680c..f4e8427da189a 100644 --- a/x-pack/plugins/observability_solution/apm/dev_docs/local_setup.md +++ b/x-pack/plugins/observability_solution/apm/dev_docs/local_setup.md @@ -85,7 +85,7 @@ elasticsearch.password: changeme APM behaves differently depending on which role and permissions a logged in user has. To create APM users run: ```sh -node x-pack/plugins/apm/scripts/create_apm_users.js --username admin --password changeme --kibana-url http://localhost:5601 +node x-pack/plugins/observability_solution/apm/scripts/create_apm_users.js --username admin --password changeme --kibana-url http://localhost:5601 ``` This will create: diff --git a/x-pack/plugins/observability_solution/apm/dev_docs/telemetry.md b/x-pack/plugins/observability_solution/apm/dev_docs/telemetry.md index e11ea3bcdec33..71676da94731d 100644 --- a/x-pack/plugins/observability_solution/apm/dev_docs/telemetry.md +++ b/x-pack/plugins/observability_solution/apm/dev_docs/telemetry.md @@ -31,7 +31,7 @@ Once uploaded to the telemetry cluster, the data telemetry is stored in In order to collect a new telemetry field you need to add a task which performs the query that collects the data from the cluster. -All the available tasks are [here](https://github.com/elastic/kibana/blob/ba84602455671f0f6175bbc0fd2e8f302c60bbe6/x-pack/plugins/apm/server/lib/apm_telemetry/collect_data_telemetry/tasks.ts) +All the available tasks are [here](https://github.com/elastic/kibana/blob/ba84602455671f0f6175bbc0fd2e8f302c60bbe6/x-pack/plugins/observability_solution/apm/server/lib/apm_telemetry/collect_data_telemetry/tasks.ts) ### Debug telemetry @@ -61,7 +61,7 @@ The collection tasks also use the [`APMDataTelemetry` type](../server/lib/apm_te Running `node scripts/telemetry_check --fix` from the root Kibana directory will update the schemas which should automatically notify the Infra team when a pull request is opened so they can update the mapping in the telemetry clusters. -Running `node scripts/test/jest --updateSnapshot` from the `x-pack/plugins/apm` directory will update the +Running `node scripts/test/jest --updateSnapshot` from the `x-pack/plugins/observability_solution/apm` directory will update the mappings snapshot used in the jest tests. ## Behavioral Telemetry @@ -78,8 +78,8 @@ EBT is part of the core analytics service in Kibana and the `TelemetryService` p #### Collect a new event type -1. You need to define the event type in the [telemetry_events.ts](https://github.com/elastic/kibana/blob/4283802c195231f710be0d9870615fbc31382a31/x-pack/plugins/apm/public/services/telemetry/telemetry_events.ts#L36) -2. Define the tracking method in the [telemetry_client.ts](https://github.com/elastic/kibana/blob/4283802c195231f710be0d9870615fbc31382a31/x-pack/plugins/apm/public/services/telemetry/telemetry_client.ts#L18) +1. You need to define the event type in the [telemetry_events.ts](https://github.com/elastic/kibana/blob/4283802c195231f710be0d9870615fbc31382a31/x-pack/plugins/observability_solution/apm/public/services/telemetry/telemetry_events.ts#L36) +2. Define the tracking method in the [telemetry_client.ts](https://github.com/elastic/kibana/blob/4283802c195231f710be0d9870615fbc31382a31/x-pack/plugins/observability_solution/apm/public/services/telemetry/telemetry_client.ts#L18) 3. Use the tracking method with the telemetry client (`telemetry.reportSearchQuerySumbitted({property: test})`) In addition to the custom properties, analytics module automatically sends context properties. The list of the properties can be found [here](https://docs.elastic.dev/telemetry/collection/event-based-telemetry-context#browser-context) diff --git a/x-pack/plugins/observability_solution/apm/dev_docs/testing.md b/x-pack/plugins/observability_solution/apm/dev_docs/testing.md index 7ce4ed34b9e61..02ff43d37bf75 100644 --- a/x-pack/plugins/observability_solution/apm/dev_docs/testing.md +++ b/x-pack/plugins/observability_solution/apm/dev_docs/testing.md @@ -13,7 +13,7 @@ Unit testing is a good approach if you have a very specific piece of code with l ## Unit Tests (Jest) ``` -node x-pack/plugins/apm/scripts/test/jest [--watch] [--updateSnapshot] +node x-pack/plugins/observability_solution/apm/scripts/test/jest [--watch] [--updateSnapshot] ``` #### Coverage @@ -44,7 +44,7 @@ The API tests are located in [`x-pack/test/apm_api_integration/`](/x-pack/test/a #### Start server and run test (single process) ``` -node x-pack/plugins/apm/scripts/test/api [--trial/--basic] [--help] +node x-pack/plugins/observability_solution/apm/scripts/test/api [--trial/--basic] [--help] ``` The above command will start an ES instance on http://localhost:9220, a Kibana instance on http://localhost:5620 and run the api tests. @@ -55,10 +55,10 @@ Once the tests finish, the instances will be terminated. ```sh # start server -node x-pack/plugins/apm/scripts/test/api --server --basic +node x-pack/plugins/observability_solution/apm/scripts/test/api --server --basic # run tests -node x-pack/plugins/apm/scripts/test/api --runner --basic --grep-files=error_group_list +node x-pack/plugins/observability_solution/apm/scripts/test/api --runner --basic --grep-files=error_group_list ``` ### Update snapshots (from Kibana root) @@ -66,7 +66,7 @@ node x-pack/plugins/apm/scripts/test/api --runner --basic --grep-files=error_gro To update snapshots append `--updateSnapshots` to the `--runner` command: ``` -node x-pack/plugins/apm/scripts/test/api --runner --basic --updateSnapshots +node x-pack/plugins/observability_solution/apm/scripts/test/api --runner --basic --updateSnapshots ``` (The test server needs to be running) @@ -80,7 +80,7 @@ node x-pack/plugins/apm/scripts/test/api --runner --basic --updateSnapshots ## E2E Tests (Cypress) -The E2E tests are located in [`x-pack/plugins/apm/ftr_e2e`](../ftr_e2e). +The E2E tests are located in [`x-pack/plugins/observability_solution/apm/ftr_e2e`](../ftr_e2e). When PR is labeled with `apm:cypress-record`, test runs are recorded to the [Cypress Dashboard](https://dashboard.cypress.io). @@ -98,19 +98,19 @@ Tests run on buildkite PR pipeline are parallelized (4 parallel jobs) and are or #### Start test server ``` -node x-pack/plugins/apm/scripts/test/e2e --server +node x-pack/plugins/observability_solution/apm/scripts/test/e2e --server ``` #### Run tests ``` -node x-pack/plugins/apm/scripts/test/e2e --runner --open +node x-pack/plugins/observability_solution/apm/scripts/test/e2e --runner --open ``` ### Run tests multiple times to check for flakiness ``` -node x-pack/plugins/apm/scripts/test/e2e --runner --times [--spec ] +node x-pack/plugins/observability_solution/apm/scripts/test/e2e --runner --times [--spec ] ``` ### A11y checks @@ -131,7 +131,7 @@ node scripts/functional_test_runner --config x-pack/test/functional/apps/apm/con APM tests are located in `x-pack/test/functional/apps/apm`. For debugging access Elasticsearch on http://localhost:9220` (elastic/changeme) -diff --git a/x-pack/plugins/apm/scripts/test/README.md b/x-pack/plugins/apm/scripts/test/README.md +diff --git a/x-pack/plugins/observability_solution/apm/scripts/test/README.md b/x-pack/plugins/observability_solution/apm/scripts/test/README.md ## Serverless API tests diff --git a/x-pack/plugins/observability_solution/apm/dev_docs/updating_functional_tests_archives.md b/x-pack/plugins/observability_solution/apm/dev_docs/updating_functional_tests_archives.md index 3d1a5f0b00bb4..50a183d502c2f 100644 --- a/x-pack/plugins/observability_solution/apm/dev_docs/updating_functional_tests_archives.md +++ b/x-pack/plugins/observability_solution/apm/dev_docs/updating_functional_tests_archives.md @@ -3,6 +3,4 @@ Some of our API tests use an archive generated by the [`esarchiver`](https://www.elastic.co/guide/en/kibana/current/development-tests.html#development-functional-tests) script. Updating the main archive (`apm_8.0.0`) is a scripted process, where a 30m snapshot is downloaded from a cluster running the [APM Integration Testing server](https://github.com/elastic/apm-integration-testing). The script will copy the generated archives into the `fixtures/es_archiver` folders of our test suites (currently `basic` and `trial`). It will also generate a file that contains metadata about the archive, that can be imported to get the time range of the snapshot. Usage: -`node x-pack/plugins/apm/scripts/create_functional_tests_archive --es-url=https://admin:changeme@localhost:9200 --kibana-url=https://localhost:5601` - - +`node x-pack/plugins/observability_solution/apm/scripts/create_functional_tests_archive --es-url=https://admin:changeme@localhost:9200 --kibana-url=https://localhost:5601` diff --git a/x-pack/plugins/observability_solution/apm/dev_docs/vscode_setup.md b/x-pack/plugins/observability_solution/apm/dev_docs/vscode_setup.md index 9be3a53b52176..f054f99fafcd2 100644 --- a/x-pack/plugins/observability_solution/apm/dev_docs/vscode_setup.md +++ b/x-pack/plugins/observability_solution/apm/dev_docs/vscode_setup.md @@ -1,6 +1,6 @@ # Visual Studio Code -When using [Visual Studio Code](https://code.visualstudio.com/) with APM it's best to set up a [multi-root workspace](https://code.visualstudio.com/docs/editor/multi-root-workspaces) and add the `x-pack/plugins/apm` directory, the `x-pack` directory, and the root of the Kibana repository to the workspace. This makes it so you can navigate and search within APM and use the wider workspace roots when you need to widen your search. +When using [Visual Studio Code](https://code.visualstudio.com/) with APM it's best to set up a [multi-root workspace](https://code.visualstudio.com/docs/editor/multi-root-workspaces) and add the `x-pack/plugins/observability_solution/apm` directory, the `x-pack` directory, and the root of the Kibana repository to the workspace. This makes it so you can navigate and search within APM and use the wider workspace roots when you need to widen your search. ## Using the Jest extension @@ -31,10 +31,7 @@ To make the [VSCode debugger](https://vscode.readthedocs.io/en/latest/editor/deb "type": "node", "name": "vscode-jest-tests", "request": "launch", - "args": [ - "--runInBand", - "--config=${workspaceFolder}/jest.config.js" - ], + "args": ["--runInBand", "--config=${workspaceFolder}/jest.config.js"], "cwd": "${workspaceFolder}", "console": "integratedTerminal", "internalConsoleOptions": "neverOpen", diff --git a/x-pack/plugins/observability_solution/apm/ftr_e2e/README.md b/x-pack/plugins/observability_solution/apm/ftr_e2e/README.md index f62040babfe12..219b8a2048cf3 100644 --- a/x-pack/plugins/observability_solution/apm/ftr_e2e/README.md +++ b/x-pack/plugins/observability_solution/apm/ftr_e2e/README.md @@ -1,6 +1,6 @@ # APM E2E -APM uses [FTR](../../../../packages/kbn-test/README.md) (functional test runner) and [Cypress](https://www.cypress.io/) to run the e2e tests. The tests are located at `kibana/x-pack/plugins/apm/ftr_e2e/cypress/integration`. +APM uses [FTR](../../../../packages/kbn-test/README.md) (functional test runner) and [Cypress](https://www.cypress.io/) to run the e2e tests. The tests are located at `kibana/x-pack/plugins/observability_solution/apm/ftr_e2e/cypress/integration`. ## Tips and best practices @@ -71,7 +71,7 @@ it('calls the dependencies API', () => { ### Prefer `cy.visitKibana` instead of `cy.visit` -In most cases we should use [`cy.visitKibana`](https://github.com/elastic/kibana/blob/50821db39c07d5d35d510c8082d5c608c4e2fd4e/x-pack/plugins/apm/ftr_e2e/cypress/support/commands.ts#L51-L56) instead of `cy.visit`. +In most cases we should use [`cy.visitKibana`](https://github.com/elastic/kibana/blob/50821db39c07d5d35d510c8082d5c608c4e2fd4e/x-pack/plugins/observability_solution/apm/ftr_e2e/cypress/support/commands.ts#L51-L56) instead of `cy.visit`. `cy.visitKibana` will wait for Kibana to have successfully loaded before moving on. This will reduce the risk of timing out later in the test because we split up the wait time in two parts: Kibana load time, and APM load time thus a time budget for each (by default 40 seconds). ### Clean data before and after each test diff --git a/x-pack/plugins/observability_solution/apm/jest.config.js b/x-pack/plugins/observability_solution/apm/jest.config.js index 5d15dd048d4f1..8e02c46d7ecde 100644 --- a/x-pack/plugins/observability_solution/apm/jest.config.js +++ b/x-pack/plugins/observability_solution/apm/jest.config.js @@ -9,13 +9,16 @@ const path = require('path'); module.exports = { preset: '@kbn/test', - rootDir: path.resolve(__dirname, '../../..'), - roots: ['/x-pack/plugins/apm'], - setupFiles: ['/x-pack/plugins/apm/.storybook/jest_setup.js'], - coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/apm', + rootDir: path.resolve(__dirname, '../../../..'), + roots: ['/x-pack/plugins/observability_solution/apm'], + setupFiles: [ + '/x-pack/plugins/observability_solution/apm/.storybook/jest_setup.js', + ], + coverageDirectory: + '/target/kibana-coverage/jest/x-pack/plugins/observability_solution/apm', coverageReporters: ['text', 'html'], collectCoverageFrom: [ - '/x-pack/plugins/apm/{common,public,server}/**/*.{js,ts,tsx}', + '/x-pack/plugins/observability_solution/apm/{common,public,server}/**/*.{js,ts,tsx}', '!/**/*.stories.*', ], }; diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/onboarding/introduction.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/onboarding/introduction.tsx index 731769c030dfe..576e6cf0ccf91 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/onboarding/introduction.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/onboarding/introduction.tsx @@ -29,7 +29,9 @@ export function Introduction({ isBeta, guideLink }: IntroductionProps) { /> ); - const previewImage = useKibanaUrl('/plugins/apm/assets/apm.png'); + const previewImage = useKibanaUrl( + '/plugins/observability_solution/apm/assets/apm.png' + ); const rightSideItems = [ { order: 8300, euiIconType: 'logoObservability', appRoute: '/app/apm', - icon: 'plugins/apm/public/icon.svg', + icon: 'plugins/observability_solution/apm/public/icon.svg', category: DEFAULT_APP_CATEGORIES.observability, navLinkStatus: AppNavLinkStatus.visible, deepLinks: [ diff --git a/x-pack/plugins/observability_solution/apm/scripts/infer_route_return_types/index.ts b/x-pack/plugins/observability_solution/apm/scripts/infer_route_return_types/index.ts index c3fb30e2d17ac..770de10391a39 100644 --- a/x-pack/plugins/observability_solution/apm/scripts/infer_route_return_types/index.ts +++ b/x-pack/plugins/observability_solution/apm/scripts/infer_route_return_types/index.ts @@ -33,11 +33,12 @@ type ConvertibleDeclaration = | MethodDeclaration; const project = new Project({ - tsConfigFilePath: Path.resolve(__dirname, '../../../../../tsconfig.json'), + tsConfigFilePath: Path.resolve(__dirname, '../../../../../../tsconfig.json'), }); const glob = - (argv.glob as string | undefined) || 'x-pack/plugins/apm/server/**/route.ts'; + (argv.glob as string | undefined) || + 'x-pack/plugins/observability_solution/apm/server/**/route.ts'; const files = project.getSourceFiles(glob); diff --git a/x-pack/plugins/observability_solution/apm/scripts/precommit.js b/x-pack/plugins/observability_solution/apm/scripts/precommit.js index c018770a65553..2dc449368b68b 100644 --- a/x-pack/plugins/observability_solution/apm/scripts/precommit.js +++ b/x-pack/plugins/observability_solution/apm/scripts/precommit.js @@ -16,7 +16,10 @@ const root = resolve(__dirname, '../../../..'); const execaOpts = { cwd: root, stderr: 'pipe' }; -const tsconfig = resolve(root, 'x-pack/plugins/apm/tsconfig.json'); +const tsconfig = resolve( + root, + 'x-pack/plugins/observability_solution/apm/tsconfig.json' +); const testTsconfig = resolve(root, 'x-pack/test/tsconfig.json'); diff --git a/x-pack/plugins/observability_solution/apm/scripts/telemetry/main.ts b/x-pack/plugins/observability_solution/apm/scripts/telemetry/main.ts index 87d3c72e95fe8..1bab04e579fb7 100644 --- a/x-pack/plugins/observability_solution/apm/scripts/telemetry/main.ts +++ b/x-pack/plugins/observability_solution/apm/scripts/telemetry/main.ts @@ -8,7 +8,8 @@ import fs from 'fs'; import { apmSchema } from '../../server/lib/apm_telemetry/schema'; -const markdownFilePath = 'x-pack/plugins/apm/dev_docs/apm_telemetry_fields.md'; +const markdownFilePath = + 'x-pack/plugins/observability_solution/apm/dev_docs/apm_telemetry_fields.md'; function extractFieldDescriptions( schema: any, diff --git a/x-pack/plugins/observability_solution/apm/scripts/test/e2e.js b/x-pack/plugins/observability_solution/apm/scripts/test/e2e.js index ae0c8c8e10276..c3a4ce7af4357 100644 --- a/x-pack/plugins/observability_solution/apm/scripts/test/e2e.js +++ b/x-pack/plugins/observability_solution/apm/scripts/test/e2e.js @@ -58,7 +58,7 @@ if (cypressCliArgs.grep) { } const spawnArgs = [ - `../../../../scripts/${ftrScript}`, + `../../../../../scripts/${ftrScript}`, `--config=./ftr_config.ts`, `--kibana-install-dir=${argv.kibanaInstallDir}`, ...(argv.bail ? [`--bail`] : []), diff --git a/x-pack/plugins/observability_solution/apm/server/tutorial/index.ts b/x-pack/plugins/observability_solution/apm/server/tutorial/index.ts index b8201564f4154..9a4ae8cf554cf 100644 --- a/x-pack/plugins/observability_solution/apm/server/tutorial/index.ts +++ b/x-pack/plugins/observability_solution/apm/server/tutorial/index.ts @@ -96,6 +96,6 @@ It allows you to monitor the performance of thousands of applications in real ti isFleetPluginEnabled, cloudSetup: cloud, }), - previewImagePath: '/plugins/apm/assets/apm.png', + previewImagePath: '/plugins/observability_solution/apm/assets/apm.png', } as TutorialSchema; }; diff --git a/x-pack/plugins/observability_solution/apm/tsconfig.json b/x-pack/plugins/observability_solution/apm/tsconfig.json index 0571742360304..461a0ee0d5c39 100644 --- a/x-pack/plugins/observability_solution/apm/tsconfig.json +++ b/x-pack/plugins/observability_solution/apm/tsconfig.json @@ -4,7 +4,7 @@ "outDir": "target/types" }, "include": [ - "../../../typings/**/*", + "../../../../typings/**/*", "common/**/*", "public/**/*", "scripts/**/*", diff --git a/x-pack/plugins/observability_solution/apm_data_access/jest.config.js b/x-pack/plugins/observability_solution/apm_data_access/jest.config.js index 8fb297afcc48e..569b7beaad8c5 100644 --- a/x-pack/plugins/observability_solution/apm_data_access/jest.config.js +++ b/x-pack/plugins/observability_solution/apm_data_access/jest.config.js @@ -9,6 +9,6 @@ const path = require('path'); module.exports = { preset: '@kbn/test', - rootDir: path.resolve(__dirname, '../../..'), - roots: ['/x-pack/plugins/apm_data_access'], + rootDir: path.resolve(__dirname, '../../../..'), + roots: ['/x-pack/plugins/observability_solution/apm_data_access'], }; diff --git a/x-pack/plugins/observability_solution/apm_data_access/tsconfig.json b/x-pack/plugins/observability_solution/apm_data_access/tsconfig.json index faa5185404fd0..a65dbf578fe6a 100644 --- a/x-pack/plugins/observability_solution/apm_data_access/tsconfig.json +++ b/x-pack/plugins/observability_solution/apm_data_access/tsconfig.json @@ -3,7 +3,7 @@ "compilerOptions": { "outDir": "target/types" }, - "include": ["../../../typings/**/*", "common/**/*", "server/**/*", "jest.config.js"], + "include": ["../../../../typings/**/*", "common/**/*", "server/**/*", "jest.config.js"], "exclude": ["target/**/*"], "kbn_references": [ "@kbn/config-schema", diff --git a/x-pack/plugins/observability_solution/exploratory_view/README.md b/x-pack/plugins/observability_solution/exploratory_view/README.md index 417697988d649..67a73639cdf87 100644 --- a/x-pack/plugins/observability_solution/exploratory_view/README.md +++ b/x-pack/plugins/observability_solution/exploratory_view/README.md @@ -4,7 +4,7 @@ A shared component for visualizing observability data types via lens embeddable. ## Unit testing -Note: Run the following commands from `kibana/x-pack/plugins/exploratory_view`. +Note: Run the following commands from `kibana/x-pack/plugins/observability_solution/exploratory_view`. ### Run unit tests diff --git a/x-pack/plugins/observability_solution/exploratory_view/common/annotations.ts b/x-pack/plugins/observability_solution/exploratory_view/common/annotations.ts index e9b7c6b77b231..b30b563ccd0b0 100644 --- a/x-pack/plugins/observability_solution/exploratory_view/common/annotations.ts +++ b/x-pack/plugins/observability_solution/exploratory_view/common/annotations.ts @@ -12,7 +12,7 @@ import { either } from 'fp-ts/lib/Either'; * Checks whether a string is a valid ISO timestamp, * but doesn't convert it into a Date object when decoding. * - * Copied from x-pack/plugins/apm/common/runtime_types/date_as_string_rt.ts. + * Copied from x-pack/plugins/observability_solution/apm/common/runtime_types/date_as_string_rt.ts. */ const dateAsStringRt = new t.Type( 'DateAsString', diff --git a/x-pack/plugins/observability_solution/exploratory_view/e2e/README.md b/x-pack/plugins/observability_solution/exploratory_view/e2e/README.md index bd6161755d2db..62d49845bda7e 100644 --- a/x-pack/plugins/observability_solution/exploratory_view/e2e/README.md +++ b/x-pack/plugins/observability_solution/exploratory_view/e2e/README.md @@ -5,11 +5,11 @@ script for standing up the test server. ### Start the server -From `~/x-pack/plugins/exploratory_view/scripts`, run `node e2e.js --server`. Wait for the server to startup. It will provide you +From `~/x-pack/plugins/observability_solution/exploratory_view/scripts`, run `node e2e.js --server`. Wait for the server to startup. It will provide you with an example run command when it finishes. ### Run the tests -From this directory, `~/x-pack/plugins/exploratory_view/e2e`, you can now run `node ../../../../scripts/functional_test_runner --config synthetics_run.ts`. +From this directory, `~/x-pack/plugins/observability_solution/exploratory_view/e2e`, you can now run `node ../../../../../scripts/functional_test_runner --config synthetics_run.ts`. In addition to the usual flags like `--grep`, you can also specify `--no-headless` in order to view your tests as you debug/develop. diff --git a/x-pack/plugins/observability_solution/exploratory_view/jest.config.js b/x-pack/plugins/observability_solution/exploratory_view/jest.config.js index 55f93dc2afaf9..089c3b9ed3ce4 100644 --- a/x-pack/plugins/observability_solution/exploratory_view/jest.config.js +++ b/x-pack/plugins/observability_solution/exploratory_view/jest.config.js @@ -7,12 +7,15 @@ module.exports = { preset: '@kbn/test', - rootDir: '../../..', - roots: ['/x-pack/plugins/exploratory_view'], - setupFiles: ['/x-pack/plugins/exploratory_view/.storybook/jest_setup.js'], - coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/exploratory_view', + rootDir: '../../../..', + roots: ['/x-pack/plugins/observability_solution/exploratory_view'], + setupFiles: [ + '/x-pack/plugins/observability_solution/exploratory_view/.storybook/jest_setup.js', + ], + coverageDirectory: + '/target/kibana-coverage/jest/x-pack/plugins/observability_solution/exploratory_view', coverageReporters: ['text', 'html'], collectCoverageFrom: [ - '/x-pack/plugins/exploratory_view/{common,public,server}/**/*.{js,ts,tsx}', + '/x-pack/plugins/observability_solution/exploratory_view/{common,public,server}/**/*.{js,ts,tsx}', ], }; diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/README.md b/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/README.md index 6aea217a1aaa8..0fe3707ea5738 100644 --- a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/README.md +++ b/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/README.md @@ -1,21 +1,19 @@ # Exploratory view component -This component is used in observability plugin to show lens embeddable based observability visualizations. +This component is used in observability plugin to show lens embeddable based observability visualizations. The view is populated using configs stored as json within the view for each data type. This readme file contains few of the concepts being used in the component. Basic workflow for how exploratory view works, it looks like this - ![Exploratory view workflow](https://i.imgur.com/Kgyfd29.png) - ## Report Type The exploratory view report type controls how the data is visualized in the lens embeddable. The report type defines a set of constraints over the x and y axis. For example, the `kpi-over-time` report type is a time series chart type that plots key performance indicators over time, while the `data-distribution` chart plots the percentage of documents over key performance indicators. Current available data types can be found at `exploratory_view/configurations/constants`. -Each report type has one or more available visualizations to plot data from one or more data types. +Each report type has one or more available visualizations to plot data from one or more data types. ## Data Types @@ -33,34 +31,39 @@ After the dataView is created we also set field formats to promote human-readabi ### Visualization Configuration -Each data type may have one or more visualization configurations. The data type to visualization configuration can be found in [`exploratory_view/obs_exploratory_view`](https://github.com/elastic/kibana/blob/main/x-pack/plugins/observability/public/components/shared/exploratory_view/obsv_exploratory_view.tsx#L86) +Each data type may have one or more visualization configurations. The data type to visualization configuration can be found in [`exploratory_view/obs_exploratory_view`](https://github.com/elastic/kibana/blob/main/x-pack/plugins/observability_solution/observability/public/components/shared/exploratory_view/obsv_exploratory_view.tsx#L86) Each visualization configuration is mapped to a single report type. -Visualization configurations are used to define the UI we display for each report type and data type combination in the series builder. +Visualization configurations are used to define the UI we display for each report type and data type combination in the series builder. Visualization configuration define UI options and display, including available `metrics`, available `filters`, available `breakdown` options, definitions for human-readable `labels`, and more. The configuration also defines any custom base filters, which usually get pushed to a query, but are not displayed on the UI. You can also set more custom options on the configuration like colors which get used while rendering the chart. -Visualization configuration can be found at [`exploratory_view/configurations`](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations), where each data type typically has a folder that holds one or more visualization configurations. +Visualization configuration can be found at [`exploratory_view/configurations`](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/observability/public/components/shared/exploratory_view/configurations), where each data type typically has a folder that holds one or more visualization configurations. The configuration defined ultimately influences the lens embeddable attributes which get pushed to lens embeddable, rendering the chart. Some options in configuration are: #### Definition fields + They are also filters, but usually main filters, around which usually app UI is based. For apm, it could be service name and for uptime, monitor name. #### Filters + You can define base filters in kql form or data plugin filter format, filters are strongly typed. #### Breakdown fields + List of fields from an index pattern, UI will use this to populate breakdown option select. #### Labels + You can set key/value map for your field labels. UI will use these to set labels for data view fields. Sample config + ``` { reportType: ReportTypes.KPI, @@ -99,8 +102,6 @@ Sample config } ``` - - ## Lens Embeddable Lens embeddable is what actually renders the chart in exploratory view. @@ -112,6 +113,7 @@ Based on configuration, exploratory view generates layers and columns. Add a link to lens embeddable readme #### Example + A simple usage of lens embeddable example and playground options [embedded_lens_example](../../../../../../examples/embedded_lens_example) @@ -124,10 +126,9 @@ For that purpose, all the configuration options we define in the exploratory vie via a component that is exposed using observability plugin contract, usage looks like this -`const ExploratoryViewComponent = props.plugins.observability.ExploratoryViewEmbeddable; -` +`const ExploratoryViewComponent = props.plugins.observability.ExploratoryViewEmbeddable; ` -``` +``` /x-pack/plugins/infra'], - coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/infra', + rootDir: '../../../..', + roots: ['/x-pack/plugins/observability_solution/infra'], + coverageDirectory: + '/target/kibana-coverage/jest/x-pack/plugins/observability_solution/infra', coverageReporters: ['text', 'html'], - collectCoverageFrom: ['/x-pack/plugins/infra/{common,public,server}/**/*.{ts,tsx}'], + collectCoverageFrom: [ + '/x-pack/plugins/observability_solution/infra/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/x-pack/plugins/observability_solution/infra/public/pages/logs/page_content.tsx b/x-pack/plugins/observability_solution/infra/public/pages/logs/page_content.tsx index ca6c281a47309..215de1d7779f0 100644 --- a/x-pack/plugins/observability_solution/infra/public/pages/logs/page_content.tsx +++ b/x-pack/plugins/observability_solution/infra/public/pages/logs/page_content.tsx @@ -34,7 +34,7 @@ export const LogsPageContent: React.FunctionComponent = () => { useReadOnlyBadge(!uiCapabilities?.logs?.save); - // !! Need to be kept in sync with the deepLinks in x-pack/plugins/infra/public/plugin.ts + // !! Need to be kept in sync with the deepLinks in x-pack/plugins/observability_solution/infra/public/plugin.ts const streamTab = { app: 'logs', title: streamTabTitle, diff --git a/x-pack/plugins/observability_solution/infra/public/plugin.ts b/x-pack/plugins/observability_solution/infra/public/plugin.ts index a25e553faa2cf..d579ca3a9dc28 100644 --- a/x-pack/plugins/observability_solution/infra/public/plugin.ts +++ b/x-pack/plugins/observability_solution/infra/public/plugin.ts @@ -107,7 +107,7 @@ export class Plugin implements InfraClientPluginClass { core.settings.client.get$(enableInfrastructureHostsView), ]); - /** !! Need to be kept in sync with the deepLinks in x-pack/plugins/infra/public/plugin.ts */ + /** !! Need to be kept in sync with the deepLinks in x-pack/plugins/observability_solution/infra/public/plugin.ts */ pluginsSetup.observabilityShared.navigation.registerSections( startDep$AndHostViewFlag$.pipe( map( @@ -197,7 +197,7 @@ export class Plugin implements InfraClientPluginClass { euiIconType: 'logoObservability', order: 8100, appRoute: '/app/logs', - // !! Need to be kept in sync with the routes in x-pack/plugins/infra/public/pages/logs/page_content.tsx + // !! Need to be kept in sync with the routes in x-pack/plugins/observability_solution/infra/public/pages/logs/page_content.tsx deepLinks: [ { id: 'stream', @@ -239,7 +239,7 @@ export class Plugin implements InfraClientPluginClass { }); } - // !! Need to be kept in sync with the routes in x-pack/plugins/infra/public/pages/metrics/index.tsx + // !! Need to be kept in sync with the routes in x-pack/plugins/observability_solution/infra/public/pages/metrics/index.tsx const getInfraDeepLinks = ({ hostsEnabled, metricsExplorerEnabled, diff --git a/x-pack/plugins/observability_solution/infra/tsconfig.json b/x-pack/plugins/observability_solution/infra/tsconfig.json index 6b8ea95a0beeb..a710b1e63d7fd 100644 --- a/x-pack/plugins/observability_solution/infra/tsconfig.json +++ b/x-pack/plugins/observability_solution/infra/tsconfig.json @@ -3,7 +3,13 @@ "compilerOptions": { "outDir": "target/types" }, - "include": ["../../../typings/**/*", "common/**/*", "public/**/*", "server/**/*", "types/**/*"], + "include": [ + "../../../../typings/**/*", + "common/**/*", + "public/**/*", + "server/**/*", + "types/**/*" + ], "kbn_references": [ "@kbn/core", "@kbn/data-plugin", diff --git a/x-pack/plugins/observability_solution/log_explorer/jest.config.js b/x-pack/plugins/observability_solution/log_explorer/jest.config.js index fea1fd32ee5d9..bbcbd2fa078cd 100644 --- a/x-pack/plugins/observability_solution/log_explorer/jest.config.js +++ b/x-pack/plugins/observability_solution/log_explorer/jest.config.js @@ -7,9 +7,12 @@ module.exports = { preset: '@kbn/test', - rootDir: '../../..', - roots: ['/x-pack/plugins/log_explorer'], - coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/log_explorer', + rootDir: '../../../..', + roots: ['/x-pack/plugins/observability_solution/log_explorer'], + coverageDirectory: + '/target/kibana-coverage/jest/x-pack/plugins/observability_solution/log_explorer', coverageReporters: ['text', 'html'], - collectCoverageFrom: ['/x-pack/plugins/log_explorer/{common,public}/**/*.{ts,tsx}'], + collectCoverageFrom: [ + '/x-pack/plugins/observability_solution/log_explorer/{common,public}/**/*.{ts,tsx}', + ], }; diff --git a/x-pack/plugins/observability_solution/log_explorer/tsconfig.json b/x-pack/plugins/observability_solution/log_explorer/tsconfig.json index 70e391a917ce4..7b088ef9e6a59 100644 --- a/x-pack/plugins/observability_solution/log_explorer/tsconfig.json +++ b/x-pack/plugins/observability_solution/log_explorer/tsconfig.json @@ -4,7 +4,7 @@ "outDir": "target/types" }, "include": [ - "../../../typings/**/*", + "../../../../typings/**/*", "common/**/*", "public/**/*", "server/**/*", diff --git a/x-pack/plugins/observability_solution/logs_shared/jest.config.js b/x-pack/plugins/observability_solution/logs_shared/jest.config.js index 4d4168f2dbda4..2e3869ccf0573 100644 --- a/x-pack/plugins/observability_solution/logs_shared/jest.config.js +++ b/x-pack/plugins/observability_solution/logs_shared/jest.config.js @@ -7,11 +7,12 @@ module.exports = { preset: '@kbn/test', - rootDir: '../../..', - roots: ['/x-pack/plugins/logs_shared'], - coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/logs_shared', + rootDir: '../../../..', + roots: ['/x-pack/plugins/observability_solution/logs_shared'], + coverageDirectory: + '/target/kibana-coverage/jest/x-pack/plugins/observability_solution/logs_shared', coverageReporters: ['text', 'html'], collectCoverageFrom: [ - '/x-pack/plugins/logs_shared/{common,public,server}/**/*.{ts,tsx}', + '/x-pack/plugins/observability_solution/logs_shared/{common,public,server}/**/*.{ts,tsx}', ], }; diff --git a/x-pack/plugins/observability_solution/logs_shared/public/components/log_stream/log_stream.stories.mdx b/x-pack/plugins/observability_solution/logs_shared/public/components/log_stream/log_stream.stories.mdx index 36bddaf0a11d2..0cbc0a03f9184 100644 --- a/x-pack/plugins/observability_solution/logs_shared/public/components/log_stream/log_stream.stories.mdx +++ b/x-pack/plugins/observability_solution/logs_shared/public/components/log_stream/log_stream.stories.mdx @@ -80,7 +80,7 @@ The component also has a `filters` prop that accepts valid es-query `filters`. T ## Center the view on a specific entry -By default the component will load at the bottom of the list, showing the newest entries. You can change the rendering point with the `center` prop. The prop takes a [`LogEntriesCursor`](https://github.com/elastic/kibana/blob/0a6c748cc837c016901f69ff05d81395aa2d41c8/x-pack/plugins/logs_shared/common/http_api/log_entries/common.ts#L9-L13). +By default the component will load at the bottom of the list, showing the newest entries. You can change the rendering point with the `center` prop. The prop takes a [`LogEntriesCursor`](https://github.com/elastic/kibana/blob/0a6c748cc837c016901f69ff05d81395aa2d41c8/x-pack/plugins/observability_solution/logs_shared/common/http_api/log_entries/common.ts#L9-L13). ```tsx /x-pack/plugins/metrics_data_access'], - coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/metrics_data_access', + rootDir: '../../../..', + roots: ['/x-pack/plugins/observability_solution/metrics_data_access'], + coverageDirectory: + '/target/kibana-coverage/jest/x-pack/plugins/observability_solution/metrics_data_access', coverageReporters: ['text', 'html'], - collectCoverageFrom: ['/x-pack/plugins/metrics_data/{server}/**/*.test.ts'], + collectCoverageFrom: [ + '/x-pack/plugins/observability_solution/metrics_data/{server}/**/*.test.ts', + ], }; diff --git a/x-pack/plugins/observability_solution/metrics_data_access/tsconfig.json b/x-pack/plugins/observability_solution/metrics_data_access/tsconfig.json index c1d2e9957b9ee..ee11c062a55d1 100644 --- a/x-pack/plugins/observability_solution/metrics_data_access/tsconfig.json +++ b/x-pack/plugins/observability_solution/metrics_data_access/tsconfig.json @@ -3,7 +3,7 @@ "compilerOptions": { "outDir": "target/types" }, - "include": ["../../../typings/**/*", "server/**/*", "common/**/*", "public/**/*"], + "include": ["../../../../typings/**/*", "server/**/*", "common/**/*", "public/**/*"], "exclude": ["target/**/*"], "kbn_references": [ "@kbn/core", diff --git a/x-pack/plugins/observability_solution/observability/common/annotations.ts b/x-pack/plugins/observability_solution/observability/common/annotations.ts index e9b7c6b77b231..b30b563ccd0b0 100644 --- a/x-pack/plugins/observability_solution/observability/common/annotations.ts +++ b/x-pack/plugins/observability_solution/observability/common/annotations.ts @@ -12,7 +12,7 @@ import { either } from 'fp-ts/lib/Either'; * Checks whether a string is a valid ISO timestamp, * but doesn't convert it into a Date object when decoding. * - * Copied from x-pack/plugins/apm/common/runtime_types/date_as_string_rt.ts. + * Copied from x-pack/plugins/observability_solution/apm/common/runtime_types/date_as_string_rt.ts. */ const dateAsStringRt = new t.Type( 'DateAsString', diff --git a/x-pack/plugins/observability_solution/observability/docs/openapi/slo/README.md b/x-pack/plugins/observability_solution/observability/docs/openapi/slo/README.md index d7bd91627a5ef..25491ce3951b4 100644 --- a/x-pack/plugins/observability_solution/observability/docs/openapi/slo/README.md +++ b/x-pack/plugins/observability_solution/observability/docs/openapi/slo/README.md @@ -14,7 +14,7 @@ A guide about the OpenApi specification can be found at [https://swagger.io/docs ## Tools It is possible to manually validate the docs before bundling them with the following -command in the `x-pack/plugins/observability/docs/openapi/slo` folder: +command in the `x-pack/plugins/observability_solution/observability/docs/openapi/slo` folder: ```bash make validate diff --git a/x-pack/plugins/observability_solution/observability/jest.config.js b/x-pack/plugins/observability_solution/observability/jest.config.js index 39d8067d0efe4..77d49b80d8bf5 100644 --- a/x-pack/plugins/observability_solution/observability/jest.config.js +++ b/x-pack/plugins/observability_solution/observability/jest.config.js @@ -7,12 +7,15 @@ module.exports = { preset: '@kbn/test', - rootDir: '../../..', - roots: ['/x-pack/plugins/observability'], - setupFiles: ['/x-pack/plugins/observability/.storybook/jest_setup.js'], - coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/observability', + rootDir: '../../../..', + roots: ['/x-pack/plugins/observability_solution/observability'], + setupFiles: [ + '/x-pack/plugins/observability_solution/observability/.storybook/jest_setup.js', + ], + coverageDirectory: + '/target/kibana-coverage/jest/x-pack/plugins/observability_solution/observability', coverageReporters: ['text', 'html'], collectCoverageFrom: [ - '/x-pack/plugins/observability/{common,public,server}/**/*.{js,ts,tsx}', + '/x-pack/plugins/observability_solution/observability/{common,public,server}/**/*.{js,ts,tsx}', ], }; diff --git a/x-pack/plugins/observability_solution/observability/public/utils/datemath.ts b/x-pack/plugins/observability_solution/observability/public/utils/datemath.ts index 3fac2cf46933e..2df754edbe7cb 100644 --- a/x-pack/plugins/observability_solution/observability/public/utils/datemath.ts +++ b/x-pack/plugins/observability_solution/observability/public/utils/datemath.ts @@ -10,7 +10,7 @@ import { chain } from 'fp-ts/Either'; import { pipe } from 'fp-ts/pipeable'; import * as r from 'io-ts'; -// Copied from x-pack/plugins/infra/public/utils/datemath.ts +// Copied from x-pack/plugins/observability_solution/infra/public/utils/datemath.ts export function isValidDatemath(value: string): boolean { const parsedValue = dateMath.parse(value); return !!(parsedValue && parsedValue.isValid()); diff --git a/x-pack/plugins/observability_solution/observability/tsconfig.json b/x-pack/plugins/observability_solution/observability/tsconfig.json index 24f3fee40a70f..307ba3307f906 100644 --- a/x-pack/plugins/observability_solution/observability/tsconfig.json +++ b/x-pack/plugins/observability_solution/observability/tsconfig.json @@ -9,7 +9,7 @@ "public/**/*.json", "server/**/*", "typings/**/*", - "../../../typings/**/*" + "../../../../typings/**/*" ], "kbn_references": [ "@kbn/core", diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/jest.config.js b/x-pack/plugins/observability_solution/observability_ai_assistant/jest.config.js index 5eaabe2dcf492..b1333d1a63b4b 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/jest.config.js +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/jest.config.js @@ -7,7 +7,9 @@ module.exports = { preset: '@kbn/test', - rootDir: '../../..', - roots: ['/x-pack/plugins/observability_ai_assistant'], - setupFiles: ['/x-pack/plugins/observability_ai_assistant/.storybook/jest_setup.js'], + rootDir: '../../../..', + roots: ['/x-pack/plugins/observability_solution/observability_ai_assistant'], + setupFiles: [ + '/x-pack/plugins/observability_solution/observability_ai_assistant/.storybook/jest_setup.js', + ], }; diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/tsconfig.json b/x-pack/plugins/observability_solution/observability_ai_assistant/tsconfig.json index 44505948524cc..1a2b0b892cb0b 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/tsconfig.json +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/tsconfig.json @@ -4,7 +4,7 @@ "outDir": "target/types" }, "include": [ - "../../../typings/**/*", + "../../../../typings/**/*", "common/**/*", "public/**/*", "typings/**/*", diff --git a/x-pack/plugins/observability_solution/observability_log_explorer/jest.config.js b/x-pack/plugins/observability_solution/observability_log_explorer/jest.config.js index f258a72a9d0c6..523b2c32289ce 100644 --- a/x-pack/plugins/observability_solution/observability_log_explorer/jest.config.js +++ b/x-pack/plugins/observability_solution/observability_log_explorer/jest.config.js @@ -7,12 +7,12 @@ module.exports = { preset: '@kbn/test', - rootDir: '../../..', - roots: ['/x-pack/plugins/observability_log_explorer'], + rootDir: '../../../..', + roots: ['/x-pack/plugins/observability_solution/observability_log_explorer'], coverageDirectory: - '/target/kibana-coverage/jest/x-pack/plugins/observability_log_explorer', + '/target/kibana-coverage/jest/x-pack/plugins/observability_solution/observability_log_explorer', coverageReporters: ['text', 'html'], collectCoverageFrom: [ - '/x-pack/plugins/observability_log_explorer/{common,public}/**/*.{ts,tsx}', + '/x-pack/plugins/observability_solution/observability_log_explorer/{common,public}/**/*.{ts,tsx}', ], }; diff --git a/x-pack/plugins/observability_solution/observability_log_explorer/tsconfig.json b/x-pack/plugins/observability_solution/observability_log_explorer/tsconfig.json index 230c8794a5e8b..644c4fb9f2cea 100644 --- a/x-pack/plugins/observability_solution/observability_log_explorer/tsconfig.json +++ b/x-pack/plugins/observability_solution/observability_log_explorer/tsconfig.json @@ -4,7 +4,7 @@ "outDir": "target/types" }, "include": [ - "../../../typings/**/*", + "../../../../typings/**/*", "common/**/*", "public/**/*", "server/**/*", diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/README.md b/x-pack/plugins/observability_solution/observability_onboarding/e2e/README.md index 4d3e15318c64f..5ee9eaba5039c 100644 --- a/x-pack/plugins/observability_solution/observability_onboarding/e2e/README.md +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/README.md @@ -24,6 +24,7 @@ node x-pack/plugins/observability_onboarding/scripts/test/e2e --server ``` ### Run tests + Runs all tests in the terminal ``` @@ -31,21 +32,23 @@ node x-pack/plugins/observability_onboarding/scripts/test/e2e --runner ``` ### Open cypress dashboard + Opens cypress dashboard, there it's possible to select what test you want to run. ``` node x-pack/plugins/observability_onboarding/scripts/test/e2e --open ``` + ### Arguments -| Option | Description | -| ------------ | ----------------------------------------------- | -| --server | Only start ES and Kibana | -| --runner | Only run tests | -| --spec | Specify the specs to run | -| --times | Repeat the test n number of times | -| --bail | stop tests after the first failure | +| Option | Description | +| -------- | ---------------------------------- | +| --server | Only start ES and Kibana | +| --runner | Only run tests | +| --spec | Specify the specs to run | +| --times | Repeat the test n number of times | +| --bail | stop tests after the first failure | ``` -node x-pack/plugins/observability_onboarding/scripts/test/e2e.js --runner --spec cypress/e2e/home.cy.ts --times 2 -``` \ No newline at end of file +node x-pack/plugins/observability_solution/observability_onboarding/scripts/test/e2e.js --runner --spec cypress/e2e/home.cy.ts --times 2 +``` diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/ftr_config.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/ftr_config.ts index c042c085b37d0..876ca1d2abfe4 100644 --- a/x-pack/plugins/observability_solution/observability_onboarding/e2e/ftr_config.ts +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/ftr_config.ts @@ -13,10 +13,10 @@ const kibanaYamlFilePath = path.join(__dirname, './ftr_kibana.yml'); async function ftrConfig({ readConfigFile }: FtrConfigProviderContext) { const kibanaCommonTestsConfig = await readConfigFile( - require.resolve('../../../../test/common/config.js') + require.resolve('../../../../../test/common/config.js') ); const xpackFunctionalTestsConfig = await readConfigFile( - require.resolve('../../../test/functional/config.base.js') + require.resolve('../../../../test/functional/config.base.js') ); return { diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/tsconfig.json b/x-pack/plugins/observability_solution/observability_onboarding/e2e/tsconfig.json index 3f586efcfc2d9..52223ecdcf447 100644 --- a/x-pack/plugins/observability_solution/observability_onboarding/e2e/tsconfig.json +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/tsconfig.json @@ -8,7 +8,7 @@ "isolatedModules": false }, "kbn_references": [ - { "path": "../../../test/tsconfig.json" }, + { "path": "../../../../../test/tsconfig.json" }, { "path": "../../../../test/tsconfig.json" }, "@kbn/test", "@kbn/dev-utils", diff --git a/x-pack/plugins/observability_solution/observability_onboarding/jest.config.js b/x-pack/plugins/observability_solution/observability_onboarding/jest.config.js index 66a2f768ca0ff..dac775b60d25b 100644 --- a/x-pack/plugins/observability_solution/observability_onboarding/jest.config.js +++ b/x-pack/plugins/observability_solution/observability_onboarding/jest.config.js @@ -9,6 +9,8 @@ const path = require('path'); module.exports = { preset: '@kbn/test', - rootDir: path.resolve(__dirname, '../../..'), - roots: ['/x-pack/plugins/observability_onboarding'], + rootDir: path.resolve(__dirname, '../../../..'), + roots: [ + '/x-pack/plugins/observability_solution/observability_onboarding', + ], }; diff --git a/x-pack/plugins/observability_solution/observability_onboarding/scripts/test/e2e.js b/x-pack/plugins/observability_solution/observability_onboarding/scripts/test/e2e.js index 8a584a84bdc87..b727c63d8328e 100644 --- a/x-pack/plugins/observability_solution/observability_onboarding/scripts/test/e2e.js +++ b/x-pack/plugins/observability_solution/observability_onboarding/scripts/test/e2e.js @@ -65,7 +65,7 @@ if (cypressCliArgs.grep) { const ftrConfig = argv.open ? './ftr_config_open.ts' : './ftr_config_runner.ts'; const spawnArgs = [ - `../../../../scripts/${ftrScript}`, + `../../../../../scripts/${ftrScript}`, `--config=${ftrConfig}`, `--kibana-install-dir=${argv.kibanaInstallDir}`, ...(argv.bail ? [`--bail`] : []), diff --git a/x-pack/plugins/observability_solution/observability_onboarding/server/routes/logs/route.ts b/x-pack/plugins/observability_solution/observability_onboarding/server/routes/logs/route.ts index a11dcd918f3ed..46220fe7f0d7f 100644 --- a/x-pack/plugins/observability_solution/observability_onboarding/server/routes/logs/route.ts +++ b/x-pack/plugins/observability_solution/observability_onboarding/server/routes/logs/route.ts @@ -61,7 +61,7 @@ const installShipperSetupRoute = createObservabilityOnboardingServerRoute({ core.setup.http.basePath.publicBaseUrl ?? // priority given to server.publicBaseUrl plugins.cloud?.setup?.kibanaUrl ?? // then cloud id getFallbackKibanaUrl(coreStart); // falls back to local network binding - const scriptDownloadUrl = `${kibanaUrl}/plugins/observabilityOnboarding/assets/standalone_agent_setup.sh`; + const scriptDownloadUrl = `${kibanaUrl}/plugins/observability_solution/observabilityOnboarding/assets/standalone_agent_setup.sh`; const apiEndpoint = `${kibanaUrl}/internal/observability_onboarding`; return { diff --git a/x-pack/plugins/observability_solution/observability_onboarding/tsconfig.json b/x-pack/plugins/observability_solution/observability_onboarding/tsconfig.json index 41ed437aee5f5..d59ae8ffc4cd7 100644 --- a/x-pack/plugins/observability_solution/observability_onboarding/tsconfig.json +++ b/x-pack/plugins/observability_solution/observability_onboarding/tsconfig.json @@ -4,7 +4,7 @@ "outDir": "target/types" }, "include": [ - "../../../typings/**/*", + "../../../../typings/**/*", "common/**/*", "public/**/*", "typings/**/*", diff --git a/x-pack/plugins/observability_solution/observability_shared/jest.config.js b/x-pack/plugins/observability_solution/observability_shared/jest.config.js index 4820bc69ae4ab..9151980b83c39 100644 --- a/x-pack/plugins/observability_solution/observability_shared/jest.config.js +++ b/x-pack/plugins/observability_solution/observability_shared/jest.config.js @@ -7,12 +7,15 @@ module.exports = { preset: '@kbn/test', - rootDir: '../../..', - roots: ['/x-pack/plugins/observability_shared'], - setupFiles: ['/x-pack/plugins/observability_shared/.storybook/jest_setup.js'], - coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/observability_shared', + rootDir: '../../../..', + roots: ['/x-pack/plugins/observability_solution/observability_shared'], + setupFiles: [ + '/x-pack/plugins/observability_solution/observability_shared/.storybook/jest_setup.js', + ], + coverageDirectory: + '/target/kibana-coverage/jest/x-pack/plugins/observability_solution/observability_shared', coverageReporters: ['text', 'html'], collectCoverageFrom: [ - '/x-pack/plugins/observability_shared/{common,public,server}/**/*.{js,ts,tsx}', + '/x-pack/plugins/observability_solution/observability_shared/{common,public,server}/**/*.{js,ts,tsx}', ], }; diff --git a/x-pack/plugins/observability_solution/observability_shared/public/components/tour/tour.tsx b/x-pack/plugins/observability_solution/observability_shared/public/components/tour/tour.tsx index 49083bf307e31..c1af04cd11d2f 100644 --- a/x-pack/plugins/observability_solution/observability_shared/public/components/tour/tour.tsx +++ b/x-pack/plugins/observability_solution/observability_shared/public/components/tour/tour.tsx @@ -130,7 +130,9 @@ const getSteps = ({ diff --git a/x-pack/plugins/observability_solution/observability_shared/tsconfig.json b/x-pack/plugins/observability_solution/observability_shared/tsconfig.json index 4b7d412be2669..e83bf77676a77 100644 --- a/x-pack/plugins/observability_solution/observability_shared/tsconfig.json +++ b/x-pack/plugins/observability_solution/observability_shared/tsconfig.json @@ -9,7 +9,7 @@ "public/**/*.json", "server/**/*", "typings/**/*", - "../../../typings/**/*" + "../../../../typings/**/*" ], "kbn_references": [ "@kbn/core", diff --git a/x-pack/plugins/observability_solution/profiling/README.md b/x-pack/plugins/observability_solution/profiling/README.md index 869bba9fb1a1b..c6b27a2be5457 100644 --- a/x-pack/plugins/observability_solution/profiling/README.md +++ b/x-pack/plugins/observability_solution/profiling/README.md @@ -1,21 +1,26 @@ # Universal Profiling (Beta) ## Overview + Universal Profiling provides fleet-wide, whole-system, continuous profiling with zero instrumentation. Get a comprehensive understanding of what lines of code are consuming compute resources throughout your entire fleet by visualizing your data in Kibana using the flamegraph, stacktraces, and top functions views. ### Universal profiling setup -Universal Profiling is enabled by default on [Elastic Cloud](https://www.elastic.co/cloud/), and you can find it under **Observability**. To see data in Universal Profiling, you need to initialize it. + +Universal Profiling is enabled by default on [Elastic Cloud](https://www.elastic.co/cloud/), and you can find it under **Observability**. To see data in Universal Profiling, you need to initialize it. ##### **Initialize Universal Profiling** + Initialize Universal Profiling by navigating to one of the views and clicking the **Set up** button. Clicking this will trigger some checks and install some packages so data can be processed. The following are some of the actions and checks that occur during initialization: + - Check that the APM integration is installed and configured. - Create Universal Profiling indices. - Install the Collector integration. - Install the Symbolizer integration. ### Collector integration + The Collector is the component that receives data from the profiling agents deployed on users machines. It runs a gRPC server over HTTPS and exposes an endpoint where the profiling agents can send data. @@ -28,52 +33,55 @@ The "Add Data" page will display instructions for several deployment methodologi The instructions contain both the endpoint and the token that allow profiling agent to connect to the Collector. ### Symbolizer integration + The Symbolizer is the component processing debug symbols for the received profiles data, enriching with source-code metadata the profiling visualizations. It processes both publicly-available debug symbols and "private" debug symbols. For public symbols, users don't have to do anything: the symbolizer asynchronously intercepts unsymbolized frames and populates them automatically. -For private symbols, an HTTPS endpoint is provided to users for uploading the debug symbols of the software they own. +For private symbols, an HTTPS endpoint is provided to users for uploading the debug symbols of the software they own. The authentication and authorization on this endpoint are provided as part of the request, in form of an Elasticsearch API key. - ## Testing (unit, e2e) + ### Unit Tests (Jest) ``` -node scripts/jest --config x-pack/plugins/profiling/jest.config.js [--watchAll] +node scripts/jest --config x-pack/plugins/observability_solution/profiling/jest.config.js [--watchAll] ``` ## E2E Tests (Cypress) -The E2E tests are located in [`x-pack/plugins/profiling/e2e`](./e2e). -Universal Profiling uses [FTR](../../../packages/kbn-test/README.mdx) (functional test runner) and [Cypress](https://www.cypress.io/) to run the e2e tests. The tests are located at `kibana/x-pack/plugins/profiling/e2e/cypress/e2e`. +The E2E tests are located in [`x-pack/plugins/observability_solution/profiling/e2e`](./e2e). + +Universal Profiling uses [FTR](../../../packages/kbn-test/README.mdx) (functional test runner) and [Cypress](https://www.cypress.io/) to run the e2e tests. The tests are located at `kibana/x-pack/plugins/observability_solution/profiling/e2e/cypress/e2e`. ### Start test server ``` -node x-pack/plugins/profiling/scripts/test/e2e --server +node x-pack/plugins/observability_solution/profiling/scripts/test/e2e --server ``` ### Open cypress dashboard ``` -node x-pack/plugins/profiling/scripts/test/e2e --open +node x-pack/plugins/observability_solution/profiling/scripts/test/e2e --open ``` ### Run tests in terminal ``` -node x-pack/plugins/profiling/scripts/test/e2e --runner +node x-pack/plugins/observability_solution/profiling/scripts/test/e2e --runner ``` ### Run like CI ``` -node x-pack/plugins/profiling/scripts/test/e2e +node x-pack/plugins/observability_solution/profiling/scripts/test/e2e ``` ## Other resources -- [Official Profiling documentation](https://www.elastic.co/observability/universal-profiling) \ No newline at end of file + +- [Official Profiling documentation](https://www.elastic.co/observability/universal-profiling) diff --git a/x-pack/plugins/observability_solution/profiling/common/__fixtures__/README.md b/x-pack/plugins/observability_solution/profiling/common/__fixtures__/README.md index 1a26bca590668..2414eae2fdb49 100644 --- a/x-pack/plugins/observability_solution/profiling/common/__fixtures__/README.md +++ b/x-pack/plugins/observability_solution/profiling/common/__fixtures__/README.md @@ -1,6 +1,6 @@ The stacktrace fixtures in this directory are originally from Elasticsearch's `POST /_profiling/stacktraces` endpoint. They were subsequently filtered -through the `shrink_stacktrace_response.js` command in `x-pack/plugins/profiling/scripts/` +through the `shrink_stacktrace_response.js` command in `x-pack/plugins/observability_solution/profiling/scripts/` to reduce the size without losing sampling fidelity (see the script for further details). @@ -14,4 +14,4 @@ where `seconds` is the time span of the original query and `upsampling rate` is the reciprocal of the sampling rate returned from the original query. To add a new stacktrace fixture to the test suite, update `stacktraces.ts` -appropriately. \ No newline at end of file +appropriately. diff --git a/x-pack/plugins/observability_solution/profiling/e2e/README.md b/x-pack/plugins/observability_solution/profiling/e2e/README.md index d6324be09ea67..84dcad7d1dcb5 100644 --- a/x-pack/plugins/observability_solution/profiling/e2e/README.md +++ b/x-pack/plugins/observability_solution/profiling/e2e/README.md @@ -1,10 +1,10 @@ # Profiling E2E tests -Profiling uses [FTR](../../../../packages/kbn-test/README.md) (functional test runner) and [Cypress](https://www.cypress.io/) to run the e2e tests. The tests are located at `kibana/x-pack/plugins/profiling/e2e/cypress/e2e`. +Profiling uses [FTR](../../../../packages/kbn-test/README.md) (functional test runner) and [Cypress](https://www.cypress.io/) to run the e2e tests. The tests are located at `kibana/x-pack/plugins/observability_solution/profiling/e2e/cypress/e2e`. ## E2E Tests (Cypress) -The E2E tests are located in [`x-pack/plugins/profiling/e2e`](../e2e). +The E2E tests are located in [`x-pack/plugins/observability_solution/profiling/e2e`](../e2e). Tests run on buildkite PR pipeline are parallelized (4 parallel jobs) and are orchestrated by the Cypress dashboard service. It can be configured in [.buildkite/pipelines/pull_request/profiling_cypress.yml](https://github.com/elastic/kibana/blob/main/.buildkite/pipelines/pull_request/profiling_cypress.yml) with the property `parallelism`. @@ -20,32 +20,35 @@ Tests run on buildkite PR pipeline are parallelized (4 parallel jobs) and are or ### Start test server ``` -node x-pack/plugins/profiling/scripts/test/e2e --server +node x-pack/plugins/observability_solution/profiling/scripts/test/e2e --server ``` ### Run tests + Runs all tests in the terminal ``` -node x-pack/plugins/profiling/scripts/test/e2e --runner +node x-pack/plugins/observability_solution/profiling/scripts/test/e2e --runner ``` ### Open cypress dashboard + Opens cypress dashboard, there it's possible to select what test you want to run. ``` -node x-pack/plugins/profiling/scripts/test/e2e --open +node x-pack/plugins/observability_solution/profiling/scripts/test/e2e --open ``` + ### Arguments -| Option | Description | -| ------------ | ----------------------------------------------- | -| --server | Only start ES and Kibana | -| --runner | Only run tests | -| --spec | Specify the specs to run | -| --times | Repeat the test n number of times | -| --bail | stop tests after the first failure | +| Option | Description | +| -------- | ---------------------------------- | +| --server | Only start ES and Kibana | +| --runner | Only run tests | +| --spec | Specify the specs to run | +| --times | Repeat the test n number of times | +| --bail | stop tests after the first failure | ``` -node x-pack/plugins/profiling/scripts/test/e2e.js --runner --spec cypress/e2e/profiling.cy.ts --times 2 -``` \ No newline at end of file +node x-pack/plugins/observability_solution/profiling/scripts/test/e2e.js --runner --spec cypress/e2e/profiling.cy.ts --times 2 +``` diff --git a/x-pack/plugins/observability_solution/profiling/e2e/ftr_config.ts b/x-pack/plugins/observability_solution/profiling/e2e/ftr_config.ts index c042c085b37d0..876ca1d2abfe4 100644 --- a/x-pack/plugins/observability_solution/profiling/e2e/ftr_config.ts +++ b/x-pack/plugins/observability_solution/profiling/e2e/ftr_config.ts @@ -13,10 +13,10 @@ const kibanaYamlFilePath = path.join(__dirname, './ftr_kibana.yml'); async function ftrConfig({ readConfigFile }: FtrConfigProviderContext) { const kibanaCommonTestsConfig = await readConfigFile( - require.resolve('../../../../test/common/config.js') + require.resolve('../../../../../test/common/config.js') ); const xpackFunctionalTestsConfig = await readConfigFile( - require.resolve('../../../test/functional/config.base.js') + require.resolve('../../../../test/functional/config.base.js') ); return { diff --git a/x-pack/plugins/observability_solution/profiling/e2e/tsconfig.json b/x-pack/plugins/observability_solution/profiling/e2e/tsconfig.json index 30abba7217ad9..e835e992c256c 100644 --- a/x-pack/plugins/observability_solution/profiling/e2e/tsconfig.json +++ b/x-pack/plugins/observability_solution/profiling/e2e/tsconfig.json @@ -8,7 +8,7 @@ "isolatedModules": false }, "kbn_references": [ - { "path": "../../../test/tsconfig.json" }, + { "path": "../../../../../test/tsconfig.json" }, { "path": "../../../../test/tsconfig.json" }, "@kbn/test", "@kbn/dev-utils", diff --git a/x-pack/plugins/observability_solution/profiling/jest.config.js b/x-pack/plugins/observability_solution/profiling/jest.config.js index 783ace59b9b3d..4d2d187d9f10c 100644 --- a/x-pack/plugins/observability_solution/profiling/jest.config.js +++ b/x-pack/plugins/observability_solution/profiling/jest.config.js @@ -7,9 +7,12 @@ module.exports = { preset: '@kbn/test', - rootDir: '../../..', - roots: ['/x-pack/plugins/profiling'], - coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/profiling', + rootDir: '../../../..', + roots: ['/x-pack/plugins/observability_solution/profiling'], + coverageDirectory: + '/target/kibana-coverage/jest/x-pack/plugins/observability_solution/profiling', coverageReporters: ['text', 'html'], - collectCoverageFrom: ['/x-pack/plugins/profiling/{common,public,server}/**/*.{ts,tsx}'], + collectCoverageFrom: [ + '/x-pack/plugins/observability_solution/profiling/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/x-pack/plugins/observability_solution/profiling/scripts/test/e2e.js b/x-pack/plugins/observability_solution/profiling/scripts/test/e2e.js index 8a584a84bdc87..b727c63d8328e 100644 --- a/x-pack/plugins/observability_solution/profiling/scripts/test/e2e.js +++ b/x-pack/plugins/observability_solution/profiling/scripts/test/e2e.js @@ -65,7 +65,7 @@ if (cypressCliArgs.grep) { const ftrConfig = argv.open ? './ftr_config_open.ts' : './ftr_config_runner.ts'; const spawnArgs = [ - `../../../../scripts/${ftrScript}`, + `../../../../../scripts/${ftrScript}`, `--config=${ftrConfig}`, `--kibana-install-dir=${argv.kibanaInstallDir}`, ...(argv.bail ? [`--bail`] : []), diff --git a/x-pack/plugins/observability_solution/profiling_data_access/jest.config.js b/x-pack/plugins/observability_solution/profiling_data_access/jest.config.js index c87c047a5ea73..4f4a7c2e32202 100644 --- a/x-pack/plugins/observability_solution/profiling_data_access/jest.config.js +++ b/x-pack/plugins/observability_solution/profiling_data_access/jest.config.js @@ -9,6 +9,6 @@ const path = require('path'); module.exports = { preset: '@kbn/test', - rootDir: path.resolve(__dirname, '../../..'), - roots: ['/x-pack/plugins/profiling_data_access'], + rootDir: path.resolve(__dirname, '../../../..'), + roots: ['/x-pack/plugins/observability_solution/profiling_data_access'], }; diff --git a/x-pack/plugins/observability_solution/serverless_observability/tsconfig.json b/x-pack/plugins/observability_solution/serverless_observability/tsconfig.json index af132bc8cc933..eb1c52aa93c3a 100644 --- a/x-pack/plugins/observability_solution/serverless_observability/tsconfig.json +++ b/x-pack/plugins/observability_solution/serverless_observability/tsconfig.json @@ -9,7 +9,7 @@ "public/**/*.ts", "public/**/*.tsx", "server/**/*.ts", - "../../../typings/**/*" + "../../../../typings/**/*" ], "exclude": ["target/**/*"], "kbn_references": [ diff --git a/x-pack/plugins/observability_solution/synthetics/.buildkite/pipelines/flaky.sh b/x-pack/plugins/observability_solution/synthetics/.buildkite/pipelines/flaky.sh index eda3407803633..58c2c88a8d836 100755 --- a/x-pack/plugins/observability_solution/synthetics/.buildkite/pipelines/flaky.sh +++ b/x-pack/plugins/observability_solution/synthetics/.buildkite/pipelines/flaky.sh @@ -5,4 +5,4 @@ set -euo pipefail UUID="$(cat /proc/sys/kernel/random/uuid)" export UUID -node x-pack/plugins/synthetics/.buildkite/pipelines/flaky.js | buildkite-agent pipeline upload +node x-pack/plugins/observability_solution/synthetics/.buildkite/pipelines/flaky.js | buildkite-agent pipeline upload diff --git a/x-pack/plugins/observability_solution/synthetics/README.md b/x-pack/plugins/observability_solution/synthetics/README.md index afb3309e788e9..bdc078e8607d7 100644 --- a/x-pack/plugins/observability_solution/synthetics/README.md +++ b/x-pack/plugins/observability_solution/synthetics/README.md @@ -45,7 +45,7 @@ There's also a `rest_api` folder that defines the structure of the RESTful API e Documentation: https://www.elastic.co/guide/en/kibana/current/development-tests.html#_unit_testing ``` -yarn test:jest x-pack/plugins/synthetics +yarn test:jest x-pack/plugins/observability_solution/synthetics ``` ### Functional tests diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/README.md b/x-pack/plugins/observability_solution/synthetics/e2e/README.md index 72a873e6986fb..e0216d6c7dc56 100644 --- a/x-pack/plugins/observability_solution/synthetics/e2e/README.md +++ b/x-pack/plugins/observability_solution/synthetics/e2e/README.md @@ -5,7 +5,7 @@ script for standing up the test server. ### Start the server -From `~/x-pack/plugins/synthetics/scripts`, run `node e2e.js --server`. Wait for the server to startup. It will provide you +From `~/x-pack/plugins/observability_solution/synthetics/scripts`, run `node e2e.js --server`. Wait for the server to startup. It will provide you with an example run command when it finishes. ### Run the tests @@ -14,7 +14,6 @@ From the same directory you can now run `node e2e.js --runner`. In addition to the usual flags like `--grep`, you can also specify `--no-headless` in order to view your tests as you debug/develop. - ## Uptime App Tests These tests rely on the Kibana functional test runner. There is a Kibana config in this directory, and a dedicated @@ -22,7 +21,7 @@ script for standing up the test server. ### Start the server -From `~/x-pack/plugins/synthetics/scripts`, run `node uptime_e2e.js --server`. Wait for the server to startup. It will provide you +From `~/x-pack/plugins/observability_solution/synthetics/scripts`, run `node uptime_e2e.js --server`. Wait for the server to startup. It will provide you with an example run command when it finishes. ### Run the tests diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/config.ts b/x-pack/plugins/observability_solution/synthetics/e2e/config.ts index 3745680315dcf..f46ebe093bc6f 100644 --- a/x-pack/plugins/observability_solution/synthetics/e2e/config.ts +++ b/x-pack/plugins/observability_solution/synthetics/e2e/config.ts @@ -14,10 +14,10 @@ const SERVICE_USERNAME = 'xpack.uptime.service.username'; async function config({ readConfigFile }: FtrConfigProviderContext) { const kibanaCommonTestsConfig = await readConfigFile( - require.resolve('../../../../test/common/config.js') + require.resolve('../../../../../test/common/config.js') ); const xpackFunctionalTestsConfig = await readConfigFile( - require.resolve('../../../test/functional/config.base.js') + require.resolve('../../../../test/functional/config.base.js') ); const kibanaConfig = readKibanaConfig(); diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/tasks/read_kibana_config.ts b/x-pack/plugins/observability_solution/synthetics/e2e/tasks/read_kibana_config.ts index 3867386e41104..f8c8dc2eb6fdd 100644 --- a/x-pack/plugins/observability_solution/synthetics/e2e/tasks/read_kibana_config.ts +++ b/x-pack/plugins/observability_solution/synthetics/e2e/tasks/read_kibana_config.ts @@ -12,7 +12,7 @@ import yaml from 'js-yaml'; export type KibanaConfig = ReturnType; export const readKibanaConfig = () => { - const kibanaConfigDir = path.join(__filename, '../../../../../../config'); + const kibanaConfigDir = path.join(__filename, '../../../../../../../config'); const kibanaDevConfig = path.join(kibanaConfigDir, 'kibana.dev.yml'); const kibanaConfig = path.join(kibanaConfigDir, 'kibana.yml'); diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/tsconfig.json b/x-pack/plugins/observability_solution/synthetics/e2e/tsconfig.json index 61e3f84a301e6..082077cdae8e4 100644 --- a/x-pack/plugins/observability_solution/synthetics/e2e/tsconfig.json +++ b/x-pack/plugins/observability_solution/synthetics/e2e/tsconfig.json @@ -8,7 +8,7 @@ "isolatedModules": false }, "kbn_references": [ - { "path": "../../../test/tsconfig.json" }, + { "path": "../../../../../test/tsconfig.json" }, { "path": "../../../../test/tsconfig.json" }, "@kbn/test", "@kbn/dev-utils", diff --git a/x-pack/plugins/observability_solution/synthetics/jest.config.js b/x-pack/plugins/observability_solution/synthetics/jest.config.js index de4161347ae40..1ae53b847be24 100644 --- a/x-pack/plugins/observability_solution/synthetics/jest.config.js +++ b/x-pack/plugins/observability_solution/synthetics/jest.config.js @@ -7,9 +7,12 @@ module.exports = { preset: '@kbn/test', - rootDir: '../../..', - roots: ['/x-pack/plugins/synthetics'], - coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/synthetics', + rootDir: '../../../..', + roots: ['/x-pack/plugins/observability_solution/synthetics'], + coverageDirectory: + '/target/kibana-coverage/jest/x-pack/plugins/observability_solution/synthetics', coverageReporters: ['text', 'html'], - collectCoverageFrom: ['/x-pack/plugins/synthetics/{common,public,server}/**/*.{ts,tsx}'], + collectCoverageFrom: [ + '/x-pack/plugins/observability_solution/synthetics/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/x-pack/plugins/observability_solution/synthetics/scripts/base_e2e.js b/x-pack/plugins/observability_solution/synthetics/scripts/base_e2e.js index 9cf6afcb2eb73..03ae51b78a972 100644 --- a/x-pack/plugins/observability_solution/synthetics/scripts/base_e2e.js +++ b/x-pack/plugins/observability_solution/synthetics/scripts/base_e2e.js @@ -61,17 +61,17 @@ function executeSyntheticsRunner(dirPath, config = './synthetics_run.ts') { if (server) { childProcess.execSync( - `node ../../../../scripts/${ftrScript} --config ${config} ${kbnInstallDir}`, + `node ../../../../../scripts/${ftrScript} --config ${config} ${kbnInstallDir}`, options ); } else if (runner) { childProcess.execSync( - `node ../../../../scripts/${ftrScript} --config ${config} ${kbnInstallDir} --headless ${headless} --bail ${pauseOnError} ${grepArg}`, + `node ../../../../../scripts/${ftrScript} --config ${config} ${kbnInstallDir} --headless ${headless} --bail ${pauseOnError} ${grepArg}`, options ); } else { childProcess.execSync( - `node ../../../../scripts/${ftrScript} --config ${config} ${kbnInstallDir} ${grepArg}`, + `node ../../../../../scripts/${ftrScript} --config ${config} ${kbnInstallDir} ${grepArg}`, options ); } diff --git a/x-pack/plugins/observability_solution/synthetics/tsconfig.json b/x-pack/plugins/observability_solution/synthetics/tsconfig.json index 3bd6be93a0955..ed72f0bf6fe9d 100644 --- a/x-pack/plugins/observability_solution/synthetics/tsconfig.json +++ b/x-pack/plugins/observability_solution/synthetics/tsconfig.json @@ -3,7 +3,13 @@ "compilerOptions": { "outDir": "target/types" }, - "include": ["common/**/*", "scripts/**/*", "public/**/*", "server/**/*", "../../../typings/**/*"], + "include": [ + "common/**/*", + "scripts/**/*", + "public/**/*", + "server/**/*", + "../../../../typings/**/*" + ], "kbn_references": [ "@kbn/alerting-plugin", "@kbn/ml-plugin", diff --git a/x-pack/plugins/observability_solution/uptime/.buildkite/pipelines/flaky.sh b/x-pack/plugins/observability_solution/uptime/.buildkite/pipelines/flaky.sh index eda3407803633..58c2c88a8d836 100755 --- a/x-pack/plugins/observability_solution/uptime/.buildkite/pipelines/flaky.sh +++ b/x-pack/plugins/observability_solution/uptime/.buildkite/pipelines/flaky.sh @@ -5,4 +5,4 @@ set -euo pipefail UUID="$(cat /proc/sys/kernel/random/uuid)" export UUID -node x-pack/plugins/synthetics/.buildkite/pipelines/flaky.js | buildkite-agent pipeline upload +node x-pack/plugins/observability_solution/synthetics/.buildkite/pipelines/flaky.js | buildkite-agent pipeline upload diff --git a/x-pack/plugins/observability_solution/uptime/README.md b/x-pack/plugins/observability_solution/uptime/README.md index afb3309e788e9..bdc078e8607d7 100644 --- a/x-pack/plugins/observability_solution/uptime/README.md +++ b/x-pack/plugins/observability_solution/uptime/README.md @@ -45,7 +45,7 @@ There's also a `rest_api` folder that defines the structure of the RESTful API e Documentation: https://www.elastic.co/guide/en/kibana/current/development-tests.html#_unit_testing ``` -yarn test:jest x-pack/plugins/synthetics +yarn test:jest x-pack/plugins/observability_solution/synthetics ``` ### Functional tests diff --git a/x-pack/plugins/observability_solution/uptime/e2e/README.md b/x-pack/plugins/observability_solution/uptime/e2e/README.md index 9a7617cd3d055..0ee0a41e5cd63 100644 --- a/x-pack/plugins/observability_solution/uptime/e2e/README.md +++ b/x-pack/plugins/observability_solution/uptime/e2e/README.md @@ -5,7 +5,7 @@ script for standing up the test server. ### Start the server -From `~/x-pack/plugins/synthetics/scripts`, run `node e2e.js --server`. Wait for the server to startup. It will provide you +From `~/x-pack/plugins/observability_solution/synthetics/scripts`, run `node e2e.js --server`. Wait for the server to startup. It will provide you with an example run command when it finishes. ### Run the tests @@ -14,7 +14,6 @@ From the same directory you can now run `node node e2e.js --runner`. In addition to the usual flags like `--grep`, you can also specify `--no-headless` in order to view your tests as you debug/develop. - ## Uptime App Tests These tests rely on the Kibana functional test runner. There is a Kibana config in this directory, and a dedicated @@ -22,7 +21,7 @@ script for standing up the test server. ### Start the server -From `~/x-pack/plugins/synthetics/scripts`, run `node uptime_e2e.js --server`. Wait for the server to startup. It will provide you +From `~/x-pack/plugins/observability_solution/synthetics/scripts`, run `node uptime_e2e.js --server`. Wait for the server to startup. It will provide you with an example run command when it finishes. ### Run the tests diff --git a/x-pack/plugins/observability_solution/uptime/e2e/config.ts b/x-pack/plugins/observability_solution/uptime/e2e/config.ts index 3745680315dcf..f46ebe093bc6f 100644 --- a/x-pack/plugins/observability_solution/uptime/e2e/config.ts +++ b/x-pack/plugins/observability_solution/uptime/e2e/config.ts @@ -14,10 +14,10 @@ const SERVICE_USERNAME = 'xpack.uptime.service.username'; async function config({ readConfigFile }: FtrConfigProviderContext) { const kibanaCommonTestsConfig = await readConfigFile( - require.resolve('../../../../test/common/config.js') + require.resolve('../../../../../test/common/config.js') ); const xpackFunctionalTestsConfig = await readConfigFile( - require.resolve('../../../test/functional/config.base.js') + require.resolve('../../../../test/functional/config.base.js') ); const kibanaConfig = readKibanaConfig(); diff --git a/x-pack/plugins/observability_solution/uptime/e2e/tasks/read_kibana_config.ts b/x-pack/plugins/observability_solution/uptime/e2e/tasks/read_kibana_config.ts index 3867386e41104..f8c8dc2eb6fdd 100644 --- a/x-pack/plugins/observability_solution/uptime/e2e/tasks/read_kibana_config.ts +++ b/x-pack/plugins/observability_solution/uptime/e2e/tasks/read_kibana_config.ts @@ -12,7 +12,7 @@ import yaml from 'js-yaml'; export type KibanaConfig = ReturnType; export const readKibanaConfig = () => { - const kibanaConfigDir = path.join(__filename, '../../../../../../config'); + const kibanaConfigDir = path.join(__filename, '../../../../../../../config'); const kibanaDevConfig = path.join(kibanaConfigDir, 'kibana.dev.yml'); const kibanaConfig = path.join(kibanaConfigDir, 'kibana.yml'); diff --git a/x-pack/plugins/observability_solution/uptime/e2e/tsconfig.json b/x-pack/plugins/observability_solution/uptime/e2e/tsconfig.json index 61e3f84a301e6..082077cdae8e4 100644 --- a/x-pack/plugins/observability_solution/uptime/e2e/tsconfig.json +++ b/x-pack/plugins/observability_solution/uptime/e2e/tsconfig.json @@ -8,7 +8,7 @@ "isolatedModules": false }, "kbn_references": [ - { "path": "../../../test/tsconfig.json" }, + { "path": "../../../../../test/tsconfig.json" }, { "path": "../../../../test/tsconfig.json" }, "@kbn/test", "@kbn/dev-utils", diff --git a/x-pack/plugins/observability_solution/uptime/jest.config.js b/x-pack/plugins/observability_solution/uptime/jest.config.js index baafb5ce133e6..4dafe7fdb8d5f 100644 --- a/x-pack/plugins/observability_solution/uptime/jest.config.js +++ b/x-pack/plugins/observability_solution/uptime/jest.config.js @@ -7,9 +7,12 @@ module.exports = { preset: '@kbn/test', - rootDir: '../../..', - roots: ['/x-pack/plugins/uptime'], - coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/uptime', + rootDir: '../../../..', + roots: ['/x-pack/plugins/observability_solution/uptime'], + coverageDirectory: + '/target/kibana-coverage/jest/x-pack/plugins/observability_solution/uptime', coverageReporters: ['text', 'html'], - collectCoverageFrom: ['/x-pack/plugins/uptime/{common,public,server}/**/*.{ts,tsx}'], + collectCoverageFrom: [ + '/x-pack/pluginsobservability_solution/uptime/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/x-pack/plugins/observability_solution/uptime/scripts/base_e2e.js b/x-pack/plugins/observability_solution/uptime/scripts/base_e2e.js index 99fb58cf81d6a..9ac0bb4211b13 100644 --- a/x-pack/plugins/observability_solution/uptime/scripts/base_e2e.js +++ b/x-pack/plugins/observability_solution/uptime/scripts/base_e2e.js @@ -61,17 +61,17 @@ function executeSyntheticsRunner(dirPath, config = './synthetics_run.ts') { if (server) { childProcess.execSync( - `node ../../../../scripts/${ftrScript} --config ${config} ${kbnInstallDir}`, + `node ../../../../../scripts/${ftrScript} --config ${config} ${kbnInstallDir}`, options ); } else if (runner) { childProcess.execSync( - `node ../../../../scripts/${ftrScript} --config ${config} ${kbnInstallDir} --headless ${headless} --bail ${pauseOnError} ${grepArg}`, + `node ../../../../../scripts/${ftrScript} --config ${config} ${kbnInstallDir} --headless ${headless} --bail ${pauseOnError} ${grepArg}`, options ); } else { childProcess.execSync( - `node ../../../../scripts/${ftrScript} --config ${config} ${kbnInstallDir} ${grepArg}`, + `node ../../../../../scripts/${ftrScript} --config ${config} ${kbnInstallDir} ${grepArg}`, options ); } diff --git a/x-pack/plugins/observability_solution/uptime/tsconfig.json b/x-pack/plugins/observability_solution/uptime/tsconfig.json index 699c9042104fd..2cd1ff34b7277 100644 --- a/x-pack/plugins/observability_solution/uptime/tsconfig.json +++ b/x-pack/plugins/observability_solution/uptime/tsconfig.json @@ -10,7 +10,7 @@ "public/legacy_uptime/components/monitor/status_details/location_map/embeddables/low_poly_layer.json", "server/**/*", "server/legacy_uptime/lib/requests/__fixtures__/monitor_charts_mock.json", - "../../../typings/**/*" + "../../../../typings/**/*" ], "kbn_references": [ "@kbn/core", diff --git a/x-pack/plugins/observability_solution/ux/.buildkite/pipelines/flaky.sh b/x-pack/plugins/observability_solution/ux/.buildkite/pipelines/flaky.sh index 452abaa94c60d..8e5548aeb83a9 100644 --- a/x-pack/plugins/observability_solution/ux/.buildkite/pipelines/flaky.sh +++ b/x-pack/plugins/observability_solution/ux/.buildkite/pipelines/flaky.sh @@ -5,4 +5,4 @@ set -euo pipefail UUID="$(cat /proc/sys/kernel/random/uuid)" export UUID -node x-pack/plugins/ux/.buildkite/pipelines/flaky.js | buildkite-agent pipeline upload \ No newline at end of file +node x-pack/plugins/observability_solution/ux/.buildkite/pipelines/flaky.js | buildkite-agent pipeline upload \ No newline at end of file diff --git a/x-pack/plugins/observability_solution/ux/e2e/README.md b/x-pack/plugins/observability_solution/ux/e2e/README.md index c2a9b81c7f40b..60c6d2f643b77 100644 --- a/x-pack/plugins/observability_solution/ux/e2e/README.md +++ b/x-pack/plugins/observability_solution/ux/e2e/README.md @@ -5,11 +5,11 @@ script for standing up the test server. ### Start the server -From `~/x-pack/plugins/ux/scripts`, run `node e2e.js --server`. Wait for the server to startup. It will provide you +From `~/x-pack/plugins/observability_solution/ux/scripts`, run `node e2e.js --server`. Wait for the server to startup. It will provide you with an example run command when it finishes. ### Run the tests -From this directory, `~/x-pack/plugins/ux/e2e`, you can now run `node ../../../../scripts/functional_test_runner --config synthetics_run.ts`. +From this directory, `~/x-pack/plugins/observability_solution/ux/e2e`, you can now run `node ../../../../../scripts/functional_test_runner --config synthetics_run.ts`. In addition to the usual flags like `--grep`, you can also specify `--no-headless` in order to view your tests as you debug/develop. diff --git a/x-pack/plugins/observability_solution/ux/jest.config.js b/x-pack/plugins/observability_solution/ux/jest.config.js index f380a059e5547..b83d3a7ba5455 100644 --- a/x-pack/plugins/observability_solution/ux/jest.config.js +++ b/x-pack/plugins/observability_solution/ux/jest.config.js @@ -9,6 +9,6 @@ const path = require('path'); module.exports = { preset: '@kbn/test', - rootDir: path.resolve(__dirname, '../../..'), - roots: ['/x-pack/plugins/ux'], + rootDir: path.resolve(__dirname, '../../../..'), + roots: ['/x-pack/plugins/observability_solution/ux'], }; diff --git a/x-pack/plugins/observability_solution/ux/readme.md b/x-pack/plugins/observability_solution/ux/readme.md index d05a550ffdbd2..84a77b9e7827e 100644 --- a/x-pack/plugins/observability_solution/ux/readme.md +++ b/x-pack/plugins/observability_solution/ux/readme.md @@ -6,9 +6,9 @@ https://docs.elastic.dev/kibana-dev-docs/welcome The tests are managed via the `scripts/e2e.js` file. This script accepts numerous options. -From the kibana root you can run `node x-pack/plugins/ux/scripts/e2e.js` to simply stand up the stack, load data, and run the tests. +From the kibana root you can run `node x-pack/plugins/observability_solution/ux/scripts/e2e.js` to simply stand up the stack, load data, and run the tests. If you are developing a new test, it is better to stand up the stack in one shell and load data/run tests in a second session. You can do this by running: -- `node ./x-pack/plugins/ux/scripts/e2e.js --server` -- `node ./x-pack/plugins/ux/scripts/e2e.js --runner`, you can also specify `--grep "{TEST_NAME}"` to run a specific series of tests \ No newline at end of file +- `node ./x-pack/plugins/observability_solution/ux/scripts/e2e.js --server` +- `node ./x-pack/plugins/observability_solution/ux/scripts/e2e.js --runner`, you can also specify `--grep "{TEST_NAME}"` to run a specific series of tests diff --git a/x-pack/plugins/observability_solution/ux/tsconfig.json b/x-pack/plugins/observability_solution/ux/tsconfig.json index 1557c80f24ad5..6db6362f04027 100644 --- a/x-pack/plugins/observability_solution/ux/tsconfig.json +++ b/x-pack/plugins/observability_solution/ux/tsconfig.json @@ -4,7 +4,7 @@ "outDir": "target/types" }, "include": [ - "../../../typings/**/*", + "../../../../typings/**/*", "common/**/*", "public/**/*", "server/**/*", diff --git a/x-pack/plugins/security/server/lib/flatten_object.ts b/x-pack/plugins/security/server/lib/flatten_object.ts index 45c0a3b6bbf13..f655422115890 100644 --- a/x-pack/plugins/security/server/lib/flatten_object.ts +++ b/x-pack/plugins/security/server/lib/flatten_object.ts @@ -7,7 +7,7 @@ import { compact, isObject } from 'lodash'; -// Inspired by x-pack/plugins/apm/public/utils/flatten_object.ts +// Inspired by x-pack/plugins/observability_solution/apm/public/utils/flatten_object.ts // Slighly modified to have key/value exposed as Object. export const flattenObject = ( item: Record | null | undefined, diff --git a/x-pack/plugins/security_solution/server/utils/build_query/calculate_timeseries_interval.ts b/x-pack/plugins/security_solution/server/utils/build_query/calculate_timeseries_interval.ts index 071d1d6b4db2f..1d388465a21fb 100644 --- a/x-pack/plugins/security_solution/server/utils/build_query/calculate_timeseries_interval.ts +++ b/x-pack/plugins/security_solution/server/utils/build_query/calculate_timeseries_interval.ts @@ -7,7 +7,7 @@ /* ** Applying the same logic as: - ** x-pack/plugins/apm/server/lib/helpers/get_bucket_size/calculate_auto.js + ** x-pack/plugins/observability_solution/apm/server/lib/helpers/get_bucket_size/calculate_auto.js */ import moment from 'moment'; diff --git a/x-pack/test/observability_onboarding_api_integration/tests/logs/environment.spec.ts b/x-pack/test/observability_onboarding_api_integration/tests/logs/environment.spec.ts index 95626901d452a..9b05e35b09a69 100644 --- a/x-pack/test/observability_onboarding_api_integration/tests/logs/environment.spec.ts +++ b/x-pack/test/observability_onboarding_api_integration/tests/logs/environment.spec.ts @@ -28,7 +28,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { `${MOCKED_PUBLIC_BASE_URL}/internal/observability_onboarding` ); expect(request.body.scriptDownloadUrl).to.be( - `${MOCKED_PUBLIC_BASE_URL}/plugins/observabilityOnboarding/assets/standalone_agent_setup.sh` + `${MOCKED_PUBLIC_BASE_URL}/plugins/observability_solution/observabilityOnboarding/assets/standalone_agent_setup.sh` ); }); }); @@ -42,7 +42,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { `${MOCKED_KIBANA_URL}/internal/observability_onboarding` ); expect(request.body.scriptDownloadUrl).to.be( - `${MOCKED_KIBANA_URL}/plugins/observabilityOnboarding/assets/standalone_agent_setup.sh` + `${MOCKED_KIBANA_URL}/plugins/observability_solution/observabilityOnboarding/assets/standalone_agent_setup.sh` ); }); });