From fc043466143421d56ac7b789db68b1024c5231e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Thu, 17 Aug 2023 15:53:04 +0000 Subject: [PATCH 01/46] Rename the plugin --- .../steps/storybooks/build_and_upload.ts | 2 +- .github/CODEOWNERS | 2 +- package.json | 2 +- tsconfig.base.json | 4 +-- .../plugins/discover_log_explorer/README.md | 8 ------ .../discover_log_explorer/kibana.jsonc | 15 ----------- .../.storybook/__mocks__/package_icon.tsx | 0 .../.storybook/main.js | 0 .../.storybook/preview.js | 0 x-pack/plugins/log_explorer/README.md | 8 ++++++ .../common/constants.ts | 0 .../common/datasets/errors.ts | 0 .../common/datasets/index.ts | 0 .../common/datasets/models/dataset.ts | 0 .../common/datasets/models/integration.ts | 0 .../common/datasets/types.ts | 0 .../common/datasets/v1/common.ts | 0 .../common/datasets/v1/find_datasets.ts | 0 .../common/datasets/v1/find_integrations.ts | 0 .../common/datasets/v1/index.ts | 0 .../common/hashed_cache.ts | 0 .../common/latest.ts | 0 .../common/plugin_config.ts | 0 .../common/runtime_types.ts | 0 .../jest.config.js | 8 +++--- x-pack/plugins/log_explorer/kibana.jsonc | 27 +++++++++++++++++++ .../components/dataset_selector/constants.tsx | 0 .../dataset_selector.stories.tsx | 0 .../dataset_selector/dataset_selector.tsx | 0 .../components/dataset_selector/index.ts | 0 .../state_machine/defaults.ts | 0 .../dataset_selector/state_machine/index.ts | 0 .../state_machine/state_machine.ts | 0 .../dataset_selector/state_machine/types.ts | 0 .../state_machine/use_dataset_selector.ts | 0 .../sub_components/datasets_list.tsx | 0 .../sub_components/datasets_popover.tsx | 0 .../sub_components/datasets_skeleton.tsx | 0 .../integrations_list_status.tsx | 0 .../sub_components/search_controls.tsx | 0 .../components/dataset_selector/types.ts | 0 .../components/dataset_selector/utils.tsx | 0 .../customizations/custom_dataset_filters.tsx | 0 .../custom_dataset_selector.tsx | 0 .../customizations/log_explorer_profile.tsx | 0 .../public/deep_links.ts | 0 .../public/hooks/use_control_panels.tsx | 0 .../public/hooks/use_dataset_selection.ts | 0 .../public/hooks/use_datasets.ts | 0 .../public/hooks/use_integrations.ts | 0 .../public/hooks/use_intersection_ref.ts | 0 .../public/index.ts | 0 .../public/plugin.ts | 14 ++++++++-- .../services/datasets/datasets_client.mock.ts | 0 .../services/datasets/datasets_client.ts | 0 .../datasets/datasets_service.mock.ts | 0 .../services/datasets/datasets_service.ts | 0 .../public/services/datasets/index.ts | 0 .../public/services/datasets/types.ts | 0 .../public/state_machines/datasets/index.ts | 0 .../state_machines/datasets/src/defaults.ts | 0 .../state_machines/datasets/src/index.ts | 0 .../datasets/src/state_machine.ts | 0 .../state_machines/datasets/src/types.ts | 0 .../state_machines/integrations/index.ts | 0 .../integrations/src/defaults.ts | 0 .../state_machines/integrations/src/index.ts | 0 .../integrations/src/state_machine.ts | 0 .../state_machines/integrations/src/types.ts | 0 .../log_explorer_profile/index.ts | 0 .../src/data_view_service.ts | 0 .../log_explorer_profile/src/defaults.ts | 0 .../log_explorer_profile/src/index.ts | 0 .../log_explorer_profile/src/notifications.ts | 0 .../log_explorer_profile/src/state_machine.ts | 0 .../log_explorer_profile/src/types.ts | 0 .../src/url_state_storage_service.ts | 0 .../log_explorer_profile/src/utils.ts | 0 .../public/types.ts | 3 +++ .../public/utils/comparator_by_field.ts | 0 .../all_dataset_selection.ts | 0 .../utils/dataset_selection/encoding.test.ts | 0 .../utils/dataset_selection/encoding.ts | 0 .../public/utils/dataset_selection/errors.ts | 0 .../hydrate_dataset_selection.ts.ts | 0 .../public/utils/dataset_selection/index.ts | 0 .../single_dataset_selection.ts | 0 .../public/utils/dataset_selection/types.ts | 0 .../public/utils/dynamic.tsx | 0 .../server/config.ts | 0 .../server/index.ts | 0 .../server/plugin.ts | 0 .../tsconfig.json | 0 yarn.lock | 8 +++--- 94 files changed, 62 insertions(+), 39 deletions(-) delete mode 100755 x-pack/plugins/discover_log_explorer/README.md delete mode 100644 x-pack/plugins/discover_log_explorer/kibana.jsonc rename x-pack/plugins/{discover_log_explorer => log_explorer}/.storybook/__mocks__/package_icon.tsx (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/.storybook/main.js (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/.storybook/preview.js (100%) create mode 100755 x-pack/plugins/log_explorer/README.md rename x-pack/plugins/{discover_log_explorer => log_explorer}/common/constants.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/common/datasets/errors.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/common/datasets/index.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/common/datasets/models/dataset.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/common/datasets/models/integration.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/common/datasets/types.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/common/datasets/v1/common.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/common/datasets/v1/find_datasets.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/common/datasets/v1/find_integrations.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/common/datasets/v1/index.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/common/hashed_cache.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/common/latest.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/common/plugin_config.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/common/runtime_types.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/jest.config.js (66%) create mode 100644 x-pack/plugins/log_explorer/kibana.jsonc rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/components/dataset_selector/constants.tsx (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/components/dataset_selector/dataset_selector.stories.tsx (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/components/dataset_selector/dataset_selector.tsx (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/components/dataset_selector/index.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/components/dataset_selector/state_machine/defaults.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/components/dataset_selector/state_machine/index.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/components/dataset_selector/state_machine/state_machine.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/components/dataset_selector/state_machine/types.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/components/dataset_selector/state_machine/use_dataset_selector.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/components/dataset_selector/sub_components/datasets_list.tsx (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/components/dataset_selector/sub_components/datasets_popover.tsx (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/components/dataset_selector/sub_components/datasets_skeleton.tsx (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/components/dataset_selector/sub_components/integrations_list_status.tsx (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/components/dataset_selector/sub_components/search_controls.tsx (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/components/dataset_selector/types.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/components/dataset_selector/utils.tsx (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/customizations/custom_dataset_filters.tsx (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/customizations/custom_dataset_selector.tsx (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/customizations/log_explorer_profile.tsx (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/deep_links.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/hooks/use_control_panels.tsx (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/hooks/use_dataset_selection.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/hooks/use_datasets.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/hooks/use_integrations.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/hooks/use_intersection_ref.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/index.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/plugin.ts (73%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/services/datasets/datasets_client.mock.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/services/datasets/datasets_client.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/services/datasets/datasets_service.mock.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/services/datasets/datasets_service.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/services/datasets/index.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/services/datasets/types.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/state_machines/datasets/index.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/state_machines/datasets/src/defaults.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/state_machines/datasets/src/index.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/state_machines/datasets/src/state_machine.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/state_machines/datasets/src/types.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/state_machines/integrations/index.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/state_machines/integrations/src/defaults.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/state_machines/integrations/src/index.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/state_machines/integrations/src/state_machine.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/state_machines/integrations/src/types.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/state_machines/log_explorer_profile/index.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/state_machines/log_explorer_profile/src/data_view_service.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/state_machines/log_explorer_profile/src/defaults.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/state_machines/log_explorer_profile/src/index.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/state_machines/log_explorer_profile/src/notifications.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/state_machines/log_explorer_profile/src/state_machine.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/state_machines/log_explorer_profile/src/types.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/state_machines/log_explorer_profile/src/url_state_storage_service.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/state_machines/log_explorer_profile/src/utils.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/types.ts (83%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/utils/comparator_by_field.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/utils/dataset_selection/all_dataset_selection.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/utils/dataset_selection/encoding.test.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/utils/dataset_selection/encoding.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/utils/dataset_selection/errors.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/utils/dataset_selection/hydrate_dataset_selection.ts.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/utils/dataset_selection/index.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/utils/dataset_selection/single_dataset_selection.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/utils/dataset_selection/types.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/public/utils/dynamic.tsx (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/server/config.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/server/index.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/server/plugin.ts (100%) rename x-pack/plugins/{discover_log_explorer => log_explorer}/tsconfig.json (100%) diff --git a/.buildkite/scripts/steps/storybooks/build_and_upload.ts b/.buildkite/scripts/steps/storybooks/build_and_upload.ts index e9014da1cefae..2afc5f4037148 100644 --- a/.buildkite/scripts/steps/storybooks/build_and_upload.ts +++ b/.buildkite/scripts/steps/storybooks/build_and_upload.ts @@ -26,7 +26,7 @@ const STORYBOOKS = [ 'dashboard_enhanced', 'dashboard', 'data', - 'discover_log_explorer', + 'log_explorer', 'embeddable', 'expression_error', 'expression_image', diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index fbc2b28e9f8a5..f9b11d42c0b19 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -328,7 +328,7 @@ packages/kbn-dev-utils @elastic/kibana-operations examples/developer_examples @elastic/appex-sharedux examples/discover_customization_examples @elastic/kibana-data-discovery x-pack/plugins/discover_enhanced @elastic/kibana-data-discovery -x-pack/plugins/discover_log_explorer @elastic/infra-monitoring-ui +x-pack/plugins/log_explorer @elastic/infra-monitoring-ui src/plugins/discover @elastic/kibana-data-discovery packages/kbn-discover-utils @elastic/kibana-data-discovery packages/kbn-doc-links @elastic/docs diff --git a/package.json b/package.json index 4d80cac344eb2..8c07cc97704a4 100644 --- a/package.json +++ b/package.json @@ -372,7 +372,6 @@ "@kbn/developer-examples-plugin": "link:examples/developer_examples", "@kbn/discover-customization-examples-plugin": "link:examples/discover_customization_examples", "@kbn/discover-enhanced-plugin": "link:x-pack/plugins/discover_enhanced", - "@kbn/discover-log-explorer-plugin": "link:x-pack/plugins/discover_log_explorer", "@kbn/discover-plugin": "link:src/plugins/discover", "@kbn/discover-utils": "link:packages/kbn-discover-utils", "@kbn/doc-links": "link:packages/kbn-doc-links", @@ -491,6 +490,7 @@ "@kbn/lists-plugin": "link:x-pack/plugins/lists", "@kbn/locator-examples-plugin": "link:examples/locator_examples", "@kbn/locator-explorer-plugin": "link:examples/locator_explorer", + "@kbn/log-explorer-plugin": "link:x-pack/plugins/log_explorer", "@kbn/logging": "link:packages/kbn-logging", "@kbn/logging-mocks": "link:packages/kbn-logging-mocks", "@kbn/logs-shared-plugin": "link:x-pack/plugins/logs_shared", diff --git a/tsconfig.base.json b/tsconfig.base.json index dd6a27a32dfa9..b8e568b036021 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -650,8 +650,6 @@ "@kbn/discover-customization-examples-plugin/*": ["examples/discover_customization_examples/*"], "@kbn/discover-enhanced-plugin": ["x-pack/plugins/discover_enhanced"], "@kbn/discover-enhanced-plugin/*": ["x-pack/plugins/discover_enhanced/*"], - "@kbn/discover-log-explorer-plugin": ["x-pack/plugins/discover_log_explorer"], - "@kbn/discover-log-explorer-plugin/*": ["x-pack/plugins/discover_log_explorer/*"], "@kbn/discover-plugin": ["src/plugins/discover"], "@kbn/discover-plugin/*": ["src/plugins/discover/*"], "@kbn/discover-utils": ["packages/kbn-discover-utils"], @@ -934,6 +932,8 @@ "@kbn/locator-examples-plugin/*": ["examples/locator_examples/*"], "@kbn/locator-explorer-plugin": ["examples/locator_explorer"], "@kbn/locator-explorer-plugin/*": ["examples/locator_explorer/*"], + "@kbn/log-explorer-plugin": ["x-pack/plugins/log_explorer"], + "@kbn/log-explorer-plugin/*": ["x-pack/plugins/log_explorer/*"], "@kbn/logging": ["packages/kbn-logging"], "@kbn/logging/*": ["packages/kbn-logging/*"], "@kbn/logging-mocks": ["packages/kbn-logging-mocks"], diff --git a/x-pack/plugins/discover_log_explorer/README.md b/x-pack/plugins/discover_log_explorer/README.md deleted file mode 100755 index 4b3453a451bf8..0000000000000 --- a/x-pack/plugins/discover_log_explorer/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Discover Log Explorer - -This plugin registers a `log-explorer` profile using the Discover customization framework, offering several affordances specifically designed for log consumption. - -The plugin enhances the capabilities of Discover in the following ways: - -- **Dataset selector**: this customization on the Discover page replaces the DataViews picker with a Logs dataset selector built ad-hoc to provide a better experience when navigating throught all the available datasets. - diff --git a/x-pack/plugins/discover_log_explorer/kibana.jsonc b/x-pack/plugins/discover_log_explorer/kibana.jsonc deleted file mode 100644 index 89d00e3ce4eeb..0000000000000 --- a/x-pack/plugins/discover_log_explorer/kibana.jsonc +++ /dev/null @@ -1,15 +0,0 @@ -{ - "type": "plugin", - "id": "@kbn/discover-log-explorer-plugin", - "owner": "@elastic/infra-monitoring-ui", - "description": "This plugin exposes and registers Logs+ features.", - "plugin": { - "id": "discoverLogExplorer", - "server": true, - "browser": true, - "configPath": ["xpack", "discoverLogExplorer"], - "requiredPlugins": ["data", "dataViews", "discover", "fleet", "kibanaReact", "kibanaUtils", "controls", "embeddable"], - "optionalPlugins": [], - "requiredBundles": [] - } -} diff --git a/x-pack/plugins/discover_log_explorer/.storybook/__mocks__/package_icon.tsx b/x-pack/plugins/log_explorer/.storybook/__mocks__/package_icon.tsx similarity index 100% rename from x-pack/plugins/discover_log_explorer/.storybook/__mocks__/package_icon.tsx rename to x-pack/plugins/log_explorer/.storybook/__mocks__/package_icon.tsx diff --git a/x-pack/plugins/discover_log_explorer/.storybook/main.js b/x-pack/plugins/log_explorer/.storybook/main.js similarity index 100% rename from x-pack/plugins/discover_log_explorer/.storybook/main.js rename to x-pack/plugins/log_explorer/.storybook/main.js diff --git a/x-pack/plugins/discover_log_explorer/.storybook/preview.js b/x-pack/plugins/log_explorer/.storybook/preview.js similarity index 100% rename from x-pack/plugins/discover_log_explorer/.storybook/preview.js rename to x-pack/plugins/log_explorer/.storybook/preview.js diff --git a/x-pack/plugins/log_explorer/README.md b/x-pack/plugins/log_explorer/README.md new file mode 100755 index 0000000000000..bb4a266988a33 --- /dev/null +++ b/x-pack/plugins/log_explorer/README.md @@ -0,0 +1,8 @@ +# Log Explorer + +This plugin provides a `LogExplorer` component using the Discover customization framework, offering several affordances specifically designed for log consumption. + +The plugin enhances the capabilities of Discover in the following ways: + +- **Dataset selector**: this customization replaces the DataViews picker with a Logs dataset selector built ad-hoc to provide a better experience when navigating throught all the available datasets. + diff --git a/x-pack/plugins/discover_log_explorer/common/constants.ts b/x-pack/plugins/log_explorer/common/constants.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/common/constants.ts rename to x-pack/plugins/log_explorer/common/constants.ts diff --git a/x-pack/plugins/discover_log_explorer/common/datasets/errors.ts b/x-pack/plugins/log_explorer/common/datasets/errors.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/common/datasets/errors.ts rename to x-pack/plugins/log_explorer/common/datasets/errors.ts diff --git a/x-pack/plugins/discover_log_explorer/common/datasets/index.ts b/x-pack/plugins/log_explorer/common/datasets/index.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/common/datasets/index.ts rename to x-pack/plugins/log_explorer/common/datasets/index.ts diff --git a/x-pack/plugins/discover_log_explorer/common/datasets/models/dataset.ts b/x-pack/plugins/log_explorer/common/datasets/models/dataset.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/common/datasets/models/dataset.ts rename to x-pack/plugins/log_explorer/common/datasets/models/dataset.ts diff --git a/x-pack/plugins/discover_log_explorer/common/datasets/models/integration.ts b/x-pack/plugins/log_explorer/common/datasets/models/integration.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/common/datasets/models/integration.ts rename to x-pack/plugins/log_explorer/common/datasets/models/integration.ts diff --git a/x-pack/plugins/discover_log_explorer/common/datasets/types.ts b/x-pack/plugins/log_explorer/common/datasets/types.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/common/datasets/types.ts rename to x-pack/plugins/log_explorer/common/datasets/types.ts diff --git a/x-pack/plugins/discover_log_explorer/common/datasets/v1/common.ts b/x-pack/plugins/log_explorer/common/datasets/v1/common.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/common/datasets/v1/common.ts rename to x-pack/plugins/log_explorer/common/datasets/v1/common.ts diff --git a/x-pack/plugins/discover_log_explorer/common/datasets/v1/find_datasets.ts b/x-pack/plugins/log_explorer/common/datasets/v1/find_datasets.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/common/datasets/v1/find_datasets.ts rename to x-pack/plugins/log_explorer/common/datasets/v1/find_datasets.ts diff --git a/x-pack/plugins/discover_log_explorer/common/datasets/v1/find_integrations.ts b/x-pack/plugins/log_explorer/common/datasets/v1/find_integrations.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/common/datasets/v1/find_integrations.ts rename to x-pack/plugins/log_explorer/common/datasets/v1/find_integrations.ts diff --git a/x-pack/plugins/discover_log_explorer/common/datasets/v1/index.ts b/x-pack/plugins/log_explorer/common/datasets/v1/index.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/common/datasets/v1/index.ts rename to x-pack/plugins/log_explorer/common/datasets/v1/index.ts diff --git a/x-pack/plugins/discover_log_explorer/common/hashed_cache.ts b/x-pack/plugins/log_explorer/common/hashed_cache.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/common/hashed_cache.ts rename to x-pack/plugins/log_explorer/common/hashed_cache.ts diff --git a/x-pack/plugins/discover_log_explorer/common/latest.ts b/x-pack/plugins/log_explorer/common/latest.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/common/latest.ts rename to x-pack/plugins/log_explorer/common/latest.ts diff --git a/x-pack/plugins/discover_log_explorer/common/plugin_config.ts b/x-pack/plugins/log_explorer/common/plugin_config.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/common/plugin_config.ts rename to x-pack/plugins/log_explorer/common/plugin_config.ts diff --git a/x-pack/plugins/discover_log_explorer/common/runtime_types.ts b/x-pack/plugins/log_explorer/common/runtime_types.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/common/runtime_types.ts rename to x-pack/plugins/log_explorer/common/runtime_types.ts diff --git a/x-pack/plugins/discover_log_explorer/jest.config.js b/x-pack/plugins/log_explorer/jest.config.js similarity index 66% rename from x-pack/plugins/discover_log_explorer/jest.config.js rename to x-pack/plugins/log_explorer/jest.config.js index 988de065d4013..fea1fd32ee5d9 100644 --- a/x-pack/plugins/discover_log_explorer/jest.config.js +++ b/x-pack/plugins/log_explorer/jest.config.js @@ -8,10 +8,8 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', - roots: ['/x-pack/plugins/discover_log_explorer'], - coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/discover_log_explorer', + roots: ['/x-pack/plugins/log_explorer'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/log_explorer', coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '/x-pack/plugins/discover_log_explorer/{common,public}/**/*.{ts,tsx}', - ], + collectCoverageFrom: ['/x-pack/plugins/log_explorer/{common,public}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/log_explorer/kibana.jsonc b/x-pack/plugins/log_explorer/kibana.jsonc new file mode 100644 index 0000000000000..4217879292916 --- /dev/null +++ b/x-pack/plugins/log_explorer/kibana.jsonc @@ -0,0 +1,27 @@ +{ + "type": "plugin", + "id": "@kbn/log-explorer-plugin", + "owner": "@elastic/infra-monitoring-ui", + "description": "This plugin exposes and registers Logs+ features.", + "plugin": { + "id": "logExplorer", + "server": true, + "browser": true, + "configPath": [ + "xpack", + "logExplorer" + ], + "requiredPlugins": [ + "data", + "dataViews", + "discover", + "fleet", + "kibanaReact", + "kibanaUtils", + "controls", + "embeddable" + ], + "optionalPlugins": [], + "requiredBundles": [] + } +} diff --git a/x-pack/plugins/discover_log_explorer/public/components/dataset_selector/constants.tsx b/x-pack/plugins/log_explorer/public/components/dataset_selector/constants.tsx similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/components/dataset_selector/constants.tsx rename to x-pack/plugins/log_explorer/public/components/dataset_selector/constants.tsx diff --git a/x-pack/plugins/discover_log_explorer/public/components/dataset_selector/dataset_selector.stories.tsx b/x-pack/plugins/log_explorer/public/components/dataset_selector/dataset_selector.stories.tsx similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/components/dataset_selector/dataset_selector.stories.tsx rename to x-pack/plugins/log_explorer/public/components/dataset_selector/dataset_selector.stories.tsx diff --git a/x-pack/plugins/discover_log_explorer/public/components/dataset_selector/dataset_selector.tsx b/x-pack/plugins/log_explorer/public/components/dataset_selector/dataset_selector.tsx similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/components/dataset_selector/dataset_selector.tsx rename to x-pack/plugins/log_explorer/public/components/dataset_selector/dataset_selector.tsx diff --git a/x-pack/plugins/discover_log_explorer/public/components/dataset_selector/index.ts b/x-pack/plugins/log_explorer/public/components/dataset_selector/index.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/components/dataset_selector/index.ts rename to x-pack/plugins/log_explorer/public/components/dataset_selector/index.ts diff --git a/x-pack/plugins/discover_log_explorer/public/components/dataset_selector/state_machine/defaults.ts b/x-pack/plugins/log_explorer/public/components/dataset_selector/state_machine/defaults.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/components/dataset_selector/state_machine/defaults.ts rename to x-pack/plugins/log_explorer/public/components/dataset_selector/state_machine/defaults.ts diff --git a/x-pack/plugins/discover_log_explorer/public/components/dataset_selector/state_machine/index.ts b/x-pack/plugins/log_explorer/public/components/dataset_selector/state_machine/index.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/components/dataset_selector/state_machine/index.ts rename to x-pack/plugins/log_explorer/public/components/dataset_selector/state_machine/index.ts diff --git a/x-pack/plugins/discover_log_explorer/public/components/dataset_selector/state_machine/state_machine.ts b/x-pack/plugins/log_explorer/public/components/dataset_selector/state_machine/state_machine.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/components/dataset_selector/state_machine/state_machine.ts rename to x-pack/plugins/log_explorer/public/components/dataset_selector/state_machine/state_machine.ts diff --git a/x-pack/plugins/discover_log_explorer/public/components/dataset_selector/state_machine/types.ts b/x-pack/plugins/log_explorer/public/components/dataset_selector/state_machine/types.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/components/dataset_selector/state_machine/types.ts rename to x-pack/plugins/log_explorer/public/components/dataset_selector/state_machine/types.ts diff --git a/x-pack/plugins/discover_log_explorer/public/components/dataset_selector/state_machine/use_dataset_selector.ts b/x-pack/plugins/log_explorer/public/components/dataset_selector/state_machine/use_dataset_selector.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/components/dataset_selector/state_machine/use_dataset_selector.ts rename to x-pack/plugins/log_explorer/public/components/dataset_selector/state_machine/use_dataset_selector.ts diff --git a/x-pack/plugins/discover_log_explorer/public/components/dataset_selector/sub_components/datasets_list.tsx b/x-pack/plugins/log_explorer/public/components/dataset_selector/sub_components/datasets_list.tsx similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/components/dataset_selector/sub_components/datasets_list.tsx rename to x-pack/plugins/log_explorer/public/components/dataset_selector/sub_components/datasets_list.tsx diff --git a/x-pack/plugins/discover_log_explorer/public/components/dataset_selector/sub_components/datasets_popover.tsx b/x-pack/plugins/log_explorer/public/components/dataset_selector/sub_components/datasets_popover.tsx similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/components/dataset_selector/sub_components/datasets_popover.tsx rename to x-pack/plugins/log_explorer/public/components/dataset_selector/sub_components/datasets_popover.tsx diff --git a/x-pack/plugins/discover_log_explorer/public/components/dataset_selector/sub_components/datasets_skeleton.tsx b/x-pack/plugins/log_explorer/public/components/dataset_selector/sub_components/datasets_skeleton.tsx similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/components/dataset_selector/sub_components/datasets_skeleton.tsx rename to x-pack/plugins/log_explorer/public/components/dataset_selector/sub_components/datasets_skeleton.tsx diff --git a/x-pack/plugins/discover_log_explorer/public/components/dataset_selector/sub_components/integrations_list_status.tsx b/x-pack/plugins/log_explorer/public/components/dataset_selector/sub_components/integrations_list_status.tsx similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/components/dataset_selector/sub_components/integrations_list_status.tsx rename to x-pack/plugins/log_explorer/public/components/dataset_selector/sub_components/integrations_list_status.tsx diff --git a/x-pack/plugins/discover_log_explorer/public/components/dataset_selector/sub_components/search_controls.tsx b/x-pack/plugins/log_explorer/public/components/dataset_selector/sub_components/search_controls.tsx similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/components/dataset_selector/sub_components/search_controls.tsx rename to x-pack/plugins/log_explorer/public/components/dataset_selector/sub_components/search_controls.tsx diff --git a/x-pack/plugins/discover_log_explorer/public/components/dataset_selector/types.ts b/x-pack/plugins/log_explorer/public/components/dataset_selector/types.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/components/dataset_selector/types.ts rename to x-pack/plugins/log_explorer/public/components/dataset_selector/types.ts diff --git a/x-pack/plugins/discover_log_explorer/public/components/dataset_selector/utils.tsx b/x-pack/plugins/log_explorer/public/components/dataset_selector/utils.tsx similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/components/dataset_selector/utils.tsx rename to x-pack/plugins/log_explorer/public/components/dataset_selector/utils.tsx diff --git a/x-pack/plugins/discover_log_explorer/public/customizations/custom_dataset_filters.tsx b/x-pack/plugins/log_explorer/public/customizations/custom_dataset_filters.tsx similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/customizations/custom_dataset_filters.tsx rename to x-pack/plugins/log_explorer/public/customizations/custom_dataset_filters.tsx diff --git a/x-pack/plugins/discover_log_explorer/public/customizations/custom_dataset_selector.tsx b/x-pack/plugins/log_explorer/public/customizations/custom_dataset_selector.tsx similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/customizations/custom_dataset_selector.tsx rename to x-pack/plugins/log_explorer/public/customizations/custom_dataset_selector.tsx diff --git a/x-pack/plugins/discover_log_explorer/public/customizations/log_explorer_profile.tsx b/x-pack/plugins/log_explorer/public/customizations/log_explorer_profile.tsx similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/customizations/log_explorer_profile.tsx rename to x-pack/plugins/log_explorer/public/customizations/log_explorer_profile.tsx diff --git a/x-pack/plugins/discover_log_explorer/public/deep_links.ts b/x-pack/plugins/log_explorer/public/deep_links.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/deep_links.ts rename to x-pack/plugins/log_explorer/public/deep_links.ts diff --git a/x-pack/plugins/discover_log_explorer/public/hooks/use_control_panels.tsx b/x-pack/plugins/log_explorer/public/hooks/use_control_panels.tsx similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/hooks/use_control_panels.tsx rename to x-pack/plugins/log_explorer/public/hooks/use_control_panels.tsx diff --git a/x-pack/plugins/discover_log_explorer/public/hooks/use_dataset_selection.ts b/x-pack/plugins/log_explorer/public/hooks/use_dataset_selection.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/hooks/use_dataset_selection.ts rename to x-pack/plugins/log_explorer/public/hooks/use_dataset_selection.ts diff --git a/x-pack/plugins/discover_log_explorer/public/hooks/use_datasets.ts b/x-pack/plugins/log_explorer/public/hooks/use_datasets.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/hooks/use_datasets.ts rename to x-pack/plugins/log_explorer/public/hooks/use_datasets.ts diff --git a/x-pack/plugins/discover_log_explorer/public/hooks/use_integrations.ts b/x-pack/plugins/log_explorer/public/hooks/use_integrations.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/hooks/use_integrations.ts rename to x-pack/plugins/log_explorer/public/hooks/use_integrations.ts diff --git a/x-pack/plugins/discover_log_explorer/public/hooks/use_intersection_ref.ts b/x-pack/plugins/log_explorer/public/hooks/use_intersection_ref.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/hooks/use_intersection_ref.ts rename to x-pack/plugins/log_explorer/public/hooks/use_intersection_ref.ts diff --git a/x-pack/plugins/discover_log_explorer/public/index.ts b/x-pack/plugins/log_explorer/public/index.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/index.ts rename to x-pack/plugins/log_explorer/public/index.ts diff --git a/x-pack/plugins/discover_log_explorer/public/plugin.ts b/x-pack/plugins/log_explorer/public/plugin.ts similarity index 73% rename from x-pack/plugins/discover_log_explorer/public/plugin.ts rename to x-pack/plugins/log_explorer/public/plugin.ts index e39c831cdb432..e51d936df3c91 100644 --- a/x-pack/plugins/discover_log_explorer/public/plugin.ts +++ b/x-pack/plugins/log_explorer/public/plugin.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; +import { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; +import { i18n } from '@kbn/i18n'; import { LOG_EXPLORER_PROFILE_ID } from '../common/constants'; import { DiscoverLogExplorerConfig } from '../common/plugin_config'; import { createLogExplorerProfileCustomizations } from './customizations/log_explorer_profile'; @@ -13,6 +14,7 @@ import { getLogExplorerDeepLink } from './deep_links'; import { DiscoverLogExplorerPluginSetup, DiscoverLogExplorerPluginStart, + DiscoverLogExplorerSetupDeps, DiscoverLogExplorerStartDeps, } from './types'; @@ -25,7 +27,15 @@ export class DiscoverLogExplorerPlugin this.config = context.config.get(); } - public setup() {} + public setup(core: CoreSetup, plugins: DiscoverLogExplorerSetupDeps) { + core.application.register({ + id: 'log-explorer', + title: i18n.translate('xpack.log_explorer.appTitle', { defaultMessage: 'Log Explorer' }), + mount(params) { + throw new Error('Function not implemented.'); + }, + }); + } public start(core: CoreStart, plugins: DiscoverLogExplorerStartDeps) { const { discover, data } = plugins; diff --git a/x-pack/plugins/discover_log_explorer/public/services/datasets/datasets_client.mock.ts b/x-pack/plugins/log_explorer/public/services/datasets/datasets_client.mock.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/services/datasets/datasets_client.mock.ts rename to x-pack/plugins/log_explorer/public/services/datasets/datasets_client.mock.ts diff --git a/x-pack/plugins/discover_log_explorer/public/services/datasets/datasets_client.ts b/x-pack/plugins/log_explorer/public/services/datasets/datasets_client.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/services/datasets/datasets_client.ts rename to x-pack/plugins/log_explorer/public/services/datasets/datasets_client.ts diff --git a/x-pack/plugins/discover_log_explorer/public/services/datasets/datasets_service.mock.ts b/x-pack/plugins/log_explorer/public/services/datasets/datasets_service.mock.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/services/datasets/datasets_service.mock.ts rename to x-pack/plugins/log_explorer/public/services/datasets/datasets_service.mock.ts diff --git a/x-pack/plugins/discover_log_explorer/public/services/datasets/datasets_service.ts b/x-pack/plugins/log_explorer/public/services/datasets/datasets_service.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/services/datasets/datasets_service.ts rename to x-pack/plugins/log_explorer/public/services/datasets/datasets_service.ts diff --git a/x-pack/plugins/discover_log_explorer/public/services/datasets/index.ts b/x-pack/plugins/log_explorer/public/services/datasets/index.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/services/datasets/index.ts rename to x-pack/plugins/log_explorer/public/services/datasets/index.ts diff --git a/x-pack/plugins/discover_log_explorer/public/services/datasets/types.ts b/x-pack/plugins/log_explorer/public/services/datasets/types.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/services/datasets/types.ts rename to x-pack/plugins/log_explorer/public/services/datasets/types.ts diff --git a/x-pack/plugins/discover_log_explorer/public/state_machines/datasets/index.ts b/x-pack/plugins/log_explorer/public/state_machines/datasets/index.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/state_machines/datasets/index.ts rename to x-pack/plugins/log_explorer/public/state_machines/datasets/index.ts diff --git a/x-pack/plugins/discover_log_explorer/public/state_machines/datasets/src/defaults.ts b/x-pack/plugins/log_explorer/public/state_machines/datasets/src/defaults.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/state_machines/datasets/src/defaults.ts rename to x-pack/plugins/log_explorer/public/state_machines/datasets/src/defaults.ts diff --git a/x-pack/plugins/discover_log_explorer/public/state_machines/datasets/src/index.ts b/x-pack/plugins/log_explorer/public/state_machines/datasets/src/index.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/state_machines/datasets/src/index.ts rename to x-pack/plugins/log_explorer/public/state_machines/datasets/src/index.ts diff --git a/x-pack/plugins/discover_log_explorer/public/state_machines/datasets/src/state_machine.ts b/x-pack/plugins/log_explorer/public/state_machines/datasets/src/state_machine.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/state_machines/datasets/src/state_machine.ts rename to x-pack/plugins/log_explorer/public/state_machines/datasets/src/state_machine.ts diff --git a/x-pack/plugins/discover_log_explorer/public/state_machines/datasets/src/types.ts b/x-pack/plugins/log_explorer/public/state_machines/datasets/src/types.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/state_machines/datasets/src/types.ts rename to x-pack/plugins/log_explorer/public/state_machines/datasets/src/types.ts diff --git a/x-pack/plugins/discover_log_explorer/public/state_machines/integrations/index.ts b/x-pack/plugins/log_explorer/public/state_machines/integrations/index.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/state_machines/integrations/index.ts rename to x-pack/plugins/log_explorer/public/state_machines/integrations/index.ts diff --git a/x-pack/plugins/discover_log_explorer/public/state_machines/integrations/src/defaults.ts b/x-pack/plugins/log_explorer/public/state_machines/integrations/src/defaults.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/state_machines/integrations/src/defaults.ts rename to x-pack/plugins/log_explorer/public/state_machines/integrations/src/defaults.ts diff --git a/x-pack/plugins/discover_log_explorer/public/state_machines/integrations/src/index.ts b/x-pack/plugins/log_explorer/public/state_machines/integrations/src/index.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/state_machines/integrations/src/index.ts rename to x-pack/plugins/log_explorer/public/state_machines/integrations/src/index.ts diff --git a/x-pack/plugins/discover_log_explorer/public/state_machines/integrations/src/state_machine.ts b/x-pack/plugins/log_explorer/public/state_machines/integrations/src/state_machine.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/state_machines/integrations/src/state_machine.ts rename to x-pack/plugins/log_explorer/public/state_machines/integrations/src/state_machine.ts diff --git a/x-pack/plugins/discover_log_explorer/public/state_machines/integrations/src/types.ts b/x-pack/plugins/log_explorer/public/state_machines/integrations/src/types.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/state_machines/integrations/src/types.ts rename to x-pack/plugins/log_explorer/public/state_machines/integrations/src/types.ts diff --git a/x-pack/plugins/discover_log_explorer/public/state_machines/log_explorer_profile/index.ts b/x-pack/plugins/log_explorer/public/state_machines/log_explorer_profile/index.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/state_machines/log_explorer_profile/index.ts rename to x-pack/plugins/log_explorer/public/state_machines/log_explorer_profile/index.ts diff --git a/x-pack/plugins/discover_log_explorer/public/state_machines/log_explorer_profile/src/data_view_service.ts b/x-pack/plugins/log_explorer/public/state_machines/log_explorer_profile/src/data_view_service.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/state_machines/log_explorer_profile/src/data_view_service.ts rename to x-pack/plugins/log_explorer/public/state_machines/log_explorer_profile/src/data_view_service.ts diff --git a/x-pack/plugins/discover_log_explorer/public/state_machines/log_explorer_profile/src/defaults.ts b/x-pack/plugins/log_explorer/public/state_machines/log_explorer_profile/src/defaults.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/state_machines/log_explorer_profile/src/defaults.ts rename to x-pack/plugins/log_explorer/public/state_machines/log_explorer_profile/src/defaults.ts diff --git a/x-pack/plugins/discover_log_explorer/public/state_machines/log_explorer_profile/src/index.ts b/x-pack/plugins/log_explorer/public/state_machines/log_explorer_profile/src/index.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/state_machines/log_explorer_profile/src/index.ts rename to x-pack/plugins/log_explorer/public/state_machines/log_explorer_profile/src/index.ts diff --git a/x-pack/plugins/discover_log_explorer/public/state_machines/log_explorer_profile/src/notifications.ts b/x-pack/plugins/log_explorer/public/state_machines/log_explorer_profile/src/notifications.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/state_machines/log_explorer_profile/src/notifications.ts rename to x-pack/plugins/log_explorer/public/state_machines/log_explorer_profile/src/notifications.ts diff --git a/x-pack/plugins/discover_log_explorer/public/state_machines/log_explorer_profile/src/state_machine.ts b/x-pack/plugins/log_explorer/public/state_machines/log_explorer_profile/src/state_machine.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/state_machines/log_explorer_profile/src/state_machine.ts rename to x-pack/plugins/log_explorer/public/state_machines/log_explorer_profile/src/state_machine.ts diff --git a/x-pack/plugins/discover_log_explorer/public/state_machines/log_explorer_profile/src/types.ts b/x-pack/plugins/log_explorer/public/state_machines/log_explorer_profile/src/types.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/state_machines/log_explorer_profile/src/types.ts rename to x-pack/plugins/log_explorer/public/state_machines/log_explorer_profile/src/types.ts diff --git a/x-pack/plugins/discover_log_explorer/public/state_machines/log_explorer_profile/src/url_state_storage_service.ts b/x-pack/plugins/log_explorer/public/state_machines/log_explorer_profile/src/url_state_storage_service.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/state_machines/log_explorer_profile/src/url_state_storage_service.ts rename to x-pack/plugins/log_explorer/public/state_machines/log_explorer_profile/src/url_state_storage_service.ts diff --git a/x-pack/plugins/discover_log_explorer/public/state_machines/log_explorer_profile/src/utils.ts b/x-pack/plugins/log_explorer/public/state_machines/log_explorer_profile/src/utils.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/state_machines/log_explorer_profile/src/utils.ts rename to x-pack/plugins/log_explorer/public/state_machines/log_explorer_profile/src/utils.ts diff --git a/x-pack/plugins/discover_log_explorer/public/types.ts b/x-pack/plugins/log_explorer/public/types.ts similarity index 83% rename from x-pack/plugins/discover_log_explorer/public/types.ts rename to x-pack/plugins/log_explorer/public/types.ts index 4ec95ba94ec5a..ed02ebb4c2ec0 100644 --- a/x-pack/plugins/discover_log_explorer/public/types.ts +++ b/x-pack/plugins/log_explorer/public/types.ts @@ -10,6 +10,9 @@ import { DiscoverStart } from '@kbn/discover-plugin/public'; export type DiscoverLogExplorerPluginSetup = void; export type DiscoverLogExplorerPluginStart = void; +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface DiscoverLogExplorerSetupDeps {} + export interface DiscoverLogExplorerStartDeps { data: DataPublicPluginStart; discover: DiscoverStart; diff --git a/x-pack/plugins/discover_log_explorer/public/utils/comparator_by_field.ts b/x-pack/plugins/log_explorer/public/utils/comparator_by_field.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/utils/comparator_by_field.ts rename to x-pack/plugins/log_explorer/public/utils/comparator_by_field.ts diff --git a/x-pack/plugins/discover_log_explorer/public/utils/dataset_selection/all_dataset_selection.ts b/x-pack/plugins/log_explorer/public/utils/dataset_selection/all_dataset_selection.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/utils/dataset_selection/all_dataset_selection.ts rename to x-pack/plugins/log_explorer/public/utils/dataset_selection/all_dataset_selection.ts diff --git a/x-pack/plugins/discover_log_explorer/public/utils/dataset_selection/encoding.test.ts b/x-pack/plugins/log_explorer/public/utils/dataset_selection/encoding.test.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/utils/dataset_selection/encoding.test.ts rename to x-pack/plugins/log_explorer/public/utils/dataset_selection/encoding.test.ts diff --git a/x-pack/plugins/discover_log_explorer/public/utils/dataset_selection/encoding.ts b/x-pack/plugins/log_explorer/public/utils/dataset_selection/encoding.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/utils/dataset_selection/encoding.ts rename to x-pack/plugins/log_explorer/public/utils/dataset_selection/encoding.ts diff --git a/x-pack/plugins/discover_log_explorer/public/utils/dataset_selection/errors.ts b/x-pack/plugins/log_explorer/public/utils/dataset_selection/errors.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/utils/dataset_selection/errors.ts rename to x-pack/plugins/log_explorer/public/utils/dataset_selection/errors.ts diff --git a/x-pack/plugins/discover_log_explorer/public/utils/dataset_selection/hydrate_dataset_selection.ts.ts b/x-pack/plugins/log_explorer/public/utils/dataset_selection/hydrate_dataset_selection.ts.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/utils/dataset_selection/hydrate_dataset_selection.ts.ts rename to x-pack/plugins/log_explorer/public/utils/dataset_selection/hydrate_dataset_selection.ts.ts diff --git a/x-pack/plugins/discover_log_explorer/public/utils/dataset_selection/index.ts b/x-pack/plugins/log_explorer/public/utils/dataset_selection/index.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/utils/dataset_selection/index.ts rename to x-pack/plugins/log_explorer/public/utils/dataset_selection/index.ts diff --git a/x-pack/plugins/discover_log_explorer/public/utils/dataset_selection/single_dataset_selection.ts b/x-pack/plugins/log_explorer/public/utils/dataset_selection/single_dataset_selection.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/utils/dataset_selection/single_dataset_selection.ts rename to x-pack/plugins/log_explorer/public/utils/dataset_selection/single_dataset_selection.ts diff --git a/x-pack/plugins/discover_log_explorer/public/utils/dataset_selection/types.ts b/x-pack/plugins/log_explorer/public/utils/dataset_selection/types.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/utils/dataset_selection/types.ts rename to x-pack/plugins/log_explorer/public/utils/dataset_selection/types.ts diff --git a/x-pack/plugins/discover_log_explorer/public/utils/dynamic.tsx b/x-pack/plugins/log_explorer/public/utils/dynamic.tsx similarity index 100% rename from x-pack/plugins/discover_log_explorer/public/utils/dynamic.tsx rename to x-pack/plugins/log_explorer/public/utils/dynamic.tsx diff --git a/x-pack/plugins/discover_log_explorer/server/config.ts b/x-pack/plugins/log_explorer/server/config.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/server/config.ts rename to x-pack/plugins/log_explorer/server/config.ts diff --git a/x-pack/plugins/discover_log_explorer/server/index.ts b/x-pack/plugins/log_explorer/server/index.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/server/index.ts rename to x-pack/plugins/log_explorer/server/index.ts diff --git a/x-pack/plugins/discover_log_explorer/server/plugin.ts b/x-pack/plugins/log_explorer/server/plugin.ts similarity index 100% rename from x-pack/plugins/discover_log_explorer/server/plugin.ts rename to x-pack/plugins/log_explorer/server/plugin.ts diff --git a/x-pack/plugins/discover_log_explorer/tsconfig.json b/x-pack/plugins/log_explorer/tsconfig.json similarity index 100% rename from x-pack/plugins/discover_log_explorer/tsconfig.json rename to x-pack/plugins/log_explorer/tsconfig.json diff --git a/yarn.lock b/yarn.lock index 8b4e4086a0881..c7f483f322716 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4208,10 +4208,6 @@ version "0.0.0" uid "" -"@kbn/discover-log-explorer-plugin@link:x-pack/plugins/discover_log_explorer": - version "0.0.0" - uid "" - "@kbn/discover-plugin@link:src/plugins/discover": version "0.0.0" uid "" @@ -4776,6 +4772,10 @@ version "0.0.0" uid "" +"@kbn/log-explorer-plugin@link:x-pack/plugins/log_explorer": + version "0.0.0" + uid "" + "@kbn/logging-mocks@link:packages/kbn-logging-mocks": version "0.0.0" uid "" From 3d077e207a60a59a12da9868d017e727f9d277d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Thu, 17 Aug 2023 16:26:55 +0000 Subject: [PATCH 02/46] Add observability_log_explorer plugin --- .github/CODEOWNERS | 3 +- package.json | 1 + tsconfig.base.json | 2 + .../log_explorer/common/plugin_config.ts | 2 +- .../log_explorer/common/runtime_types.ts | 47 +------------------ x-pack/plugins/log_explorer/public/index.ts | 11 +++-- x-pack/plugins/log_explorer/public/plugin.ts | 32 +++++-------- x-pack/plugins/log_explorer/public/types.ts | 8 ++-- x-pack/plugins/log_explorer/server/config.ts | 10 +--- .../.storybook/__mocks__/package_icon.tsx | 11 +++++ .../.storybook/main.js | 22 +++++++++ .../.storybook/preview.js | 13 +++++ .../observability_log_explorer/README.md | 0 .../common/plugin_config.ts | 9 ++++ .../observability_log_explorer/jest.config.js | 18 +++++++ .../observability_log_explorer/kibana.jsonc | 20 ++++++++ .../public/index.ts | 14 ++++++ .../public/plugin.ts | 40 ++++++++++++++++ .../public/types.ts | 18 +++++++ .../observability_log_explorer/tsconfig.json | 21 +++++++++ yarn.lock | 4 ++ 21 files changed, 220 insertions(+), 86 deletions(-) create mode 100644 x-pack/plugins/observability_log_explorer/.storybook/__mocks__/package_icon.tsx create mode 100644 x-pack/plugins/observability_log_explorer/.storybook/main.js create mode 100644 x-pack/plugins/observability_log_explorer/.storybook/preview.js create mode 100644 x-pack/plugins/observability_log_explorer/README.md create mode 100644 x-pack/plugins/observability_log_explorer/common/plugin_config.ts create mode 100644 x-pack/plugins/observability_log_explorer/jest.config.js create mode 100644 x-pack/plugins/observability_log_explorer/kibana.jsonc create mode 100644 x-pack/plugins/observability_log_explorer/public/index.ts create mode 100644 x-pack/plugins/observability_log_explorer/public/plugin.ts create mode 100644 x-pack/plugins/observability_log_explorer/public/types.ts create mode 100644 x-pack/plugins/observability_log_explorer/tsconfig.json diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f9b11d42c0b19..29578f6ad275a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -328,7 +328,6 @@ packages/kbn-dev-utils @elastic/kibana-operations examples/developer_examples @elastic/appex-sharedux examples/discover_customization_examples @elastic/kibana-data-discovery x-pack/plugins/discover_enhanced @elastic/kibana-data-discovery -x-pack/plugins/log_explorer @elastic/infra-monitoring-ui src/plugins/discover @elastic/kibana-data-discovery packages/kbn-discover-utils @elastic/kibana-data-discovery packages/kbn-doc-links @elastic/docs @@ -473,6 +472,8 @@ examples/locator_explorer @elastic/kibana-app-services packages/kbn-logging @elastic/kibana-core packages/kbn-logging-mocks @elastic/kibana-core x-pack/plugins/logs_shared @elastic/infra-monitoring-ui +x-pack/plugins/log_explorer @elastic/infra-monitoring-ui +x-pack/plugins/observablity_log_explorer @elastic/infra-monitoring-ui x-pack/plugins/logstash @elastic/logstash packages/kbn-managed-vscode-config @elastic/kibana-operations packages/kbn-managed-vscode-config-cli @elastic/kibana-operations diff --git a/package.json b/package.json index 8c07cc97704a4..e0edcb3b7e52a 100644 --- a/package.json +++ b/package.json @@ -539,6 +539,7 @@ "@kbn/observability-ai-assistant-plugin": "link:x-pack/plugins/observability_ai_assistant", "@kbn/observability-alert-details": "link:x-pack/packages/observability/alert_details", "@kbn/observability-fixtures-plugin": "link:x-pack/test/cases_api_integration/common/plugins/observability", + "@kbn/observability-log-explorer-plugin": "link:x-pack/plugins/observability_log_explorer", "@kbn/observability-onboarding-plugin": "link:x-pack/plugins/observability_onboarding", "@kbn/observability-plugin": "link:x-pack/plugins/observability", "@kbn/observability-shared-plugin": "link:x-pack/plugins/observability_shared", diff --git a/tsconfig.base.json b/tsconfig.base.json index b8e568b036021..c5729d3334724 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1036,6 +1036,8 @@ "@kbn/observability-alert-details/*": ["x-pack/packages/observability/alert_details/*"], "@kbn/observability-fixtures-plugin": ["x-pack/test/cases_api_integration/common/plugins/observability"], "@kbn/observability-fixtures-plugin/*": ["x-pack/test/cases_api_integration/common/plugins/observability/*"], + "@kbn/observability-log-explorer-plugin": ["x-pack/plugins/observability_log_explorer"], + "@kbn/observability-log-explorer-plugin/*": ["x-pack/plugins/observability_log_explorer/*"], "@kbn/observability-onboarding-plugin": ["x-pack/plugins/observability_onboarding"], "@kbn/observability-onboarding-plugin/*": ["x-pack/plugins/observability_onboarding/*"], "@kbn/observability-plugin": ["x-pack/plugins/observability"], diff --git a/x-pack/plugins/log_explorer/common/plugin_config.ts b/x-pack/plugins/log_explorer/common/plugin_config.ts index ca8a3dab2a182..5c83b84c184e8 100644 --- a/x-pack/plugins/log_explorer/common/plugin_config.ts +++ b/x-pack/plugins/log_explorer/common/plugin_config.ts @@ -5,7 +5,7 @@ * 2.0. */ -export interface DiscoverLogExplorerConfig { +export interface LogExplorerConfig { featureFlags: { deepLinkVisible: boolean; }; diff --git a/x-pack/plugins/log_explorer/common/runtime_types.ts b/x-pack/plugins/log_explorer/common/runtime_types.ts index d6d0336eafdd7..00043671edff4 100644 --- a/x-pack/plugins/log_explorer/common/runtime_types.ts +++ b/x-pack/plugins/log_explorer/common/runtime_types.ts @@ -5,49 +5,4 @@ * 2.0. */ -import { fold } from 'fp-ts/lib/Either'; -import { identity } from 'fp-ts/lib/function'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { Context, Errors, IntersectionType, Type, UnionType, ValidationError } from 'io-ts'; - -type ErrorFactory = (message: string) => Error; - -const getErrorPath = ([first, ...rest]: Context): string[] => { - if (typeof first === 'undefined') { - return []; - } else if (first.type instanceof IntersectionType) { - const [, ...next] = rest; - return getErrorPath(next); - } else if (first.type instanceof UnionType) { - const [, ...next] = rest; - return [first.key, ...getErrorPath(next)]; - } - - return [first.key, ...getErrorPath(rest)]; -}; - -const getErrorType = ({ context }: ValidationError) => - context[context.length - 1]?.type?.name ?? 'unknown'; - -const formatError = (error: ValidationError) => - error.message ?? - `in ${getErrorPath(error.context).join('/')}: ${JSON.stringify( - error.value - )} does not match expected type ${getErrorType(error)}`; - -export const formatErrors = (errors: ValidationError[]) => - `Failed to validate: \n${errors.map((error) => ` ${formatError(error)}`).join('\n')}`; - -export const createPlainError = (message: string) => new Error(message); - -export const throwErrors = (createError: ErrorFactory) => (errors: Errors) => { - throw createError(formatErrors(errors)); -}; - -export const decodeOrThrow = - ( - runtimeType: Type, - createError: ErrorFactory = createPlainError - ) => - (inputValue: InputValue) => - pipe(runtimeType.decode(inputValue), fold(throwErrors(createError), identity)); +export { createPlainError, decodeOrThrow, formatErrors, throwErrors } from '@kbn/io-ts-utils'; diff --git a/x-pack/plugins/log_explorer/public/index.ts b/x-pack/plugins/log_explorer/public/index.ts index 0c4298100c558..c145f6fd88864 100644 --- a/x-pack/plugins/log_explorer/public/index.ts +++ b/x-pack/plugins/log_explorer/public/index.ts @@ -5,10 +5,11 @@ * 2.0. */ -import { PluginInitializerContext } from '@kbn/core/public'; -import { DiscoverLogExplorerConfig } from '../common/plugin_config'; -import { DiscoverLogExplorerPlugin } from './plugin'; +import type { PluginInitializerContext } from '@kbn/core/public'; +import type { LogExplorerConfig } from '../common/plugin_config'; +import { LogExplorerPlugin } from './plugin'; +export type { LogExplorerPluginSetup, LogExplorerPluginStart } from './types'; -export function plugin(context: PluginInitializerContext) { - return new DiscoverLogExplorerPlugin(context); +export function plugin(context: PluginInitializerContext) { + return new LogExplorerPlugin(context); } diff --git a/x-pack/plugins/log_explorer/public/plugin.ts b/x-pack/plugins/log_explorer/public/plugin.ts index e51d936df3c91..e911d298e053c 100644 --- a/x-pack/plugins/log_explorer/public/plugin.ts +++ b/x-pack/plugins/log_explorer/public/plugin.ts @@ -6,40 +6,30 @@ */ import { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; -import { i18n } from '@kbn/i18n'; import { LOG_EXPLORER_PROFILE_ID } from '../common/constants'; -import { DiscoverLogExplorerConfig } from '../common/plugin_config'; +import { LogExplorerConfig } from '../common/plugin_config'; import { createLogExplorerProfileCustomizations } from './customizations/log_explorer_profile'; import { getLogExplorerDeepLink } from './deep_links'; import { - DiscoverLogExplorerPluginSetup, - DiscoverLogExplorerPluginStart, - DiscoverLogExplorerSetupDeps, - DiscoverLogExplorerStartDeps, + LogExplorerPluginSetup, + LogExplorerPluginStart, + LogExplorerSetupDeps, + LogExplorerStartDeps, } from './types'; -export class DiscoverLogExplorerPlugin - implements Plugin -{ - private config: DiscoverLogExplorerConfig; +export class LogExplorerPlugin implements Plugin { + private config: LogExplorerConfig; - constructor(context: PluginInitializerContext) { + constructor(context: PluginInitializerContext) { this.config = context.config.get(); } - public setup(core: CoreSetup, plugins: DiscoverLogExplorerSetupDeps) { - core.application.register({ - id: 'log-explorer', - title: i18n.translate('xpack.log_explorer.appTitle', { defaultMessage: 'Log Explorer' }), - mount(params) { - throw new Error('Function not implemented.'); - }, - }); - } + public setup(core: CoreSetup, plugins: LogExplorerSetupDeps) {} - public start(core: CoreStart, plugins: DiscoverLogExplorerStartDeps) { + public start(core: CoreStart, plugins: LogExplorerStartDeps) { const { discover, data } = plugins; + // TODO: replace with component export discover.registerCustomizationProfile(LOG_EXPLORER_PROFILE_ID, { customize: createLogExplorerProfileCustomizations({ core, data }), deepLinks: [getLogExplorerDeepLink({ isVisible: this.config.featureFlags.deepLinkVisible })], diff --git a/x-pack/plugins/log_explorer/public/types.ts b/x-pack/plugins/log_explorer/public/types.ts index ed02ebb4c2ec0..693981c185a77 100644 --- a/x-pack/plugins/log_explorer/public/types.ts +++ b/x-pack/plugins/log_explorer/public/types.ts @@ -7,13 +7,13 @@ import { DataPublicPluginStart } from '@kbn/data-plugin/public'; import { DiscoverStart } from '@kbn/discover-plugin/public'; -export type DiscoverLogExplorerPluginSetup = void; -export type DiscoverLogExplorerPluginStart = void; +export type LogExplorerPluginSetup = void; +export type LogExplorerPluginStart = void; // eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface DiscoverLogExplorerSetupDeps {} +export interface LogExplorerSetupDeps {} -export interface DiscoverLogExplorerStartDeps { +export interface LogExplorerStartDeps { data: DataPublicPluginStart; discover: DiscoverStart; } diff --git a/x-pack/plugins/log_explorer/server/config.ts b/x-pack/plugins/log_explorer/server/config.ts index 4fe008fbd7399..cee7389bb07c4 100644 --- a/x-pack/plugins/log_explorer/server/config.ts +++ b/x-pack/plugins/log_explorer/server/config.ts @@ -7,8 +7,7 @@ import { schema } from '@kbn/config-schema'; import { PluginConfigDescriptor } from '@kbn/core/server'; - -import { DiscoverLogExplorerConfig } from '../common/plugin_config'; +import { LogExplorerConfig } from '../common/plugin_config'; export const configSchema = schema.object({ featureFlags: schema.object({ @@ -24,11 +23,6 @@ export const configSchema = schema.object({ }), }); -export const config: PluginConfigDescriptor = { +export const config: PluginConfigDescriptor = { schema: configSchema, - exposeToBrowser: { - featureFlags: { - deepLinkVisible: true, - }, - }, }; diff --git a/x-pack/plugins/observability_log_explorer/.storybook/__mocks__/package_icon.tsx b/x-pack/plugins/observability_log_explorer/.storybook/__mocks__/package_icon.tsx new file mode 100644 index 0000000000000..2bb5c6c7614aa --- /dev/null +++ b/x-pack/plugins/observability_log_explorer/.storybook/__mocks__/package_icon.tsx @@ -0,0 +1,11 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import React from 'react'; +import { EuiIcon } from '@elastic/eui'; + +// Export mock package icon that doesn't trigger http requests +export const PackageIcon = () => ; diff --git a/x-pack/plugins/observability_log_explorer/.storybook/main.js b/x-pack/plugins/observability_log_explorer/.storybook/main.js new file mode 100644 index 0000000000000..79b438e7eb7ce --- /dev/null +++ b/x-pack/plugins/observability_log_explorer/.storybook/main.js @@ -0,0 +1,22 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +const defaultConfig = require('@kbn/storybook').defaultConfig; + +module.exports = { + ...defaultConfig, + stories: ['../**/*.stories.mdx', ...defaultConfig.stories], + webpackFinal: async (config) => { + const originalConfig = await defaultConfig.webpackFinal(config); + + // Mock fleet plugin for PackageIcon component + originalConfig.resolve.alias['@kbn/fleet-plugin/public'] = require.resolve( + './__mocks__/package_icon' + ); + return originalConfig; + }, +}; diff --git a/x-pack/plugins/observability_log_explorer/.storybook/preview.js b/x-pack/plugins/observability_log_explorer/.storybook/preview.js new file mode 100644 index 0000000000000..33a07bd3fac1f --- /dev/null +++ b/x-pack/plugins/observability_log_explorer/.storybook/preview.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +export const parameters = { + docs: { + source: { + type: 'code', // without this, stories in mdx documents freeze the browser + }, + }, +}; diff --git a/x-pack/plugins/observability_log_explorer/README.md b/x-pack/plugins/observability_log_explorer/README.md new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/x-pack/plugins/observability_log_explorer/common/plugin_config.ts b/x-pack/plugins/observability_log_explorer/common/plugin_config.ts new file mode 100644 index 0000000000000..9d86e61c12faa --- /dev/null +++ b/x-pack/plugins/observability_log_explorer/common/plugin_config.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface ObservabilityLogExplorerConfig {} diff --git a/x-pack/plugins/observability_log_explorer/jest.config.js b/x-pack/plugins/observability_log_explorer/jest.config.js new file mode 100644 index 0000000000000..f258a72a9d0c6 --- /dev/null +++ b/x-pack/plugins/observability_log_explorer/jest.config.js @@ -0,0 +1,18 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../..', + roots: ['/x-pack/plugins/observability_log_explorer'], + coverageDirectory: + '/target/kibana-coverage/jest/x-pack/plugins/observability_log_explorer', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/observability_log_explorer/{common,public}/**/*.{ts,tsx}', + ], +}; diff --git a/x-pack/plugins/observability_log_explorer/kibana.jsonc b/x-pack/plugins/observability_log_explorer/kibana.jsonc new file mode 100644 index 0000000000000..7dc18ebb32ca8 --- /dev/null +++ b/x-pack/plugins/observability_log_explorer/kibana.jsonc @@ -0,0 +1,20 @@ +{ + "type": "plugin", + "id": "@kbn/observability-log-explorer-plugin", + "owner": "@elastic/infra-monitoring-ui", + "description": "This plugin exposes and registers observability log consumption features.", + "plugin": { + "id": "observabilityLogExplorer", + "server": true, + "browser": true, + "configPath": [ + "xpack", + "observabilityLogExplorer" + ], + "requiredPlugins": [ + "logExplorer", + ], + "optionalPlugins": [], + "requiredBundles": [] + } +} diff --git a/x-pack/plugins/observability_log_explorer/public/index.ts b/x-pack/plugins/observability_log_explorer/public/index.ts new file mode 100644 index 0000000000000..0c4298100c558 --- /dev/null +++ b/x-pack/plugins/observability_log_explorer/public/index.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { PluginInitializerContext } from '@kbn/core/public'; +import { DiscoverLogExplorerConfig } from '../common/plugin_config'; +import { DiscoverLogExplorerPlugin } from './plugin'; + +export function plugin(context: PluginInitializerContext) { + return new DiscoverLogExplorerPlugin(context); +} diff --git a/x-pack/plugins/observability_log_explorer/public/plugin.ts b/x-pack/plugins/observability_log_explorer/public/plugin.ts new file mode 100644 index 0000000000000..cd1f1d4720d63 --- /dev/null +++ b/x-pack/plugins/observability_log_explorer/public/plugin.ts @@ -0,0 +1,40 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; +import { i18n } from '@kbn/i18n'; +import { type ObservabilityLogExplorerConfig } from '../common/plugin_config'; +import type { + ObservabilityLogExplorerPluginSetup, + ObservabilityLogExplorerPluginStart, + ObservabilityLogExplorerSetupDeps, + ObservabilityLogExplorerStartDeps, +} from './types'; + +export class ObservabilityLogExplorerPlugin + implements Plugin +{ + private config: ObservabilityLogExplorerConfig; + + constructor(context: PluginInitializerContext) { + this.config = context.config.get(); + } + + public setup(core: CoreSetup, plugins: ObservabilityLogExplorerSetupDeps) { + core.application.register({ + id: 'log-explorer', + title: i18n.translate('xpack.observability_log_explorer.appTitle', { + defaultMessage: 'Log Explorer', + }), + mount(params) { + throw new Error('Function not implemented.'); + }, + }); + } + + public start(core: CoreStart, plugins: ObservabilityLogExplorerStartDeps) {} +} diff --git a/x-pack/plugins/observability_log_explorer/public/types.ts b/x-pack/plugins/observability_log_explorer/public/types.ts new file mode 100644 index 0000000000000..d1c352a22caab --- /dev/null +++ b/x-pack/plugins/observability_log_explorer/public/types.ts @@ -0,0 +1,18 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { LogExplorerPluginStart } from '@kbn/log-explorer-plugin/public'; + +export type ObservabilityLogExplorerPluginSetup = void; +export type ObservabilityLogExplorerPluginStart = void; + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface ObservabilityLogExplorerSetupDeps {} + +export interface ObservabilityLogExplorerStartDeps { + logExplorer: LogExplorerPluginStart; +} diff --git a/x-pack/plugins/observability_log_explorer/tsconfig.json b/x-pack/plugins/observability_log_explorer/tsconfig.json new file mode 100644 index 0000000000000..aa728a9e78bd9 --- /dev/null +++ b/x-pack/plugins/observability_log_explorer/tsconfig.json @@ -0,0 +1,21 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "../../../typings/**/*", + "common/**/*", + "public/**/*", + "server/**/*", + ".storybook/**/*.tsx" + ], + "kbn_references": [ + "@kbn/core", + "@kbn/log-explorer-plugin", + "@kbn/i18n", + ], + "exclude": [ + "target/**/*" + ] +} diff --git a/yarn.lock b/yarn.lock index c7f483f322716..a95c21db6232a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4980,6 +4980,10 @@ version "0.0.0" uid "" +"@kbn/observability-log-explorer-plugin@link:x-pack/plugins/observability_log_explorer": + version "0.0.0" + uid "" + "@kbn/observability-onboarding-plugin@link:x-pack/plugins/observability_onboarding": version "0.0.0" uid "" From 6b32955087edb74d6fbab19a8afb7d249eb7a146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Mon, 21 Aug 2023 12:09:27 +0000 Subject: [PATCH 03/46] Add obs log explorer server-side --- .../observability_log_explorer/server/index.ts | 10 ++++++++++ .../observability_log_explorer/server/plugin.ts | 14 ++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 x-pack/plugins/observability_log_explorer/server/index.ts create mode 100644 x-pack/plugins/observability_log_explorer/server/plugin.ts diff --git a/x-pack/plugins/observability_log_explorer/server/index.ts b/x-pack/plugins/observability_log_explorer/server/index.ts new file mode 100644 index 0000000000000..1310dd1227141 --- /dev/null +++ b/x-pack/plugins/observability_log_explorer/server/index.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { ObservabilityLogExplorerServerPlugin } from './plugin'; + +export const plugin = () => new ObservabilityLogExplorerServerPlugin(); diff --git a/x-pack/plugins/observability_log_explorer/server/plugin.ts b/x-pack/plugins/observability_log_explorer/server/plugin.ts new file mode 100644 index 0000000000000..da2d5edee0e96 --- /dev/null +++ b/x-pack/plugins/observability_log_explorer/server/plugin.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { Plugin } from '@kbn/core/server'; + +export class ObservabilityLogExplorerServerPlugin implements Plugin { + setup() {} + + start() {} +} From 39b1440b3e72683db9322eaf0a8bf305d9c55db5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Mon, 21 Aug 2023 18:44:59 +0000 Subject: [PATCH 04/46] Achieve basic log explorer rendering --- config/serverless.oblt.yml | 1 - .../public/components/log_explorer/index.ts | 8 +++ .../components/log_explorer/log_explorer.tsx | 42 ++++++++++++ .../customizations/log_explorer_profile.tsx | 2 +- x-pack/plugins/log_explorer/public/plugin.ts | 18 ++--- x-pack/plugins/log_explorer/public/types.ts | 10 ++- x-pack/plugins/log_explorer/server/config.ts | 3 + .../observability_log_explorer/kibana.jsonc | 1 + .../observability_log_explorer.tsx | 67 +++++++++++++++++++ .../observability_log_explorer_app.tsx | 14 ++++ .../public/index.ts | 8 +-- .../public/plugin.ts | 25 +++++-- .../public/routes/main/index.tsx | 8 +++ .../public/routes/main/main_route.tsx | 20 ++++++ .../public/types.ts | 9 ++- .../public/utils/use_kibana.tsx | 46 +++++++++++++ 16 files changed, 258 insertions(+), 24 deletions(-) create mode 100644 x-pack/plugins/log_explorer/public/components/log_explorer/index.ts create mode 100644 x-pack/plugins/log_explorer/public/components/log_explorer/log_explorer.tsx create mode 100644 x-pack/plugins/observability_log_explorer/public/applications/observability_log_explorer.tsx create mode 100644 x-pack/plugins/observability_log_explorer/public/components/observability_log_explorer_app.tsx create mode 100644 x-pack/plugins/observability_log_explorer/public/routes/main/index.tsx create mode 100644 x-pack/plugins/observability_log_explorer/public/routes/main/main_route.tsx create mode 100644 x-pack/plugins/observability_log_explorer/public/utils/use_kibana.tsx diff --git a/config/serverless.oblt.yml b/config/serverless.oblt.yml index 44d26351b5380..5e6b9a58cbc35 100644 --- a/config/serverless.oblt.yml +++ b/config/serverless.oblt.yml @@ -10,7 +10,6 @@ xpack.serverless.observability.enabled: true ## Configure plugins xpack.infra.logs.app_target: discover -xpack.discoverLogExplorer.featureFlags.deepLinkVisible: true ## Set the home route uiSettings.overrides.defaultRoute: /app/observability/landing diff --git a/x-pack/plugins/log_explorer/public/components/log_explorer/index.ts b/x-pack/plugins/log_explorer/public/components/log_explorer/index.ts new file mode 100644 index 0000000000000..b5c2f0f89d545 --- /dev/null +++ b/x-pack/plugins/log_explorer/public/components/log_explorer/index.ts @@ -0,0 +1,8 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export * from './log_explorer'; diff --git a/x-pack/plugins/log_explorer/public/components/log_explorer/log_explorer.tsx b/x-pack/plugins/log_explorer/public/components/log_explorer/log_explorer.tsx new file mode 100644 index 0000000000000..76c8aefdccf75 --- /dev/null +++ b/x-pack/plugins/log_explorer/public/components/log_explorer/log_explorer.tsx @@ -0,0 +1,42 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { ScopedHistory } from '@kbn/core-application-browser'; +import { DiscoverStart } from '@kbn/discover-plugin/public'; +import React, { useEffect, useMemo } from 'react'; +import { + createLogExplorerProfileCustomizations, + CreateLogExplorerProfileCustomizationsDeps, +} from '../../customizations/log_explorer_profile'; + +export interface CreateLogExplorerArgs extends CreateLogExplorerProfileCustomizationsDeps { + discover: DiscoverStart; +} + +export interface LogExplorerProps { + scopedHistory: ScopedHistory; +} + +export const createLogExplorer = ({ + core, + data, + discover: { DiscoverContainer }, +}: CreateLogExplorerArgs) => { + const customizeLogExplorer = createLogExplorerProfileCustomizations({ core, data }); + + return ({ scopedHistory }: LogExplorerProps) => { + const overrideServices = useMemo(() => ({}), []); + + return ( + + ); + }; +}; diff --git a/x-pack/plugins/log_explorer/public/customizations/log_explorer_profile.tsx b/x-pack/plugins/log_explorer/public/customizations/log_explorer_profile.tsx index d9b7a15269cb5..7a468d064de08 100644 --- a/x-pack/plugins/log_explorer/public/customizations/log_explorer_profile.tsx +++ b/x-pack/plugins/log_explorer/public/customizations/log_explorer_profile.tsx @@ -14,7 +14,7 @@ import { dynamic } from '../utils/dynamic'; const LazyCustomDatasetSelector = dynamic(() => import('./custom_dataset_selector')); const LazyCustomDatasetFilters = dynamic(() => import('./custom_dataset_filters')); -interface CreateLogExplorerProfileCustomizationsDeps { +export interface CreateLogExplorerProfileCustomizationsDeps { core: CoreStart; data: DataPublicPluginStart; } diff --git a/x-pack/plugins/log_explorer/public/plugin.ts b/x-pack/plugins/log_explorer/public/plugin.ts index e911d298e053c..31df229523e34 100644 --- a/x-pack/plugins/log_explorer/public/plugin.ts +++ b/x-pack/plugins/log_explorer/public/plugin.ts @@ -6,10 +6,8 @@ */ import { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; -import { LOG_EXPLORER_PROFILE_ID } from '../common/constants'; import { LogExplorerConfig } from '../common/plugin_config'; -import { createLogExplorerProfileCustomizations } from './customizations/log_explorer_profile'; -import { getLogExplorerDeepLink } from './deep_links'; +import { createLogExplorer } from './components/log_explorer'; import { LogExplorerPluginSetup, LogExplorerPluginStart, @@ -27,12 +25,16 @@ export class LogExplorerPlugin implements Plugin; +} // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface LogExplorerSetupDeps {} diff --git a/x-pack/plugins/log_explorer/server/config.ts b/x-pack/plugins/log_explorer/server/config.ts index cee7389bb07c4..fd0a65726eb76 100644 --- a/x-pack/plugins/log_explorer/server/config.ts +++ b/x-pack/plugins/log_explorer/server/config.ts @@ -25,4 +25,7 @@ export const configSchema = schema.object({ export const config: PluginConfigDescriptor = { schema: configSchema, + deprecations: ({ unusedFromRoot }) => [ + unusedFromRoot('xpack.discoverLogExplorer.featureFlags.deepLinkVisible', { level: 'warning' }), + ], }; diff --git a/x-pack/plugins/observability_log_explorer/kibana.jsonc b/x-pack/plugins/observability_log_explorer/kibana.jsonc index 7dc18ebb32ca8..bc294ebb0dd41 100644 --- a/x-pack/plugins/observability_log_explorer/kibana.jsonc +++ b/x-pack/plugins/observability_log_explorer/kibana.jsonc @@ -12,6 +12,7 @@ "observabilityLogExplorer" ], "requiredPlugins": [ + "data", "logExplorer", ], "optionalPlugins": [], diff --git a/x-pack/plugins/observability_log_explorer/public/applications/observability_log_explorer.tsx b/x-pack/plugins/observability_log_explorer/public/applications/observability_log_explorer.tsx new file mode 100644 index 0000000000000..f9ee300c38ddd --- /dev/null +++ b/x-pack/plugins/observability_log_explorer/public/applications/observability_log_explorer.tsx @@ -0,0 +1,67 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { AppMountParameters, CoreStart, ScopedHistory } from '@kbn/core/public'; +import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; +import { Route, Router, Routes } from '@kbn/shared-ux-router'; +import React from 'react'; +import ReactDOM from 'react-dom'; +import { ObservablityLogExplorerMainRoute } from '../routes/main'; +import { ObservabilityLogExplorerPluginStart, ObservabilityLogExplorerStartDeps } from '../types'; + +export const renderObservabilityLogExplorer = ( + core: CoreStart, + pluginsStart: ObservabilityLogExplorerStartDeps, + ownPluginStart: ObservabilityLogExplorerPluginStart, + { element, history }: AppMountParameters +) => { + ReactDOM.render( + , + element + ); + + return () => { + // work around race condition between unmount effect and current app id + // observable in the search session service + pluginsStart.data.search.session.clear(); + + ReactDOM.unmountComponentAtNode(element); + }; +}; + +export interface ObservabilityLogExplorerAppProps { + core: CoreStart; + plugins: ObservabilityLogExplorerStartDeps; + pluginStart: ObservabilityLogExplorerPluginStart; + history: ScopedHistory; +} + +export const ObservabilityLogExplorerApp = ({ + core: { i18n, theme }, + plugins: { logExplorer }, + pluginStart, + history, +}: ObservabilityLogExplorerAppProps) => ( + + + + ( + + )} + /> + + + +); diff --git a/x-pack/plugins/observability_log_explorer/public/components/observability_log_explorer_app.tsx b/x-pack/plugins/observability_log_explorer/public/components/observability_log_explorer_app.tsx new file mode 100644 index 0000000000000..32cba8e1bd866 --- /dev/null +++ b/x-pack/plugins/observability_log_explorer/public/components/observability_log_explorer_app.tsx @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; + +export interface ObservabilityLogExplorerAppProps { + services: {}; +} + +export const ObservabilityLogExplorerApp = () =>
; diff --git a/x-pack/plugins/observability_log_explorer/public/index.ts b/x-pack/plugins/observability_log_explorer/public/index.ts index 0c4298100c558..18e03f7889385 100644 --- a/x-pack/plugins/observability_log_explorer/public/index.ts +++ b/x-pack/plugins/observability_log_explorer/public/index.ts @@ -6,9 +6,9 @@ */ import { PluginInitializerContext } from '@kbn/core/public'; -import { DiscoverLogExplorerConfig } from '../common/plugin_config'; -import { DiscoverLogExplorerPlugin } from './plugin'; +import { ObservabilityLogExplorerConfig } from '../common/plugin_config'; +import { ObservabilityLogExplorerPlugin } from './plugin'; -export function plugin(context: PluginInitializerContext) { - return new DiscoverLogExplorerPlugin(context); +export function plugin(context: PluginInitializerContext) { + return new ObservabilityLogExplorerPlugin(context); } diff --git a/x-pack/plugins/observability_log_explorer/public/plugin.ts b/x-pack/plugins/observability_log_explorer/public/plugin.ts index cd1f1d4720d63..e13cb7b49eb33 100644 --- a/x-pack/plugins/observability_log_explorer/public/plugin.ts +++ b/x-pack/plugins/observability_log_explorer/public/plugin.ts @@ -8,6 +8,7 @@ import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; import { i18n } from '@kbn/i18n'; import { type ObservabilityLogExplorerConfig } from '../common/plugin_config'; +import { renderObservabilityLogExplorer } from './applications/observability_log_explorer'; import type { ObservabilityLogExplorerPluginSetup, ObservabilityLogExplorerPluginStart, @@ -24,17 +25,31 @@ export class ObservabilityLogExplorerPlugin this.config = context.config.get(); } - public setup(core: CoreSetup, plugins: ObservabilityLogExplorerSetupDeps) { + public setup( + core: CoreSetup, + pluginsSetup: ObservabilityLogExplorerSetupDeps + ) { core.application.register({ - id: 'log-explorer', + id: 'observability-log-explorer', title: i18n.translate('xpack.observability_log_explorer.appTitle', { defaultMessage: 'Log Explorer', }), - mount(params) { - throw new Error('Function not implemented.'); + mount: async (appMountParams) => { + const [coreStart, pluginsStart, ownPluginStart] = await core.getStartServices(); + + return renderObservabilityLogExplorer( + coreStart, + pluginsStart, + ownPluginStart, + appMountParams + ); }, }); + + return {}; } - public start(core: CoreStart, plugins: ObservabilityLogExplorerStartDeps) {} + public start(core: CoreStart, plugins: ObservabilityLogExplorerStartDeps) { + return {}; + } } diff --git a/x-pack/plugins/observability_log_explorer/public/routes/main/index.tsx b/x-pack/plugins/observability_log_explorer/public/routes/main/index.tsx new file mode 100644 index 0000000000000..889e340497cf9 --- /dev/null +++ b/x-pack/plugins/observability_log_explorer/public/routes/main/index.tsx @@ -0,0 +1,8 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export * from './main_route'; diff --git a/x-pack/plugins/observability_log_explorer/public/routes/main/main_route.tsx b/x-pack/plugins/observability_log_explorer/public/routes/main/main_route.tsx new file mode 100644 index 0000000000000..3fccbb5a3a9a1 --- /dev/null +++ b/x-pack/plugins/observability_log_explorer/public/routes/main/main_route.tsx @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { ScopedHistory } from '@kbn/core/public'; +import { LogExplorerPluginStart } from '@kbn/log-explorer-plugin/public'; +import React from 'react'; + +export interface ObservablityLogExplorerMainRouteProps { + history: ScopedHistory; + logExplorer: LogExplorerPluginStart; +} + +export const ObservablityLogExplorerMainRoute = ({ + history, + logExplorer, +}: ObservablityLogExplorerMainRouteProps) => ; diff --git a/x-pack/plugins/observability_log_explorer/public/types.ts b/x-pack/plugins/observability_log_explorer/public/types.ts index d1c352a22caab..175da1c279b98 100644 --- a/x-pack/plugins/observability_log_explorer/public/types.ts +++ b/x-pack/plugins/observability_log_explorer/public/types.ts @@ -5,14 +5,19 @@ * 2.0. */ +import { DataPublicPluginStart } from '@kbn/data-plugin/public'; import { LogExplorerPluginStart } from '@kbn/log-explorer-plugin/public'; -export type ObservabilityLogExplorerPluginSetup = void; -export type ObservabilityLogExplorerPluginStart = void; +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface ObservabilityLogExplorerPluginSetup {} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface ObservabilityLogExplorerPluginStart {} // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface ObservabilityLogExplorerSetupDeps {} export interface ObservabilityLogExplorerStartDeps { + data: DataPublicPluginStart; logExplorer: LogExplorerPluginStart; } diff --git a/x-pack/plugins/observability_log_explorer/public/utils/use_kibana.tsx b/x-pack/plugins/observability_log_explorer/public/utils/use_kibana.tsx new file mode 100644 index 0000000000000..d8b2235586e55 --- /dev/null +++ b/x-pack/plugins/observability_log_explorer/public/utils/use_kibana.tsx @@ -0,0 +1,46 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { CoreStart } from '@kbn/core/public'; +import { + createKibanaReactContext, + KibanaReactContextValue, + useKibana, +} from '@kbn/kibana-react-plugin/public'; +import { useMemo } from 'react'; +import { ObservabilityLogExplorerPluginStart, ObservabilityLogExplorerStartDeps } from '../types'; + +export type PluginKibanaContextValue = CoreStart & + ObservabilityLogExplorerStartDeps & + ObservabilityLogExplorerPluginStart; + +export const createKibanaContextForPlugin = ( + core: CoreStart, + plugins: ObservabilityLogExplorerStartDeps, + pluginStart: ObservabilityLogExplorerPluginStart +) => + createKibanaReactContext({ + ...core, + ...plugins, + ...pluginStart, + }); + +export const useKibanaContextForPlugin = + useKibana as () => KibanaReactContextValue; + +export const useKibanaContextForPluginProvider = ( + core: CoreStart, + plugins: ObservabilityLogExplorerStartDeps, + pluginStart: ObservabilityLogExplorerPluginStart +) => { + const { Provider } = useMemo( + () => createKibanaContextForPlugin(core, plugins, pluginStart), + [core, pluginStart, plugins] + ); + + return Provider; +}; From 87cd1e5df3c053ec401b33ff1e89c7988c6adbc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Tue, 22 Aug 2023 16:09:32 +0000 Subject: [PATCH 05/46] Hide the nav entry for now --- .../observability_log_explorer/public/plugin.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/observability_log_explorer/public/plugin.ts b/x-pack/plugins/observability_log_explorer/public/plugin.ts index e13cb7b49eb33..7c557e8953fb7 100644 --- a/x-pack/plugins/observability_log_explorer/public/plugin.ts +++ b/x-pack/plugins/observability_log_explorer/public/plugin.ts @@ -5,7 +5,14 @@ * 2.0. */ -import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; +import { + AppNavLinkStatus, + CoreSetup, + CoreStart, + DEFAULT_APP_CATEGORIES, + Plugin, + PluginInitializerContext, +} from '@kbn/core/public'; import { i18n } from '@kbn/i18n'; import { type ObservabilityLogExplorerConfig } from '../common/plugin_config'; import { renderObservabilityLogExplorer } from './applications/observability_log_explorer'; @@ -34,6 +41,9 @@ export class ObservabilityLogExplorerPlugin title: i18n.translate('xpack.observability_log_explorer.appTitle', { defaultMessage: 'Log Explorer', }), + category: DEFAULT_APP_CATEGORIES.observability, + euiIconType: 'logoObservability', + navLinkStatus: AppNavLinkStatus.hidden, mount: async (appMountParams) => { const [coreStart, pluginsStart, ownPluginStart] = await core.getStartServices(); From 4fee709aeecd9c05754acf7f449053dacfbae2d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Tue, 22 Aug 2023 17:54:50 +0000 Subject: [PATCH 06/46] Wrap with obs page template --- .../observability_log_explorer/kibana.jsonc | 1 + .../observability_log_explorer.tsx | 8 +++-- .../observability_log_explorer_app.tsx | 14 -------- .../public/components/page_template.tsx | 36 +++++++++++++++++++ .../public/routes/main/main_route.tsx | 10 +++++- .../public/types.ts | 2 ++ 6 files changed, 54 insertions(+), 17 deletions(-) delete mode 100644 x-pack/plugins/observability_log_explorer/public/components/observability_log_explorer_app.tsx create mode 100644 x-pack/plugins/observability_log_explorer/public/components/page_template.tsx diff --git a/x-pack/plugins/observability_log_explorer/kibana.jsonc b/x-pack/plugins/observability_log_explorer/kibana.jsonc index bc294ebb0dd41..519f462e8dff8 100644 --- a/x-pack/plugins/observability_log_explorer/kibana.jsonc +++ b/x-pack/plugins/observability_log_explorer/kibana.jsonc @@ -14,6 +14,7 @@ "requiredPlugins": [ "data", "logExplorer", + "observabilityShared" ], "optionalPlugins": [], "requiredBundles": [] diff --git a/x-pack/plugins/observability_log_explorer/public/applications/observability_log_explorer.tsx b/x-pack/plugins/observability_log_explorer/public/applications/observability_log_explorer.tsx index f9ee300c38ddd..5b6097e4bef7a 100644 --- a/x-pack/plugins/observability_log_explorer/public/applications/observability_log_explorer.tsx +++ b/x-pack/plugins/observability_log_explorer/public/applications/observability_log_explorer.tsx @@ -47,7 +47,7 @@ export interface ObservabilityLogExplorerAppProps { export const ObservabilityLogExplorerApp = ({ core: { i18n, theme }, - plugins: { logExplorer }, + plugins: { logExplorer, observabilityShared }, pluginStart, history, }: ObservabilityLogExplorerAppProps) => ( @@ -58,7 +58,11 @@ export const ObservabilityLogExplorerApp = ({ path="/" exact={true} render={() => ( - + )} /> diff --git a/x-pack/plugins/observability_log_explorer/public/components/observability_log_explorer_app.tsx b/x-pack/plugins/observability_log_explorer/public/components/observability_log_explorer_app.tsx deleted file mode 100644 index 32cba8e1bd866..0000000000000 --- a/x-pack/plugins/observability_log_explorer/public/components/observability_log_explorer_app.tsx +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; - -export interface ObservabilityLogExplorerAppProps { - services: {}; -} - -export const ObservabilityLogExplorerApp = () =>
; diff --git a/x-pack/plugins/observability_log_explorer/public/components/page_template.tsx b/x-pack/plugins/observability_log_explorer/public/components/page_template.tsx new file mode 100644 index 0000000000000..e79b8b1bc6271 --- /dev/null +++ b/x-pack/plugins/observability_log_explorer/public/components/page_template.tsx @@ -0,0 +1,36 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiPageSectionProps } from '@elastic/eui'; +import { css } from '@emotion/react'; +import type { ObservabilitySharedPluginStart } from '@kbn/observability-shared-plugin/public'; +import React from 'react'; + +export const ObservabilityLogExplorerPageTemplate = ({ + children, + observabilityShared, +}: React.PropsWithChildren<{ + observabilityShared: ObservabilitySharedPluginStart; +}>) => ( + + {children} + +); + +const fullHeightContentStyles = css` + display: flex; + flex-direction: column; + flex: 1 0 auto; + width: 100%; + height: 100%; +`; + +const pageSectionProps: EuiPageSectionProps = { + grow: true, + paddingSize: 'none', + contentProps: { css: fullHeightContentStyles }, +}; diff --git a/x-pack/plugins/observability_log_explorer/public/routes/main/main_route.tsx b/x-pack/plugins/observability_log_explorer/public/routes/main/main_route.tsx index 3fccbb5a3a9a1..db2fb54a2fccc 100644 --- a/x-pack/plugins/observability_log_explorer/public/routes/main/main_route.tsx +++ b/x-pack/plugins/observability_log_explorer/public/routes/main/main_route.tsx @@ -7,14 +7,22 @@ import { ScopedHistory } from '@kbn/core/public'; import { LogExplorerPluginStart } from '@kbn/log-explorer-plugin/public'; +import { ObservabilitySharedPluginStart } from '@kbn/observability-shared-plugin/public'; import React from 'react'; +import { ObservabilityLogExplorerPageTemplate } from '../../components/page_template'; export interface ObservablityLogExplorerMainRouteProps { history: ScopedHistory; logExplorer: LogExplorerPluginStart; + observabilityShared: ObservabilitySharedPluginStart; } export const ObservablityLogExplorerMainRoute = ({ history, logExplorer, -}: ObservablityLogExplorerMainRouteProps) => ; + observabilityShared, +}: ObservablityLogExplorerMainRouteProps) => ( + + + +); diff --git a/x-pack/plugins/observability_log_explorer/public/types.ts b/x-pack/plugins/observability_log_explorer/public/types.ts index 175da1c279b98..4701e3d510dfb 100644 --- a/x-pack/plugins/observability_log_explorer/public/types.ts +++ b/x-pack/plugins/observability_log_explorer/public/types.ts @@ -7,6 +7,7 @@ import { DataPublicPluginStart } from '@kbn/data-plugin/public'; import { LogExplorerPluginStart } from '@kbn/log-explorer-plugin/public'; +import { ObservabilitySharedPluginStart } from '@kbn/observability-shared-plugin/public'; // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface ObservabilityLogExplorerPluginSetup {} @@ -20,4 +21,5 @@ export interface ObservabilityLogExplorerSetupDeps {} export interface ObservabilityLogExplorerStartDeps { data: DataPublicPluginStart; logExplorer: LogExplorerPluginStart; + observabilityShared: ObservabilitySharedPluginStart; } From 15f9300507af5b0854a86b1fb8994a7c8015c115 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 22 Aug 2023 18:04:37 +0000 Subject: [PATCH 07/46] [CI] Auto-commit changed files from 'node scripts/lint_ts_projects --fix' --- x-pack/plugins/log_explorer/tsconfig.json | 1 + x-pack/plugins/observability_log_explorer/tsconfig.json | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/x-pack/plugins/log_explorer/tsconfig.json b/x-pack/plugins/log_explorer/tsconfig.json index 61ea70ece2d38..c9a7904531574 100644 --- a/x-pack/plugins/log_explorer/tsconfig.json +++ b/x-pack/plugins/log_explorer/tsconfig.json @@ -20,6 +20,7 @@ "@kbn/data-plugin", "@kbn/unified-field-list", "@kbn/config-schema", + "@kbn/core-application-browser", ], "exclude": ["target/**/*"] } diff --git a/x-pack/plugins/observability_log_explorer/tsconfig.json b/x-pack/plugins/observability_log_explorer/tsconfig.json index aa728a9e78bd9..789f798ed65f8 100644 --- a/x-pack/plugins/observability_log_explorer/tsconfig.json +++ b/x-pack/plugins/observability_log_explorer/tsconfig.json @@ -14,6 +14,11 @@ "@kbn/core", "@kbn/log-explorer-plugin", "@kbn/i18n", + "@kbn/react-kibana-context-render", + "@kbn/shared-ux-router", + "@kbn/observability-shared-plugin", + "@kbn/data-plugin", + "@kbn/kibana-react-plugin", ], "exclude": [ "target/**/*" From 41de574eb94f8df6b745ffbb19dd53e96a0fdd81 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 22 Aug 2023 18:11:38 +0000 Subject: [PATCH 08/46] [CI] Auto-commit changed files from 'node scripts/generate codeowners' --- .github/CODEOWNERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 29578f6ad275a..aa7abfecd152f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -469,11 +469,10 @@ packages/kbn-lint-ts-projects-cli @elastic/kibana-operations x-pack/plugins/lists @elastic/security-detection-engine examples/locator_examples @elastic/kibana-app-services examples/locator_explorer @elastic/kibana-app-services +x-pack/plugins/log_explorer @elastic/infra-monitoring-ui packages/kbn-logging @elastic/kibana-core packages/kbn-logging-mocks @elastic/kibana-core x-pack/plugins/logs_shared @elastic/infra-monitoring-ui -x-pack/plugins/log_explorer @elastic/infra-monitoring-ui -x-pack/plugins/observablity_log_explorer @elastic/infra-monitoring-ui x-pack/plugins/logstash @elastic/logstash packages/kbn-managed-vscode-config @elastic/kibana-operations packages/kbn-managed-vscode-config-cli @elastic/kibana-operations @@ -522,6 +521,7 @@ packages/kbn-object-versioning @elastic/appex-sharedux x-pack/plugins/observability_ai_assistant @elastic/obs-ai-assistant x-pack/packages/observability/alert_details @elastic/actionable-observability x-pack/test/cases_api_integration/common/plugins/observability @elastic/response-ops +x-pack/plugins/observability_log_explorer @elastic/infra-monitoring-ui x-pack/plugins/observability_onboarding @elastic/apm-ui x-pack/plugins/observability @elastic/actionable-observability x-pack/plugins/observability_shared @elastic/observability-ui From a77ee8708c760fbab7614bad9c812dde8ee122ef Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 22 Aug 2023 18:18:45 +0000 Subject: [PATCH 09/46] [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs' --- docs/developer/plugin-list.asciidoc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index 57e5ed40571ea..474acbd0dc59d 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -512,10 +512,6 @@ Plugin server-side only. Plugin has three main functions: |Contains the enhancements to the OSS discover app. -|{kib-repo}blob/{branch}/x-pack/plugins/discover_log_explorer/README.md[discoverLogExplorer] -|This plugin registers a log-explorer profile using the Discover customization framework, offering several affordances specifically designed for log consumption. - - |{kib-repo}blob/{branch}/x-pack/plugins/ecs_data_quality_dashboard/README.md[ecsDataQualityDashboard] |This plugin implements (server) APIs used to render the content of the Data Quality dashboard. @@ -620,6 +616,10 @@ 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] +|This plugin provides a LogExplorer component using the Discover customization framework, offering several affordances specifically designed for log consumption. + + |{kib-repo}blob/{branch}/x-pack/plugins/logs_shared/README.md[logsShared] |Exposes the shared components and APIs to access and visualize logs. @@ -657,6 +657,10 @@ Elastic. |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] +|undefined + + |{kib-repo}blob/{branch}/x-pack/plugins/observability_onboarding/README.md[observabilityOnboarding] |This plugin provides an onboarding framework for observability solutions: Logs and APM. From 6b24b5c47ea5ddcafb974977030ffed303e17b29 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 22 Aug 2023 18:51:01 +0000 Subject: [PATCH 10/46] [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' --- .../public/components/log_explorer/log_explorer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/log_explorer/public/components/log_explorer/log_explorer.tsx b/x-pack/plugins/log_explorer/public/components/log_explorer/log_explorer.tsx index 76c8aefdccf75..5fe50259b8601 100644 --- a/x-pack/plugins/log_explorer/public/components/log_explorer/log_explorer.tsx +++ b/x-pack/plugins/log_explorer/public/components/log_explorer/log_explorer.tsx @@ -7,7 +7,7 @@ import { ScopedHistory } from '@kbn/core-application-browser'; import { DiscoverStart } from '@kbn/discover-plugin/public'; -import React, { useEffect, useMemo } from 'react'; +import React, { useMemo } from 'react'; import { createLogExplorerProfileCustomizations, CreateLogExplorerProfileCustomizationsDeps, From c6769856d7b85debbbf3a06b4e1ec51ae7cf2499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Wed, 23 Aug 2023 15:46:23 +0000 Subject: [PATCH 11/46] Make deep link searchable --- .../observability_log_explorer/public/plugin.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/observability_log_explorer/public/plugin.ts b/x-pack/plugins/observability_log_explorer/public/plugin.ts index 7c557e8953fb7..3adaf9834b646 100644 --- a/x-pack/plugins/observability_log_explorer/public/plugin.ts +++ b/x-pack/plugins/observability_log_explorer/public/plugin.ts @@ -38,12 +38,11 @@ export class ObservabilityLogExplorerPlugin ) { core.application.register({ id: 'observability-log-explorer', - title: i18n.translate('xpack.observability_log_explorer.appTitle', { - defaultMessage: 'Log Explorer', - }), + title: logExplorerAppTitle, category: DEFAULT_APP_CATEGORIES.observability, - euiIconType: 'logoObservability', + euiIconType: 'logoLogging', navLinkStatus: AppNavLinkStatus.hidden, + searchable: true, mount: async (appMountParams) => { const [coreStart, pluginsStart, ownPluginStart] = await core.getStartServices(); @@ -63,3 +62,7 @@ export class ObservabilityLogExplorerPlugin return {}; } } + +const logExplorerAppTitle = i18n.translate('xpack.observability_log_explorer.appTitle', { + defaultMessage: 'Log Explorer', +}); From f5fb0173201b9cd5e7c581af0613ce3b3514fb19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Wed, 23 Aug 2023 15:50:50 +0000 Subject: [PATCH 12/46] Add stateful log explorer link --- x-pack/plugins/infra/public/plugin.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/plugins/infra/public/plugin.ts b/x-pack/plugins/infra/public/plugin.ts index 7ea1dbdfa7cd2..e22cb6d13f747 100644 --- a/x-pack/plugins/infra/public/plugin.ts +++ b/x-pack/plugins/infra/public/plugin.ts @@ -130,6 +130,7 @@ export class Plugin implements InfraClientPluginClass { label: 'Logs', sortKey: 200, entries: [ + { label: 'Explorer', app: 'observability-log-explorer', path: '/' }, { label: 'Stream', app: 'logs', path: '/stream' }, { label: 'Anomalies', app: 'logs', path: '/anomalies' }, { label: 'Categories', app: 'logs', path: '/log-categories' }, From 3e9f0c0fc6f3b8d27ee6f6b326f04a9e19d6f3b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Thu, 24 Aug 2023 10:59:35 +0000 Subject: [PATCH 13/46] Add breadcrumbs --- .../common/translations.ts | 12 ++++++ .../observability_log_explorer/kibana.jsonc | 4 +- .../observability_log_explorer.tsx | 8 ++-- .../public/plugin.ts | 6 +-- .../public/routes/main/main_route.tsx | 22 +++++++--- .../public/types.ts | 2 + .../public/utils/breadcrumbs.tsx | 41 +++++++++++++++++++ 7 files changed, 80 insertions(+), 15 deletions(-) create mode 100644 x-pack/plugins/observability_log_explorer/common/translations.ts create mode 100644 x-pack/plugins/observability_log_explorer/public/utils/breadcrumbs.tsx diff --git a/x-pack/plugins/observability_log_explorer/common/translations.ts b/x-pack/plugins/observability_log_explorer/common/translations.ts new file mode 100644 index 0000000000000..726dee617c535 --- /dev/null +++ b/x-pack/plugins/observability_log_explorer/common/translations.ts @@ -0,0 +1,12 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +export const logExplorerAppTitle = i18n.translate('xpack.observability_log_explorer.appTitle', { + defaultMessage: 'Log Explorer', +}); diff --git a/x-pack/plugins/observability_log_explorer/kibana.jsonc b/x-pack/plugins/observability_log_explorer/kibana.jsonc index 519f462e8dff8..35121b578c39c 100644 --- a/x-pack/plugins/observability_log_explorer/kibana.jsonc +++ b/x-pack/plugins/observability_log_explorer/kibana.jsonc @@ -16,7 +16,9 @@ "logExplorer", "observabilityShared" ], - "optionalPlugins": [], + "optionalPlugins": [ + "serverless" + ], "requiredBundles": [] } } diff --git a/x-pack/plugins/observability_log_explorer/public/applications/observability_log_explorer.tsx b/x-pack/plugins/observability_log_explorer/public/applications/observability_log_explorer.tsx index 5b6097e4bef7a..7d6863e4eb45a 100644 --- a/x-pack/plugins/observability_log_explorer/public/applications/observability_log_explorer.tsx +++ b/x-pack/plugins/observability_log_explorer/public/applications/observability_log_explorer.tsx @@ -46,12 +46,12 @@ export interface ObservabilityLogExplorerAppProps { } export const ObservabilityLogExplorerApp = ({ - core: { i18n, theme }, - plugins: { logExplorer, observabilityShared }, + core, + plugins: { logExplorer, observabilityShared, serverless }, pluginStart, history, }: ObservabilityLogExplorerAppProps) => ( - + ( )} /> diff --git a/x-pack/plugins/observability_log_explorer/public/plugin.ts b/x-pack/plugins/observability_log_explorer/public/plugin.ts index 3adaf9834b646..9cc3405efce0d 100644 --- a/x-pack/plugins/observability_log_explorer/public/plugin.ts +++ b/x-pack/plugins/observability_log_explorer/public/plugin.ts @@ -13,8 +13,8 @@ import { Plugin, PluginInitializerContext, } from '@kbn/core/public'; -import { i18n } from '@kbn/i18n'; import { type ObservabilityLogExplorerConfig } from '../common/plugin_config'; +import { logExplorerAppTitle } from '../common/translations'; import { renderObservabilityLogExplorer } from './applications/observability_log_explorer'; import type { ObservabilityLogExplorerPluginSetup, @@ -62,7 +62,3 @@ export class ObservabilityLogExplorerPlugin return {}; } } - -const logExplorerAppTitle = i18n.translate('xpack.observability_log_explorer.appTitle', { - defaultMessage: 'Log Explorer', -}); diff --git a/x-pack/plugins/observability_log_explorer/public/routes/main/main_route.tsx b/x-pack/plugins/observability_log_explorer/public/routes/main/main_route.tsx index db2fb54a2fccc..5e9b22fb1ad5d 100644 --- a/x-pack/plugins/observability_log_explorer/public/routes/main/main_route.tsx +++ b/x-pack/plugins/observability_log_explorer/public/routes/main/main_route.tsx @@ -5,24 +5,34 @@ * 2.0. */ -import { ScopedHistory } from '@kbn/core/public'; +import { CoreStart, ScopedHistory } from '@kbn/core/public'; import { LogExplorerPluginStart } from '@kbn/log-explorer-plugin/public'; import { ObservabilitySharedPluginStart } from '@kbn/observability-shared-plugin/public'; +import { ServerlessPluginStart } from '@kbn/serverless/public'; import React from 'react'; import { ObservabilityLogExplorerPageTemplate } from '../../components/page_template'; +import { noBreadcrumbs, useBreadcrumbs } from '../../utils/breadcrumbs'; export interface ObservablityLogExplorerMainRouteProps { + core: CoreStart; history: ScopedHistory; logExplorer: LogExplorerPluginStart; observabilityShared: ObservabilitySharedPluginStart; + serverless?: ServerlessPluginStart; } export const ObservablityLogExplorerMainRoute = ({ + core, history, logExplorer, observabilityShared, -}: ObservablityLogExplorerMainRouteProps) => ( - - - -); + serverless, +}: ObservablityLogExplorerMainRouteProps) => { + useBreadcrumbs(noBreadcrumbs, core.chrome, serverless); + + return ( + + + + ); +}; diff --git a/x-pack/plugins/observability_log_explorer/public/types.ts b/x-pack/plugins/observability_log_explorer/public/types.ts index 4701e3d510dfb..62fd3525d0a30 100644 --- a/x-pack/plugins/observability_log_explorer/public/types.ts +++ b/x-pack/plugins/observability_log_explorer/public/types.ts @@ -8,6 +8,7 @@ import { DataPublicPluginStart } from '@kbn/data-plugin/public'; import { LogExplorerPluginStart } from '@kbn/log-explorer-plugin/public'; import { ObservabilitySharedPluginStart } from '@kbn/observability-shared-plugin/public'; +import { ServerlessPluginStart } from '@kbn/serverless/public'; // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface ObservabilityLogExplorerPluginSetup {} @@ -22,4 +23,5 @@ export interface ObservabilityLogExplorerStartDeps { data: DataPublicPluginStart; logExplorer: LogExplorerPluginStart; observabilityShared: ObservabilitySharedPluginStart; + serverless?: ServerlessPluginStart; } diff --git a/x-pack/plugins/observability_log_explorer/public/utils/breadcrumbs.tsx b/x-pack/plugins/observability_log_explorer/public/utils/breadcrumbs.tsx new file mode 100644 index 0000000000000..b1a44ac6d64cb --- /dev/null +++ b/x-pack/plugins/observability_log_explorer/public/utils/breadcrumbs.tsx @@ -0,0 +1,41 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiBreadcrumb } from '@elastic/eui'; +import type { ChromeStart } from '@kbn/core-chrome-browser'; +import type { ServerlessPluginStart } from '@kbn/serverless/public'; +import { useEffect } from 'react'; +import { logExplorerAppTitle } from '../../common/translations'; + +export const useBreadcrumbs = ( + breadcrumbs: EuiBreadcrumb[], + chromeService?: ChromeStart, + serverlessService?: ServerlessPluginStart +) => { + useEffect(() => { + setBreadcrumbs(breadcrumbs, chromeService, serverlessService); + }, [breadcrumbs, chromeService, serverlessService]); +}; + +export function setBreadcrumbs( + breadcrumbs: EuiBreadcrumb[], + chromeService?: ChromeStart, + serverlessService?: ServerlessPluginStart +) { + if (serverlessService) { + serverlessService.setBreadcrumbs(breadcrumbs); + } else if (chromeService) { + chromeService.setBreadcrumbs([ + { + text: logExplorerAppTitle, + }, + ...breadcrumbs, + ]); + } +} + +export const noBreadcrumbs: EuiBreadcrumb[] = []; From c49a4d74d1d286ce2654d3483511e4510327cf64 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 24 Aug 2023 11:07:35 +0000 Subject: [PATCH 14/46] [CI] Auto-commit changed files from 'node scripts/lint_ts_projects --fix' --- x-pack/plugins/observability_log_explorer/tsconfig.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x-pack/plugins/observability_log_explorer/tsconfig.json b/x-pack/plugins/observability_log_explorer/tsconfig.json index 789f798ed65f8..724d6494e1192 100644 --- a/x-pack/plugins/observability_log_explorer/tsconfig.json +++ b/x-pack/plugins/observability_log_explorer/tsconfig.json @@ -19,6 +19,8 @@ "@kbn/observability-shared-plugin", "@kbn/data-plugin", "@kbn/kibana-react-plugin", + "@kbn/serverless", + "@kbn/core-chrome-browser", ], "exclude": [ "target/**/*" From 79040415c63d5b0b6a953a3ab38cd34df89e0124 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Thu, 24 Aug 2023 12:29:29 +0000 Subject: [PATCH 15/46] Fix filter control height and clipping --- .../public/customizations/custom_dataset_filters.tsx | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/x-pack/plugins/log_explorer/public/customizations/custom_dataset_filters.tsx b/x-pack/plugins/log_explorer/public/customizations/custom_dataset_filters.tsx index a669ebea33942..1f27f4a12b05f 100644 --- a/x-pack/plugins/log_explorer/public/customizations/custom_dataset_filters.tsx +++ b/x-pack/plugins/log_explorer/public/customizations/custom_dataset_filters.tsx @@ -45,16 +45,6 @@ const ControlGroupContainer = euiStyled.div` .controlGroup { min-height: unset; } - - .euiFormLabel { - padding-top: 0; - padding-bottom: 0; - line-height: 32px !important; - } - - .euiFormControlLayout { - height: 32px; - } `; // eslint-disable-next-line import/no-default-export From eeeceaccfde38631868e2b31005857cf756b9429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Thu, 24 Aug 2023 13:58:06 +0000 Subject: [PATCH 16/46] Prevent enabling the search session service --- .../components/log_explorer/log_explorer.tsx | 25 ++++++++++++- .../log_explorer/public/utils/proxies.ts | 36 +++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 x-pack/plugins/log_explorer/public/utils/proxies.ts diff --git a/x-pack/plugins/log_explorer/public/components/log_explorer/log_explorer.tsx b/x-pack/plugins/log_explorer/public/components/log_explorer/log_explorer.tsx index 5fe50259b8601..7224d8d50e5a3 100644 --- a/x-pack/plugins/log_explorer/public/components/log_explorer/log_explorer.tsx +++ b/x-pack/plugins/log_explorer/public/components/log_explorer/log_explorer.tsx @@ -6,12 +6,14 @@ */ import { ScopedHistory } from '@kbn/core-application-browser'; +import { DataPublicPluginStart, ISearchStart, ISessionService } from '@kbn/data-plugin/public'; import { DiscoverStart } from '@kbn/discover-plugin/public'; import React, { useMemo } from 'react'; import { createLogExplorerProfileCustomizations, CreateLogExplorerProfileCustomizationsDeps, } from '../../customizations/log_explorer_profile'; +import { createPropertyGetProxy } from '../../utils/proxies'; export interface CreateLogExplorerArgs extends CreateLogExplorerProfileCustomizationsDeps { discover: DiscoverStart; @@ -29,7 +31,12 @@ export const createLogExplorer = ({ const customizeLogExplorer = createLogExplorerProfileCustomizations({ core, data }); return ({ scopedHistory }: LogExplorerProps) => { - const overrideServices = useMemo(() => ({}), []); + const overrideServices = useMemo( + () => ({ + data: createDataServiceProxy(data), + }), + [] + ); return ( { + return createPropertyGetProxy(data, { + search: (searchService: ISearchStart) => + createPropertyGetProxy(searchService, { + session: (sessionService: ISessionService) => + createPropertyGetProxy(sessionService, { + enableStorage: () => () => {}, + }), + }), + }); +}; diff --git a/x-pack/plugins/log_explorer/public/utils/proxies.ts b/x-pack/plugins/log_explorer/public/utils/proxies.ts new file mode 100644 index 0000000000000..5599f061f4d67 --- /dev/null +++ b/x-pack/plugins/log_explorer/public/utils/proxies.ts @@ -0,0 +1,36 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +/** + * Creates a Proxy in which certain property accesses are redirected to + * replacement factories. + * + * @param target the object to proxy + * @param replacements a map of keys to replacement factories + * @returns a proxy of the object + */ +export const createPropertyGetProxy = ( + target: Target, + replacements: { + [key in Key]: (value: Target[Key]) => Target[Key]; + } +) => + new Proxy(target, { + get(accessedTarget, accessedKey, ...rest) { + const value = Reflect.get(accessedTarget, accessedKey, ...rest); + if (hasKey(replacements, accessedKey)) { + return replacements[accessedKey](value); + } else { + return value; + } + }, + }); + +const hasKey = ( + obj: T, + key: string | number | symbol +): key is K => obj.hasOwnProperty(key); From 70675504d6e61182a3cfaca4f1d2a40af864ddb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Thu, 24 Aug 2023 14:50:37 +0000 Subject: [PATCH 17/46] Add to serverless nav --- packages/deeplinks/observability/constants.ts | 2 ++ packages/deeplinks/observability/deep_links.ts | 3 +++ x-pack/plugins/observability_log_explorer/public/plugin.ts | 4 +++- x-pack/plugins/observability_log_explorer/public/types.ts | 5 +++-- .../public/components/side_navigation/index.tsx | 6 +++--- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/packages/deeplinks/observability/constants.ts b/packages/deeplinks/observability/constants.ts index addd326de2ce3..a28c9e4aaff21 100644 --- a/packages/deeplinks/observability/constants.ts +++ b/packages/deeplinks/observability/constants.ts @@ -8,6 +8,8 @@ export const LOGS_APP_ID = 'logs'; +export const OBSERVABILITY_LOG_EXPLORER = 'observability-log-explorer'; + export const OBSERVABILITY_OVERVIEW_APP_ID = 'observability-overview'; export const METRICS_APP_ID = 'metrics'; diff --git a/packages/deeplinks/observability/deep_links.ts b/packages/deeplinks/observability/deep_links.ts index 19432ef37d3ba..6302f2e4d3508 100644 --- a/packages/deeplinks/observability/deep_links.ts +++ b/packages/deeplinks/observability/deep_links.ts @@ -9,6 +9,7 @@ import { DISCOVER_APP_ID } from '@kbn/deeplinks-analytics'; import { LOGS_APP_ID, + OBSERVABILITY_LOG_EXPLORER, OBSERVABILITY_OVERVIEW_APP_ID, METRICS_APP_ID, APM_APP_ID, @@ -16,6 +17,7 @@ import { } from './constants'; type LogsApp = typeof LOGS_APP_ID; +type ObservabilityLogExplorerApp = typeof OBSERVABILITY_LOG_EXPLORER; type ObservabilityOverviewApp = typeof OBSERVABILITY_OVERVIEW_APP_ID; type MetricsApp = typeof METRICS_APP_ID; type ApmApp = typeof APM_APP_ID; @@ -23,6 +25,7 @@ type ObservabilityOnboardingApp = typeof OBSERVABILITY_ONBOARDING_APP_ID; export type AppId = | LogsApp + | ObservabilityLogExplorerApp | ObservabilityOverviewApp | ObservabilityOnboardingApp | ApmApp diff --git a/x-pack/plugins/observability_log_explorer/public/plugin.ts b/x-pack/plugins/observability_log_explorer/public/plugin.ts index 9cc3405efce0d..064cac55aa1f4 100644 --- a/x-pack/plugins/observability_log_explorer/public/plugin.ts +++ b/x-pack/plugins/observability_log_explorer/public/plugin.ts @@ -36,12 +36,14 @@ export class ObservabilityLogExplorerPlugin core: CoreSetup, pluginsSetup: ObservabilityLogExplorerSetupDeps ) { + const isServerless = !!pluginsSetup.serverless; + core.application.register({ id: 'observability-log-explorer', title: logExplorerAppTitle, category: DEFAULT_APP_CATEGORIES.observability, euiIconType: 'logoLogging', - navLinkStatus: AppNavLinkStatus.hidden, + navLinkStatus: isServerless ? AppNavLinkStatus.visible : AppNavLinkStatus.hidden, searchable: true, mount: async (appMountParams) => { const [coreStart, pluginsStart, ownPluginStart] = await core.getStartServices(); diff --git a/x-pack/plugins/observability_log_explorer/public/types.ts b/x-pack/plugins/observability_log_explorer/public/types.ts index 62fd3525d0a30..f5e6526c502d9 100644 --- a/x-pack/plugins/observability_log_explorer/public/types.ts +++ b/x-pack/plugins/observability_log_explorer/public/types.ts @@ -16,8 +16,9 @@ export interface ObservabilityLogExplorerPluginSetup {} // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface ObservabilityLogExplorerPluginStart {} -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface ObservabilityLogExplorerSetupDeps {} +export interface ObservabilityLogExplorerSetupDeps { + serverless?: ServerlessPluginStart; +} export interface ObservabilityLogExplorerStartDeps { data: DataPublicPluginStart; diff --git a/x-pack/plugins/serverless_observability/public/components/side_navigation/index.tsx b/x-pack/plugins/serverless_observability/public/components/side_navigation/index.tsx index 34b0e2652b5de..3808a64e3baff 100644 --- a/x-pack/plugins/serverless_observability/public/components/side_navigation/index.tsx +++ b/x-pack/plugins/serverless_observability/public/components/side_navigation/index.tsx @@ -31,10 +31,10 @@ const navigationTree: NavigationTreeDefinition = { id: 'discover-dashboard-alerts-slos', children: [ { - title: i18n.translate('xpack.serverlessObservability.nav.discover', { - defaultMessage: 'Discover', + title: i18n.translate('xpack.serverlessObservability.nav.logExplorer', { + defaultMessage: 'Log Explorer', }), - link: 'discover:log-explorer', + link: 'observability-log-explorer', }, { title: i18n.translate('xpack.serverlessObservability.nav.dashboards', { From 4198a443762f7bf85a61f477f7c5cd9407dae045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Thu, 24 Aug 2023 17:11:05 +0000 Subject: [PATCH 18/46] Start to fix the functional tests --- .buildkite/ftr_configs.yml | 2 +- .../deeplinks/observability/deep_links.ts | 2 - packages/kbn-optimizer/limits.yml | 2 +- src/dev/storybook/aliases.ts | 2 +- .../test_suites/core_plugins/rendering.ts | 4 - x-pack/.i18nrc.json | 2 +- .../components/dataset_selector/constants.tsx | 42 ++-- .../dataset_selector.stories.tsx | 2 +- .../sub_components/datasets_list.tsx | 2 +- .../integrations_list_status.tsx | 2 +- .../log_explorer_profile/src/notifications.ts | 18 +- x-pack/plugins/log_explorer/server/index.ts | 4 +- x-pack/plugins/log_explorer/server/plugin.ts | 2 +- .../columns_selection.ts | 12 +- .../config.ts | 0 .../customization.ts | 0 .../dataset_selection_state.ts | 18 +- .../dataset_selector.ts | 237 +++++++++--------- .../index.ts | 2 +- x-pack/test/functional/config.base.js | 3 + .../data_streams/data.json.gz | Bin .../data_streams/mappings.json | 0 x-pack/test/functional/page_objects/index.ts | 4 +- ...lorer.ts => observability_log_explorer.ts} | 2 +- .../test_suites/observability/index.ts | 4 +- .../columns_selection.ts | 4 +- .../customization.ts | 0 .../dataset_selection_state.ts | 18 +- .../dataset_selector.ts | 237 +++++++++--------- .../index.ts | 2 +- 30 files changed, 314 insertions(+), 315 deletions(-) rename x-pack/test/functional/apps/{discover_log_explorer => observability_log_explorer}/columns_selection.ts (77%) rename x-pack/test/functional/apps/{discover_log_explorer => observability_log_explorer}/config.ts (100%) rename x-pack/test/functional/apps/{discover_log_explorer => observability_log_explorer}/customization.ts (100%) rename x-pack/test/functional/apps/{discover_log_explorer => observability_log_explorer}/dataset_selection_state.ts (82%) rename x-pack/test/functional/apps/{discover_log_explorer => observability_log_explorer}/dataset_selector.ts (63%) rename x-pack/test/functional/apps/{discover_log_explorer => observability_log_explorer}/index.ts (91%) rename x-pack/test/functional/es_archives/{discover_log_explorer => observability_log_explorer}/data_streams/data.json.gz (100%) rename x-pack/test/functional/es_archives/{discover_log_explorer => observability_log_explorer}/data_streams/mappings.json (100%) rename x-pack/test/functional/page_objects/{discover_log_explorer.ts => observability_log_explorer.ts} (99%) rename x-pack/test_serverless/functional/test_suites/observability/{discover_log_explorer => observability_log_explorer}/columns_selection.ts (91%) rename x-pack/test_serverless/functional/test_suites/observability/{discover_log_explorer => observability_log_explorer}/customization.ts (100%) rename x-pack/test_serverless/functional/test_suites/observability/{discover_log_explorer => observability_log_explorer}/dataset_selection_state.ts (82%) rename x-pack/test_serverless/functional/test_suites/observability/{discover_log_explorer => observability_log_explorer}/dataset_selector.ts (63%) rename x-pack/test_serverless/functional/test_suites/observability/{discover_log_explorer => observability_log_explorer}/index.ts (91%) diff --git a/.buildkite/ftr_configs.yml b/.buildkite/ftr_configs.yml index 317ee67e0c055..c2acc5c4c3fd9 100644 --- a/.buildkite/ftr_configs.yml +++ b/.buildkite/ftr_configs.yml @@ -279,7 +279,6 @@ enabled: - x-pack/test/functional/apps/data_views/config.ts - x-pack/test/functional/apps/dev_tools/config.ts - x-pack/test/functional/apps/discover/config.ts - - x-pack/test/functional/apps/discover_log_explorer/config.ts - x-pack/test/functional/apps/graph/config.ts - x-pack/test/functional/apps/grok_debugger/config.ts - x-pack/test/functional/apps/home/config.ts @@ -313,6 +312,7 @@ enabled: - x-pack/test/functional/apps/ml/short_tests/config.ts - x-pack/test/functional/apps/ml/stack_management_jobs/config.ts - x-pack/test/functional/apps/monitoring/config.ts + - x-pack/test/functional/apps/observability_log_explorer/config.ts - x-pack/test/functional/apps/remote_clusters/config.ts - x-pack/test/functional/apps/reporting_management/config.ts - x-pack/test/functional/apps/rollup_job/config.ts diff --git a/packages/deeplinks/observability/deep_links.ts b/packages/deeplinks/observability/deep_links.ts index 6302f2e4d3508..00916ced40374 100644 --- a/packages/deeplinks/observability/deep_links.ts +++ b/packages/deeplinks/observability/deep_links.ts @@ -31,7 +31,6 @@ export type AppId = | ApmApp | MetricsApp; -export type DiscoverLogExplorerId = `${typeof DISCOVER_APP_ID}:log-explorer`; export type LogsLinkId = 'log-categories' | 'settings' | 'anomalies' | 'stream'; @@ -58,7 +57,6 @@ export type LinkId = LogsLinkId | ObservabilityOverviewLinkId | MetricsLinkId | export type DeepLinkId = | AppId - | DiscoverLogExplorerId | `${LogsApp}:${LogsLinkId}` | `${ObservabilityOverviewApp}:${ObservabilityOverviewLinkId}` | `${MetricsApp}:${MetricsLinkId}` diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml index 536b3f883cac6..4e89396b29ad9 100644 --- a/packages/kbn-optimizer/limits.yml +++ b/packages/kbn-optimizer/limits.yml @@ -36,7 +36,6 @@ pageLoadAssetSize: devTools: 38637 discover: 99999 discoverEnhanced: 42730 - discoverLogExplorer: 39045 embeddable: 87309 embeddableEnhanced: 22107 enterpriseSearch: 50858 @@ -87,6 +86,7 @@ pageLoadAssetSize: licenseManagement: 41817 licensing: 29004 lists: 22900 + logExplorer: 39045 logsShared: 281060 logstash: 53548 management: 46112 diff --git a/src/dev/storybook/aliases.ts b/src/dev/storybook/aliases.ts index b02009cd155d2..fea9d8629f382 100644 --- a/src/dev/storybook/aliases.ts +++ b/src/dev/storybook/aliases.ts @@ -27,7 +27,7 @@ export const storybookAliases = { dashboard: 'src/plugins/dashboard/.storybook', data: 'src/plugins/data/.storybook', discover: 'src/plugins/discover/.storybook', - discover_log_explorer: 'x-pack/plugins/discover_log_explorer/.storybook', + log_explorer: 'x-pack/plugins/log_explorer/.storybook', embeddable: 'src/plugins/embeddable/.storybook', es_ui_shared: 'src/plugins/es_ui_shared/.storybook', expression_error: 'src/plugins/expression_error/.storybook', diff --git a/test/plugin_functional/test_suites/core_plugins/rendering.ts b/test/plugin_functional/test_suites/core_plugins/rendering.ts index 6e0c4be2faaec..38fecbe13e2f5 100644 --- a/test/plugin_functional/test_suites/core_plugins/rendering.ts +++ b/test/plugin_functional/test_suites/core_plugins/rendering.ts @@ -291,10 +291,6 @@ export default function ({ getService }: PluginFunctionalProviderContext) { 'xpack.observability.unsafe.alertDetails.observability.enabled (boolean)', 'xpack.observability.unsafe.thresholdRule.enabled (boolean)', 'xpack.observability_onboarding.ui.enabled (boolean)', - /** - * xpack.discoverLogExplorer.featureFlags is conditional and will never resolve if used in non-serverless environment - */ - 'xpack.discoverLogExplorer.featureFlags.deepLinkVisible (any)', ]; // We don't assert that actualExposedConfigKeys and expectedExposedConfigKeys are equal, because test failure messages with large // arrays are hard to grok. Instead, we take the difference between the two arrays and assert them separately, that way it's diff --git a/x-pack/.i18nrc.json b/x-pack/.i18nrc.json index 3fa5a2da7c0ff..741565cb31f90 100644 --- a/x-pack/.i18nrc.json +++ b/x-pack/.i18nrc.json @@ -21,7 +21,6 @@ "xpack.customBranding": "plugins/custom_branding", "xpack.dashboard": "plugins/dashboard_enhanced", "xpack.discover": "plugins/discover_enhanced", - "xpack.discoverLogExplorer": "plugins/discover_log_explorer", "xpack.crossClusterReplication": "plugins/cross_cluster_replication", "xpack.elasticAssistant": "packages/kbn-elastic-assistant", "xpack.embeddableEnhanced": "plugins/embeddable_enhanced", @@ -60,6 +59,7 @@ ], "xpack.monitoring": ["plugins/monitoring"], "xpack.observability": "plugins/observability", + "xpack.observabilityLogExplorer": "plugins/observability_log_explorer", "xpack.observabilityShared": "plugins/observability_shared", "xpack.observability_onboarding": "plugins/observability_onboarding", "xpack.observabilityAiAssistant": "plugins/observability_ai_assistant", diff --git a/x-pack/plugins/log_explorer/public/components/dataset_selector/constants.tsx b/x-pack/plugins/log_explorer/public/components/dataset_selector/constants.tsx index a3ea4b85bbb00..5890b92f3bf1a 100644 --- a/x-pack/plugins/log_explorer/public/components/dataset_selector/constants.tsx +++ b/x-pack/plugins/log_explorer/public/components/dataset_selector/constants.tsx @@ -16,59 +16,53 @@ export const DATA_VIEW_POPOVER_CONTENT_WIDTH = 300; export const contextMenuStyles = { maxHeight: 440 }; export const selectDatasetLabel = i18n.translate( - 'xpack.discoverLogExplorer.datasetSelector.selectDataset', + 'xpack.logExplorer.datasetSelector.selectDataset', { defaultMessage: 'Select dataset' } ); -export const integrationsLabel = i18n.translate( - 'xpack.discoverLogExplorer.datasetSelector.integrations', - { defaultMessage: 'Integrations' } -); +export const integrationsLabel = i18n.translate('xpack.logExplorer.datasetSelector.integrations', { + defaultMessage: 'Integrations', +}); export const uncategorizedLabel = i18n.translate( - 'xpack.discoverLogExplorer.datasetSelector.uncategorized', + 'xpack.logExplorer.datasetSelector.uncategorized', { defaultMessage: 'Uncategorized' } ); -export const sortOrdersLabel = i18n.translate( - 'xpack.discoverLogExplorer.datasetSelector.sortOrders', - { defaultMessage: 'Sort directions' } -); +export const sortOrdersLabel = i18n.translate('xpack.logExplorer.datasetSelector.sortOrders', { + defaultMessage: 'Sort directions', +}); -export const noDatasetsLabel = i18n.translate( - 'xpack.discoverLogExplorer.datasetSelector.noDatasets', - { defaultMessage: 'No data streams found' } -); +export const noDatasetsLabel = i18n.translate('xpack.logExplorer.datasetSelector.noDatasets', { + defaultMessage: 'No data streams found', +}); export const noDatasetsDescriptionLabel = i18n.translate( - 'xpack.discoverLogExplorer.datasetSelector.noDatasetsDescription', + 'xpack.logExplorer.datasetSelector.noDatasetsDescription', { defaultMessage: 'No datasets or search results found.', } ); export const noIntegrationsLabel = i18n.translate( - 'xpack.discoverLogExplorer.datasetSelector.noIntegrations', + 'xpack.logExplorer.datasetSelector.noIntegrations', { defaultMessage: 'No integrations found' } ); export const noIntegrationsDescriptionLabel = i18n.translate( - 'xpack.discoverLogExplorer.datasetSelector.noIntegrationsDescription', + 'xpack.logExplorer.datasetSelector.noIntegrationsDescription', { defaultMessage: 'No integrations or search results found.', } ); -export const errorLabel = i18n.translate('xpack.discoverLogExplorer.datasetSelector.error', { +export const errorLabel = i18n.translate('xpack.logExplorer.datasetSelector.error', { defaultMessage: 'error', }); -export const noDataRetryLabel = i18n.translate( - 'xpack.discoverLogExplorer.datasetSelector.noDataRetry', - { - defaultMessage: 'Retry', - } -); +export const noDataRetryLabel = i18n.translate('xpack.logExplorer.datasetSelector.noDataRetry', { + defaultMessage: 'Retry', +}); export const sortOptions = [ { diff --git a/x-pack/plugins/log_explorer/public/components/dataset_selector/dataset_selector.stories.tsx b/x-pack/plugins/log_explorer/public/components/dataset_selector/dataset_selector.stories.tsx index d96cdc07bd9bc..c1549bc899ab4 100644 --- a/x-pack/plugins/log_explorer/public/components/dataset_selector/dataset_selector.stories.tsx +++ b/x-pack/plugins/log_explorer/public/components/dataset_selector/dataset_selector.stories.tsx @@ -22,7 +22,7 @@ import { const meta: Meta = { component: DatasetSelector, - title: 'discover_log_explorer/DatasetSelector', + title: 'log_explorer/DatasetSelector', decorators: [(wrappedStory) => {wrappedStory()}], argTypes: { datasetsError: { diff --git a/x-pack/plugins/log_explorer/public/components/dataset_selector/sub_components/datasets_list.tsx b/x-pack/plugins/log_explorer/public/components/dataset_selector/sub_components/datasets_list.tsx index 134bd7616ac8a..8664a428c9c3f 100644 --- a/x-pack/plugins/log_explorer/public/components/dataset_selector/sub_components/datasets_list.tsx +++ b/x-pack/plugins/log_explorer/public/components/dataset_selector/sub_components/datasets_list.tsx @@ -52,7 +52,7 @@ export const DatasetsList = ({ titleSize="s" body={ () => toasts.addWarning({ title: i18n.translate( - 'xpack.discoverLogExplorer.datasetSelection.restoreDatasetSelectionFailedToastTitle', + 'xpack.logExplorer.datasetSelection.restoreDatasetSelectionFailedToastTitle', { defaultMessage: "We couldn't restore your datasets selection." } ), text: i18n.translate( - 'xpack.discoverLogExplorer.datasetSelection.restoreDatasetSelectionFailedToastMessage', + 'xpack.logExplorer.datasetSelection.restoreDatasetSelectionFailedToastMessage', { defaultMessage: 'We switched to "All log datasets" as the default selection.' } ), }); export const createCreateDataViewFailedNotifier = (toasts: IToasts) => () => toasts.addWarning({ - title: i18n.translate( - 'xpack.discoverLogExplorer.datasetSelection.createDataViewFailedToastTitle', - { defaultMessage: "We couldn't create a data view for your selection." } - ), - text: i18n.translate( - 'xpack.discoverLogExplorer.datasetSelection.createDataViewFailedToastMessage', - { defaultMessage: 'We switched to "All log datasets" as the default selection.' } - ), + title: i18n.translate('xpack.logExplorer.datasetSelection.createDataViewFailedToastTitle', { + defaultMessage: "We couldn't create a data view for your selection.", + }), + text: i18n.translate('xpack.logExplorer.datasetSelection.createDataViewFailedToastMessage', { + defaultMessage: 'We switched to "All log datasets" as the default selection.', + }), }); diff --git a/x-pack/plugins/log_explorer/server/index.ts b/x-pack/plugins/log_explorer/server/index.ts index 091fe7bb47e47..d597de7dd71bc 100644 --- a/x-pack/plugins/log_explorer/server/index.ts +++ b/x-pack/plugins/log_explorer/server/index.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { DiscoverLogExplorerServerPlugin } from './plugin'; +import { LogExplorerServerPlugin } from './plugin'; export { config } from './config'; -export const plugin = () => new DiscoverLogExplorerServerPlugin(); +export const plugin = () => new LogExplorerServerPlugin(); diff --git a/x-pack/plugins/log_explorer/server/plugin.ts b/x-pack/plugins/log_explorer/server/plugin.ts index a1e971fc2b502..140d32a564ca4 100644 --- a/x-pack/plugins/log_explorer/server/plugin.ts +++ b/x-pack/plugins/log_explorer/server/plugin.ts @@ -7,7 +7,7 @@ import { Plugin } from '@kbn/core/server'; -export class DiscoverLogExplorerServerPlugin implements Plugin { +export class LogExplorerServerPlugin implements Plugin { setup() {} start() {} diff --git a/x-pack/test/functional/apps/discover_log_explorer/columns_selection.ts b/x-pack/test/functional/apps/observability_log_explorer/columns_selection.ts similarity index 77% rename from x-pack/test/functional/apps/discover_log_explorer/columns_selection.ts rename to x-pack/test/functional/apps/observability_log_explorer/columns_selection.ts index c1a9aee81758a..61aca6f8723a4 100644 --- a/x-pack/test/functional/apps/discover_log_explorer/columns_selection.ts +++ b/x-pack/test/functional/apps/observability_log_explorer/columns_selection.ts @@ -17,19 +17,19 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('Columns selection initialization and update', () => { before(async () => { await esArchiver.load( - 'x-pack/test/functional/es_archives/discover_log_explorer/data_streams' + 'x-pack/test/functional/es_archives/observability_log_explorer/data_streams' ); }); after(async () => { await esArchiver.unload( - 'x-pack/test/functional/es_archives/discover_log_explorer/data_streams' + 'x-pack/test/functional/es_archives/observability_log_explorer/data_streams' ); }); - describe('when the log explorer profile loads', () => { + describe('when the log explorer loads', () => { it("should initialize the table columns to logs' default selection", async () => { - await PageObjects.common.navigateToApp('discover', { hash: '/p/log-explorer' }); + await PageObjects.common.navigateToApp('observabilityLogExplorer'); await PageObjects.discover.expandTimeRangeAsSuggestedInNoResultsMessage(); @@ -39,8 +39,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should restore the table columns from the URL state if exists', async () => { - await PageObjects.common.navigateToApp('discover', { - hash: '/p/log-explorer?_a=(columns:!(message,data_stream.namespace))', + await PageObjects.common.navigateToApp('observabilityLogExplorer', { + hash: '?_a=(columns:!(message,data_stream.namespace))', }); await PageObjects.discover.expandTimeRangeAsSuggestedInNoResultsMessage(); diff --git a/x-pack/test/functional/apps/discover_log_explorer/config.ts b/x-pack/test/functional/apps/observability_log_explorer/config.ts similarity index 100% rename from x-pack/test/functional/apps/discover_log_explorer/config.ts rename to x-pack/test/functional/apps/observability_log_explorer/config.ts diff --git a/x-pack/test/functional/apps/discover_log_explorer/customization.ts b/x-pack/test/functional/apps/observability_log_explorer/customization.ts similarity index 100% rename from x-pack/test/functional/apps/discover_log_explorer/customization.ts rename to x-pack/test/functional/apps/observability_log_explorer/customization.ts diff --git a/x-pack/test/functional/apps/discover_log_explorer/dataset_selection_state.ts b/x-pack/test/functional/apps/observability_log_explorer/dataset_selection_state.ts similarity index 82% rename from x-pack/test/functional/apps/discover_log_explorer/dataset_selection_state.ts rename to x-pack/test/functional/apps/observability_log_explorer/dataset_selection_state.ts index c1c2b335358bc..bf6e899ed269d 100644 --- a/x-pack/test/functional/apps/discover_log_explorer/dataset_selection_state.ts +++ b/x-pack/test/functional/apps/observability_log_explorer/dataset_selection_state.ts @@ -10,14 +10,14 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { const browser = getService('browser'); const retry = getService('retry'); - const PageObjects = getPageObjects(['common', 'discoverLogExplorer']); + const PageObjects = getPageObjects(['common', 'observabilityLogExplorer']); describe('DatasetSelection initialization and update', () => { describe('when the "index" query param does not exist', () => { it('should initialize the "All log datasets" selection', async () => { await PageObjects.common.navigateToApp('discover', { hash: '/p/log-explorer' }); const datasetSelectionTitle = - await PageObjects.discoverLogExplorer.getDatasetSelectorButtonText(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorButtonText(); expect(datasetSelectionTitle).to.be('All log datasets'); }); @@ -32,7 +32,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); const datasetSelectionTitle = - await PageObjects.discoverLogExplorer.getDatasetSelectorButtonText(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorButtonText(); expect(datasetSelectionTitle).to.be('[Azure Logs] activitylogs'); }); @@ -44,9 +44,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); const datasetSelectionTitle = - await PageObjects.discoverLogExplorer.getDatasetSelectorButtonText(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorButtonText(); - await PageObjects.discoverLogExplorer.assertRestoreFailureToastExist(); + await PageObjects.observabilityLogExplorer.assertRestoreFailureToastExist(); expect(datasetSelectionTitle).to.be('All log datasets'); }); }); @@ -55,7 +55,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should decode and restore the selection for the current index', async () => { await PageObjects.common.navigateToApp('discover', { hash: '/p/log-explorer' }); const allDatasetSelectionTitle = - await PageObjects.discoverLogExplorer.getDatasetSelectorButtonText(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorButtonText(); expect(allDatasetSelectionTitle).to.be('All log datasets'); const azureActivitylogsIndex = @@ -66,14 +66,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { )})&controlPanels=()`, }); const azureDatasetSelectionTitle = - await PageObjects.discoverLogExplorer.getDatasetSelectorButtonText(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorButtonText(); expect(azureDatasetSelectionTitle).to.be('[Azure Logs] activitylogs'); // Go back to previous page selection await retry.try(async () => { await browser.goBack(); const backNavigationDatasetSelectionTitle = - await PageObjects.discoverLogExplorer.getDatasetSelectorButtonText(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorButtonText(); expect(backNavigationDatasetSelectionTitle).to.be('All log datasets'); }); @@ -81,7 +81,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await retry.try(async () => { await browser.goForward(); const forwardNavigationDatasetSelectionTitle = - await PageObjects.discoverLogExplorer.getDatasetSelectorButtonText(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorButtonText(); expect(forwardNavigationDatasetSelectionTitle).to.be('[Azure Logs] activitylogs'); }); }); diff --git a/x-pack/test/functional/apps/discover_log_explorer/dataset_selector.ts b/x-pack/test/functional/apps/observability_log_explorer/dataset_selector.ts similarity index 63% rename from x-pack/test/functional/apps/discover_log_explorer/dataset_selector.ts rename to x-pack/test/functional/apps/observability_log_explorer/dataset_selector.ts index b456da8bddb2a..96c218a6faaec 100644 --- a/x-pack/test/functional/apps/discover_log_explorer/dataset_selector.ts +++ b/x-pack/test/functional/apps/observability_log_explorer/dataset_selector.ts @@ -20,11 +20,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const browser = getService('browser'); const esArchiver = getService('esArchiver'); const retry = getService('retry'); - const PageObjects = getPageObjects(['common', 'discoverLogExplorer']); + const PageObjects = getPageObjects(['common', 'observabilityLogExplorer']); describe('Dataset Selector', () => { before(async () => { - await PageObjects.discoverLogExplorer.removeInstalledPackages(); + await PageObjects.observabilityLogExplorer.removeInstalledPackages(); }); describe('without installed integrations or uncategorized data streams', () => { @@ -34,14 +34,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { beforeEach(async () => { await browser.refresh(); - await PageObjects.discoverLogExplorer.openDatasetSelector(); + await PageObjects.observabilityLogExplorer.openDatasetSelector(); }); describe('when open on the first navigation level', () => { it('should always display the "All log datasets" entry as the first item', async () => { const allLogDatasetButton = - await PageObjects.discoverLogExplorer.getAllLogDatasetsButton(); - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + await PageObjects.observabilityLogExplorer.getAllLogDatasetsButton(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); const allLogDatasetTitle = await allLogDatasetButton.getVisibleText(); const firstEntryTitle = await menuEntries[0].getVisibleText(); @@ -52,8 +52,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should always display the unmanaged datasets entry as the second item', async () => { const unamanagedDatasetButton = - await PageObjects.discoverLogExplorer.getUnmanagedDatasetsButton(); - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + await PageObjects.observabilityLogExplorer.getUnmanagedDatasetsButton(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); const unmanagedDatasetTitle = await unamanagedDatasetButton.getVisibleText(); const secondEntryTitle = await menuEntries[1].getVisibleText(); @@ -66,15 +66,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // Skip the test in case network condition utils are not available try { await retry.try(async () => { - await PageObjects.discoverLogExplorer.assertNoIntegrationsPromptExists(); + await PageObjects.observabilityLogExplorer.assertNoIntegrationsPromptExists(); }); await PageObjects.common.sleep(5000); await browser.setNetworkConditions('OFFLINE'); - await PageObjects.discoverLogExplorer.typeSearchFieldWith('a'); + await PageObjects.observabilityLogExplorer.typeSearchFieldWith('a'); await retry.try(async () => { - await PageObjects.discoverLogExplorer.assertNoIntegrationsErrorExists(); + await PageObjects.observabilityLogExplorer.assertNoIntegrationsErrorExists(); }); await browser.restoreNetworkConditions(); @@ -84,10 +84,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should display an empty prompt for no integrations', async () => { - const { integrations } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { integrations } = await PageObjects.observabilityLogExplorer.getIntegrations(); expect(integrations.length).to.be(0); - await PageObjects.discoverLogExplorer.assertNoIntegrationsPromptExists(); + await PageObjects.observabilityLogExplorer.assertNoIntegrationsPromptExists(); }); }); @@ -97,10 +97,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { try { await browser.setNetworkConditions('SLOW_3G'); // Almost stuck network conditions const unamanagedDatasetButton = - await PageObjects.discoverLogExplorer.getUnmanagedDatasetsButton(); + await PageObjects.observabilityLogExplorer.getUnmanagedDatasetsButton(); await unamanagedDatasetButton.click(); - await PageObjects.discoverLogExplorer.assertLoadingSkeletonExists(); + await PageObjects.observabilityLogExplorer.assertLoadingSkeletonExists(); await browser.restoreNetworkConditions(); } catch (error) { @@ -112,18 +112,18 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // Skip the test in case network condition utils are not available try { const unamanagedDatasetButton = - await PageObjects.discoverLogExplorer.getUnmanagedDatasetsButton(); + await PageObjects.observabilityLogExplorer.getUnmanagedDatasetsButton(); await unamanagedDatasetButton.click(); await retry.try(async () => { - await PageObjects.discoverLogExplorer.assertNoDataStreamsPromptExists(); + await PageObjects.observabilityLogExplorer.assertNoDataStreamsPromptExists(); }); await browser.setNetworkConditions('OFFLINE'); - await PageObjects.discoverLogExplorer.typeSearchFieldWith('a'); + await PageObjects.observabilityLogExplorer.typeSearchFieldWith('a'); await retry.try(async () => { - await PageObjects.discoverLogExplorer.assertNoDataStreamsErrorExists(); + await PageObjects.observabilityLogExplorer.assertNoDataStreamsErrorExists(); }); await browser.restoreNetworkConditions(); @@ -134,15 +134,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should display an empty prompt for no data streams', async () => { const unamanagedDatasetButton = - await PageObjects.discoverLogExplorer.getUnmanagedDatasetsButton(); + await PageObjects.observabilityLogExplorer.getUnmanagedDatasetsButton(); await unamanagedDatasetButton.click(); const unamanagedDatasetEntries = - await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(unamanagedDatasetEntries.length).to.be(0); - await PageObjects.discoverLogExplorer.assertNoDataStreamsPromptExists(); + await PageObjects.observabilityLogExplorer.assertNoDataStreamsPromptExists(); }); }); }); @@ -152,14 +152,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { before(async () => { await esArchiver.load( - 'x-pack/test/functional/es_archives/discover_log_explorer/data_streams' + 'x-pack/test/functional/es_archives/observability_log_explorer/data_streams' ); - cleanupIntegrationsSetup = await PageObjects.discoverLogExplorer.setupInitialIntegrations(); + cleanupIntegrationsSetup = + await PageObjects.observabilityLogExplorer.setupInitialIntegrations(); }); after(async () => { await esArchiver.unload( - 'x-pack/test/functional/es_archives/discover_log_explorer/data_streams' + 'x-pack/test/functional/es_archives/observability_log_explorer/data_streams' ); await cleanupIntegrationsSetup(); }); @@ -171,13 +172,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { beforeEach(async () => { await browser.refresh(); - await PageObjects.discoverLogExplorer.openDatasetSelector(); + await PageObjects.observabilityLogExplorer.openDatasetSelector(); }); it('should always display the "All log datasets" entry as the first item', async () => { const allLogDatasetButton = - await PageObjects.discoverLogExplorer.getAllLogDatasetsButton(); - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + await PageObjects.observabilityLogExplorer.getAllLogDatasetsButton(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); const allLogDatasetTitle = await allLogDatasetButton.getVisibleText(); const firstEntryTitle = await menuEntries[0].getVisibleText(); @@ -188,8 +189,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should always display the unmanaged datasets entry as the second item', async () => { const unamanagedDatasetButton = - await PageObjects.discoverLogExplorer.getUnmanagedDatasetsButton(); - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + await PageObjects.observabilityLogExplorer.getUnmanagedDatasetsButton(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); const unmanagedDatasetTitle = await unamanagedDatasetButton.getVisibleText(); const secondEntryTitle = await menuEntries[1].getVisibleText(); @@ -199,7 +200,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should display a list of installed integrations', async () => { - const { integrations } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { integrations } = await PageObjects.observabilityLogExplorer.getIntegrations(); expect(integrations.length).to.be(3); expect(integrations).to.eql(initialPackagesTexts); @@ -207,82 +208,82 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should sort the integrations list by the clicked sorting option', async () => { // Test ascending order - await PageObjects.discoverLogExplorer.clickSortButtonBy('asc'); + await PageObjects.observabilityLogExplorer.clickSortButtonBy('asc'); await retry.try(async () => { - const { integrations } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { integrations } = await PageObjects.observabilityLogExplorer.getIntegrations(); expect(integrations).to.eql(initialPackagesTexts); }); // Test descending order - await PageObjects.discoverLogExplorer.clickSortButtonBy('desc'); + await PageObjects.observabilityLogExplorer.clickSortButtonBy('desc'); await retry.try(async () => { - const { integrations } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { integrations } = await PageObjects.observabilityLogExplorer.getIntegrations(); expect(integrations).to.eql(initialPackagesTexts.slice().reverse()); }); // Test back ascending order - await PageObjects.discoverLogExplorer.clickSortButtonBy('asc'); + await PageObjects.observabilityLogExplorer.clickSortButtonBy('asc'); await retry.try(async () => { - const { integrations } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { integrations } = await PageObjects.observabilityLogExplorer.getIntegrations(); expect(integrations).to.eql(initialPackagesTexts); }); }); it('should filter the integrations list by the typed integration name', async () => { - await PageObjects.discoverLogExplorer.typeSearchFieldWith('system'); + await PageObjects.observabilityLogExplorer.typeSearchFieldWith('system'); await retry.try(async () => { - const { integrations } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { integrations } = await PageObjects.observabilityLogExplorer.getIntegrations(); expect(integrations).to.eql([initialPackageMap.system]); }); - await PageObjects.discoverLogExplorer.typeSearchFieldWith('a'); + await PageObjects.observabilityLogExplorer.typeSearchFieldWith('a'); await retry.try(async () => { - const { integrations } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { integrations } = await PageObjects.observabilityLogExplorer.getIntegrations(); expect(integrations).to.eql([initialPackageMap.apache, initialPackageMap.aws]); }); }); it('should display an empty prompt when the search does not match any result', async () => { - await PageObjects.discoverLogExplorer.typeSearchFieldWith('no result search text'); + await PageObjects.observabilityLogExplorer.typeSearchFieldWith('no result search text'); await retry.try(async () => { - const { integrations } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { integrations } = await PageObjects.observabilityLogExplorer.getIntegrations(); expect(integrations.length).to.be(0); }); - await PageObjects.discoverLogExplorer.assertNoIntegrationsPromptExists(); + await PageObjects.observabilityLogExplorer.assertNoIntegrationsPromptExists(); }); it('should load more integrations by scrolling to the end of the list', async () => { // Install more integrations and reload the page const cleanupAdditionalSetup = - await PageObjects.discoverLogExplorer.setupAdditionalIntegrations(); + await PageObjects.observabilityLogExplorer.setupAdditionalIntegrations(); await browser.refresh(); - await PageObjects.discoverLogExplorer.openDatasetSelector(); + await PageObjects.observabilityLogExplorer.openDatasetSelector(); // Initially fetched integrations await retry.try(async () => { - const { nodes } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { nodes } = await PageObjects.observabilityLogExplorer.getIntegrations(); expect(nodes.length).to.be(15); await nodes.at(-1)?.scrollIntoViewIfNecessary(); }); // Load more integrations await retry.try(async () => { - const { nodes } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { nodes } = await PageObjects.observabilityLogExplorer.getIntegrations(); expect(nodes.length).to.be(20); await nodes.at(-1)?.scrollIntoViewIfNecessary(); }); // No other integrations to load after scrolling to last integration await retry.try(async () => { - const { nodes } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { nodes } = await PageObjects.observabilityLogExplorer.getIntegrations(); expect(nodes.length).to.be(20); }); @@ -297,19 +298,19 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { beforeEach(async () => { await browser.refresh(); - await PageObjects.discoverLogExplorer.openDatasetSelector(); + await PageObjects.observabilityLogExplorer.openDatasetSelector(); }); it('should display a list of available datasets', async () => { await retry.try(async () => { - const { nodes } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { nodes } = await PageObjects.observabilityLogExplorer.getIntegrations(); await nodes[0].click(); }); await retry.try(async () => { const panelTitleNode = - await PageObjects.discoverLogExplorer.getDatasetSelectorContextMenuPanelTitle(); - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorContextMenuPanelTitle(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(await panelTitleNode.getVisibleText()).to.be('Apache HTTP Server'); expect(await menuEntries[0].getVisibleText()).to.be('access'); @@ -319,39 +320,39 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should sort the datasets list by the clicked sorting option', async () => { await retry.try(async () => { - const { nodes } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { nodes } = await PageObjects.observabilityLogExplorer.getIntegrations(); await nodes[0].click(); }); await retry.try(async () => { const panelTitleNode = - await PageObjects.discoverLogExplorer.getDatasetSelectorContextMenuPanelTitle(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorContextMenuPanelTitle(); expect(await panelTitleNode.getVisibleText()).to.be('Apache HTTP Server'); }); // Test ascending order - await PageObjects.discoverLogExplorer.clickSortButtonBy('asc'); + await PageObjects.observabilityLogExplorer.clickSortButtonBy('asc'); await retry.try(async () => { - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(await menuEntries[0].getVisibleText()).to.be('access'); expect(await menuEntries[1].getVisibleText()).to.be('error'); }); // Test descending order - await PageObjects.discoverLogExplorer.clickSortButtonBy('desc'); + await PageObjects.observabilityLogExplorer.clickSortButtonBy('desc'); await retry.try(async () => { - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(await menuEntries[0].getVisibleText()).to.be('error'); expect(await menuEntries[1].getVisibleText()).to.be('access'); }); // Test back ascending order - await PageObjects.discoverLogExplorer.clickSortButtonBy('asc'); + await PageObjects.observabilityLogExplorer.clickSortButtonBy('asc'); await retry.try(async () => { - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(await menuEntries[0].getVisibleText()).to.be('access'); expect(await menuEntries[1].getVisibleText()).to.be('error'); @@ -360,28 +361,28 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should filter the datasets list by the typed dataset name', async () => { await retry.try(async () => { - const { nodes } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { nodes } = await PageObjects.observabilityLogExplorer.getIntegrations(); await nodes[0].click(); }); await retry.try(async () => { const panelTitleNode = - await PageObjects.discoverLogExplorer.getDatasetSelectorContextMenuPanelTitle(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorContextMenuPanelTitle(); expect(await panelTitleNode.getVisibleText()).to.be('Apache HTTP Server'); }); await retry.try(async () => { - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(await menuEntries[0].getVisibleText()).to.be('access'); expect(await menuEntries[1].getVisibleText()).to.be('error'); }); - await PageObjects.discoverLogExplorer.typeSearchFieldWith('err'); + await PageObjects.observabilityLogExplorer.typeSearchFieldWith('err'); await retry.try(async () => { - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(menuEntries.length).to.be(1); expect(await menuEntries[0].getVisibleText()).to.be('error'); @@ -390,26 +391,27 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should update the current selection with the clicked dataset', async () => { await retry.try(async () => { - const { nodes } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { nodes } = await PageObjects.observabilityLogExplorer.getIntegrations(); await nodes[0].click(); }); await retry.try(async () => { const panelTitleNode = - await PageObjects.discoverLogExplorer.getDatasetSelectorContextMenuPanelTitle(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorContextMenuPanelTitle(); expect(await panelTitleNode.getVisibleText()).to.be('Apache HTTP Server'); }); await retry.try(async () => { - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(await menuEntries[0].getVisibleText()).to.be('access'); menuEntries[0].click(); }); await retry.try(async () => { - const selectorButton = await PageObjects.discoverLogExplorer.getDatasetSelectorButton(); + const selectorButton = + await PageObjects.observabilityLogExplorer.getDatasetSelectorButton(); expect(await selectorButton.getVisibleText()).to.be('[Apache HTTP Server] access'); }); @@ -423,17 +425,17 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { beforeEach(async () => { await browser.refresh(); - await PageObjects.discoverLogExplorer.openDatasetSelector(); + await PageObjects.observabilityLogExplorer.openDatasetSelector(); }); it('should display a list of available datasets', async () => { - const button = await PageObjects.discoverLogExplorer.getUnmanagedDatasetsButton(); + const button = await PageObjects.observabilityLogExplorer.getUnmanagedDatasetsButton(); await button.click(); await retry.try(async () => { const panelTitleNode = - await PageObjects.discoverLogExplorer.getDatasetSelectorContextMenuPanelTitle(); - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorContextMenuPanelTitle(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(await panelTitleNode.getVisibleText()).to.be('Uncategorized'); expect(await menuEntries[0].getVisibleText()).to.be(expectedUncategorized[0]); @@ -443,20 +445,20 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should sort the datasets list by the clicked sorting option', async () => { - const button = await PageObjects.discoverLogExplorer.getUnmanagedDatasetsButton(); + const button = await PageObjects.observabilityLogExplorer.getUnmanagedDatasetsButton(); await button.click(); await retry.try(async () => { const panelTitleNode = - await PageObjects.discoverLogExplorer.getDatasetSelectorContextMenuPanelTitle(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorContextMenuPanelTitle(); expect(await panelTitleNode.getVisibleText()).to.be('Uncategorized'); }); // Test ascending order - await PageObjects.discoverLogExplorer.clickSortButtonBy('asc'); + await PageObjects.observabilityLogExplorer.clickSortButtonBy('asc'); await retry.try(async () => { - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(await menuEntries[0].getVisibleText()).to.be(expectedUncategorized[0]); expect(await menuEntries[1].getVisibleText()).to.be(expectedUncategorized[1]); @@ -464,9 +466,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); // Test descending order - await PageObjects.discoverLogExplorer.clickSortButtonBy('desc'); + await PageObjects.observabilityLogExplorer.clickSortButtonBy('desc'); await retry.try(async () => { - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(await menuEntries[0].getVisibleText()).to.be(expectedUncategorized[2]); expect(await menuEntries[1].getVisibleText()).to.be(expectedUncategorized[1]); @@ -474,9 +476,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); // Test back ascending order - await PageObjects.discoverLogExplorer.clickSortButtonBy('asc'); + await PageObjects.observabilityLogExplorer.clickSortButtonBy('asc'); await retry.try(async () => { - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(await menuEntries[0].getVisibleText()).to.be(expectedUncategorized[0]); expect(await menuEntries[1].getVisibleText()).to.be(expectedUncategorized[1]); @@ -485,28 +487,28 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should filter the datasets list by the typed dataset name', async () => { - const button = await PageObjects.discoverLogExplorer.getUnmanagedDatasetsButton(); + const button = await PageObjects.observabilityLogExplorer.getUnmanagedDatasetsButton(); await button.click(); await retry.try(async () => { const panelTitleNode = - await PageObjects.discoverLogExplorer.getDatasetSelectorContextMenuPanelTitle(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorContextMenuPanelTitle(); expect(await panelTitleNode.getVisibleText()).to.be('Uncategorized'); }); await retry.try(async () => { - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(await menuEntries[0].getVisibleText()).to.be(expectedUncategorized[0]); expect(await menuEntries[1].getVisibleText()).to.be(expectedUncategorized[1]); expect(await menuEntries[2].getVisibleText()).to.be(expectedUncategorized[2]); }); - await PageObjects.discoverLogExplorer.typeSearchFieldWith('retail'); + await PageObjects.observabilityLogExplorer.typeSearchFieldWith('retail'); await retry.try(async () => { - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(menuEntries.length).to.be(1); expect(await menuEntries[0].getVisibleText()).to.be('logs-retail-*'); @@ -514,25 +516,26 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should update the current selection with the clicked dataset', async () => { - const button = await PageObjects.discoverLogExplorer.getUnmanagedDatasetsButton(); + const button = await PageObjects.observabilityLogExplorer.getUnmanagedDatasetsButton(); await button.click(); await retry.try(async () => { const panelTitleNode = - await PageObjects.discoverLogExplorer.getDatasetSelectorContextMenuPanelTitle(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorContextMenuPanelTitle(); expect(await panelTitleNode.getVisibleText()).to.be('Uncategorized'); }); await retry.try(async () => { - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(await menuEntries[0].getVisibleText()).to.be('logs-gaming-*'); menuEntries[0].click(); }); await retry.try(async () => { - const selectorButton = await PageObjects.discoverLogExplorer.getDatasetSelectorButton(); + const selectorButton = + await PageObjects.observabilityLogExplorer.getDatasetSelectorButton(); expect(await selectorButton.getVisibleText()).to.be('logs-gaming-*'); }); @@ -546,32 +549,32 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { beforeEach(async () => { await browser.refresh(); - await PageObjects.discoverLogExplorer.openDatasetSelector(); + await PageObjects.observabilityLogExplorer.openDatasetSelector(); }); it('should restore the latest navigation panel', async () => { await retry.try(async () => { - const { nodes } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { nodes } = await PageObjects.observabilityLogExplorer.getIntegrations(); await nodes[0].click(); }); await retry.try(async () => { const panelTitleNode = - await PageObjects.discoverLogExplorer.getDatasetSelectorContextMenuPanelTitle(); - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorContextMenuPanelTitle(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(await panelTitleNode.getVisibleText()).to.be('Apache HTTP Server'); expect(await menuEntries[0].getVisibleText()).to.be('access'); expect(await menuEntries[1].getVisibleText()).to.be('error'); }); - await PageObjects.discoverLogExplorer.closeDatasetSelector(); - await PageObjects.discoverLogExplorer.openDatasetSelector(); + await PageObjects.observabilityLogExplorer.closeDatasetSelector(); + await PageObjects.observabilityLogExplorer.openDatasetSelector(); await retry.try(async () => { const panelTitleNode = - await PageObjects.discoverLogExplorer.getDatasetSelectorContextMenuPanelTitle(); - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorContextMenuPanelTitle(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(await panelTitleNode.getVisibleText()).to.be('Apache HTTP Server'); expect(await menuEntries[0].getVisibleText()).to.be('access'); @@ -580,18 +583,18 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should restore the latest search results', async () => { - await PageObjects.discoverLogExplorer.typeSearchFieldWith('system'); + await PageObjects.observabilityLogExplorer.typeSearchFieldWith('system'); await retry.try(async () => { - const { integrations } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { integrations } = await PageObjects.observabilityLogExplorer.getIntegrations(); expect(integrations).to.eql([initialPackageMap.system]); }); - await PageObjects.discoverLogExplorer.closeDatasetSelector(); - await PageObjects.discoverLogExplorer.openDatasetSelector(); + await PageObjects.observabilityLogExplorer.closeDatasetSelector(); + await PageObjects.observabilityLogExplorer.openDatasetSelector(); await retry.try(async () => { - const { integrations } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { integrations } = await PageObjects.observabilityLogExplorer.getIntegrations(); expect(integrations).to.eql([initialPackageMap.system]); }); }); @@ -603,31 +606,32 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should remember the latest search and restore its results for each integration', async () => { - await PageObjects.discoverLogExplorer.openDatasetSelector(); - await PageObjects.discoverLogExplorer.clearSearchField(); + await PageObjects.observabilityLogExplorer.openDatasetSelector(); + await PageObjects.observabilityLogExplorer.clearSearchField(); - await PageObjects.discoverLogExplorer.typeSearchFieldWith('apache'); + await PageObjects.observabilityLogExplorer.typeSearchFieldWith('apache'); await retry.try(async () => { - const { nodes, integrations } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { nodes, integrations } = + await PageObjects.observabilityLogExplorer.getIntegrations(); expect(integrations).to.eql([initialPackageMap.apache]); nodes[0].click(); }); await retry.try(async () => { const panelTitleNode = - await PageObjects.discoverLogExplorer.getDatasetSelectorContextMenuPanelTitle(); - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorContextMenuPanelTitle(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(await panelTitleNode.getVisibleText()).to.be('Apache HTTP Server'); expect(await menuEntries[0].getVisibleText()).to.be('access'); expect(await menuEntries[1].getVisibleText()).to.be('error'); }); - await PageObjects.discoverLogExplorer.typeSearchFieldWith('err'); + await PageObjects.observabilityLogExplorer.typeSearchFieldWith('err'); await retry.try(async () => { - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(menuEntries.length).to.be(1); expect(await menuEntries[0].getVisibleText()).to.be('error'); @@ -635,23 +639,24 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // Navigate back to integrations const panelTitleNode = - await PageObjects.discoverLogExplorer.getDatasetSelectorContextMenuPanelTitle(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorContextMenuPanelTitle(); panelTitleNode.click(); await retry.try(async () => { - const { nodes, integrations } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { nodes, integrations } = + await PageObjects.observabilityLogExplorer.getIntegrations(); expect(integrations).to.eql([initialPackageMap.apache]); - const searchValue = await PageObjects.discoverLogExplorer.getSearchFieldValue(); + const searchValue = await PageObjects.observabilityLogExplorer.getSearchFieldValue(); expect(searchValue).to.eql('apache'); nodes[0].click(); }); await retry.try(async () => { - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); - const searchValue = await PageObjects.discoverLogExplorer.getSearchFieldValue(); + const searchValue = await PageObjects.observabilityLogExplorer.getSearchFieldValue(); expect(searchValue).to.eql('err'); expect(menuEntries.length).to.be(1); diff --git a/x-pack/test/functional/apps/discover_log_explorer/index.ts b/x-pack/test/functional/apps/observability_log_explorer/index.ts similarity index 91% rename from x-pack/test/functional/apps/discover_log_explorer/index.ts rename to x-pack/test/functional/apps/observability_log_explorer/index.ts index dd8b99db79ad0..3bb90c56da722 100644 --- a/x-pack/test/functional/apps/discover_log_explorer/index.ts +++ b/x-pack/test/functional/apps/observability_log_explorer/index.ts @@ -8,7 +8,7 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ loadTestFile }: FtrProviderContext) { - describe('Discover Log-Explorer profile', function () { + describe('Observability Log Explorer', function () { loadTestFile(require.resolve('./columns_selection')); loadTestFile(require.resolve('./customization')); loadTestFile(require.resolve('./dataset_selection_state')); diff --git a/x-pack/test/functional/config.base.js b/x-pack/test/functional/config.base.js index 36dc0c6d84c3c..5bb94fd5a8897 100644 --- a/x-pack/test/functional/config.base.js +++ b/x-pack/test/functional/config.base.js @@ -168,6 +168,9 @@ export default async function ({ readConfigFile }) { observability: { pathname: '/app/observability', }, + observabilityLogExplorer: { + pathname: '/app/observability-log-explorer', + }, connectors: { pathname: '/app/management/insightsAndAlerting/triggersActionsConnectors/', }, diff --git a/x-pack/test/functional/es_archives/discover_log_explorer/data_streams/data.json.gz b/x-pack/test/functional/es_archives/observability_log_explorer/data_streams/data.json.gz similarity index 100% rename from x-pack/test/functional/es_archives/discover_log_explorer/data_streams/data.json.gz rename to x-pack/test/functional/es_archives/observability_log_explorer/data_streams/data.json.gz diff --git a/x-pack/test/functional/es_archives/discover_log_explorer/data_streams/mappings.json b/x-pack/test/functional/es_archives/observability_log_explorer/data_streams/mappings.json similarity index 100% rename from x-pack/test/functional/es_archives/discover_log_explorer/data_streams/mappings.json rename to x-pack/test/functional/es_archives/observability_log_explorer/data_streams/mappings.json diff --git a/x-pack/test/functional/page_objects/index.ts b/x-pack/test/functional/page_objects/index.ts index dc7d2f9ee9a13..a8ac0895ed255 100644 --- a/x-pack/test/functional/page_objects/index.ts +++ b/x-pack/test/functional/page_objects/index.ts @@ -15,7 +15,6 @@ import { CanvasPageProvider } from './canvas_page'; import { CopySavedObjectsToSpacePageProvider } from './copy_saved_objects_to_space_page'; import { CrossClusterReplicationPageProvider } from './cross_cluster_replication_page'; import { DetectionsPageObject } from '../../security_solution_ftr/page_objects/detections'; -import { DiscoverLogExplorerPageObject } from './discover_log_explorer'; import { GeoFileUploadPageObject } from './geo_file_upload'; import { GisPageObject } from './gis_page'; import { GraphPageObject } from './graph_page'; @@ -34,6 +33,7 @@ import { LogstashPageObject } from './logstash_page'; import { MaintenanceWindowsPageProvider } from './maintenance_windows_page'; import { MonitoringPageObject } from './monitoring_page'; import { NavigationalSearchPageObject } from './navigational_search'; +import { ObservabilityLogExplorerPageObject } from './observability_log_explorer'; import { ObservabilityPageProvider } from './observability_page'; import { RemoteClustersPageProvider } from './remote_clusters_page'; import { ReportingPageObject } from './reporting_page'; @@ -62,7 +62,6 @@ export const pageObjects = { copySavedObjectsToSpace: CopySavedObjectsToSpacePageProvider, crossClusterReplication: CrossClusterReplicationPageProvider, detections: DetectionsPageObject, - discoverLogExplorer: DiscoverLogExplorerPageObject, geoFileUpload: GeoFileUploadPageObject, graph: GraphPageObject, grokDebugger: GrokDebuggerPageObject, @@ -81,6 +80,7 @@ export const pageObjects = { maps: GisPageObject, monitoring: MonitoringPageObject, navigationalSearch: NavigationalSearchPageObject, + observabilityLogExplorer: ObservabilityLogExplorerPageObject, observability: ObservabilityPageProvider, remoteClusters: RemoteClustersPageProvider, reporting: ReportingPageObject, diff --git a/x-pack/test/functional/page_objects/discover_log_explorer.ts b/x-pack/test/functional/page_objects/observability_log_explorer.ts similarity index 99% rename from x-pack/test/functional/page_objects/discover_log_explorer.ts rename to x-pack/test/functional/page_objects/observability_log_explorer.ts index 282a703863dc2..0613c13edf97b 100644 --- a/x-pack/test/functional/page_objects/discover_log_explorer.ts +++ b/x-pack/test/functional/page_objects/observability_log_explorer.ts @@ -98,7 +98,7 @@ const packages: IntegrationPackage[] = [ const initialPackages = packages.slice(0, 3); const additionalPackages = packages.slice(3); -export function DiscoverLogExplorerPageObject({ getService }: FtrProviderContext) { +export function ObservabilityLogExplorerPageObject({ getService }: FtrProviderContext) { const log = getService('log'); const supertest = getService('supertest'); const testSubjects = getService('testSubjects'); diff --git a/x-pack/test_serverless/functional/test_suites/observability/index.ts b/x-pack/test_serverless/functional/test_suites/observability/index.ts index 70e76dbf3955f..5c8fa55da1b25 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/index.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/index.ts @@ -6,13 +6,13 @@ */ import { FtrProviderContext } from '../../ftr_provider_context'; -import loadDiscoverLogExplorerSuite from './discover_log_explorer'; +import loadObservabilityLogExplorerSuite from './observability_log_explorer'; export default function ({ loadTestFile }: FtrProviderContext) { describe('serverless observability UI', function () { loadTestFile(require.resolve('./landing_page')); loadTestFile(require.resolve('./navigation')); - loadDiscoverLogExplorerSuite(loadTestFile); + loadObservabilityLogExplorerSuite(loadTestFile); loadTestFile(require.resolve('./cases/attachment_framework')); }); } diff --git a/x-pack/test_serverless/functional/test_suites/observability/discover_log_explorer/columns_selection.ts b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/columns_selection.ts similarity index 91% rename from x-pack/test_serverless/functional/test_suites/observability/discover_log_explorer/columns_selection.ts rename to x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/columns_selection.ts index dfba8f72a699d..d38b0d847df45 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/discover_log_explorer/columns_selection.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/columns_selection.ts @@ -17,13 +17,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('Columns selection initialization and update', () => { before(async () => { await esArchiver.load( - 'x-pack/test/functional/es_archives/discover_log_explorer/data_streams' + 'x-pack/test/functional/es_archives/observability_log_explorer/data_streams' ); }); after(async () => { await esArchiver.unload( - 'x-pack/test/functional/es_archives/discover_log_explorer/data_streams' + 'x-pack/test/functional/es_archives/observability_log_explorer/data_streams' ); }); diff --git a/x-pack/test_serverless/functional/test_suites/observability/discover_log_explorer/customization.ts b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/customization.ts similarity index 100% rename from x-pack/test_serverless/functional/test_suites/observability/discover_log_explorer/customization.ts rename to x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/customization.ts diff --git a/x-pack/test_serverless/functional/test_suites/observability/discover_log_explorer/dataset_selection_state.ts b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selection_state.ts similarity index 82% rename from x-pack/test_serverless/functional/test_suites/observability/discover_log_explorer/dataset_selection_state.ts rename to x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selection_state.ts index 01f5551a94e29..66a2f50b41ae4 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/discover_log_explorer/dataset_selection_state.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selection_state.ts @@ -10,14 +10,14 @@ import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { const browser = getService('browser'); const retry = getService('retry'); - const PageObjects = getPageObjects(['common', 'discoverLogExplorer']); + const PageObjects = getPageObjects(['common', 'observabilityLogExplorer']); describe('DatasetSelection initialization and update', () => { describe('when the "index" query param does not exist', () => { it('should initialize the "All log datasets" selection', async () => { await PageObjects.common.navigateToApp('discover', { hash: '/p/log-explorer' }); const datasetSelectionTitle = - await PageObjects.discoverLogExplorer.getDatasetSelectorButtonText(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorButtonText(); expect(datasetSelectionTitle).to.be('All log datasets'); }); @@ -32,7 +32,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); const datasetSelectionTitle = - await PageObjects.discoverLogExplorer.getDatasetSelectorButtonText(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorButtonText(); expect(datasetSelectionTitle).to.be('[Azure Logs] activitylogs'); }); @@ -44,9 +44,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); const datasetSelectionTitle = - await PageObjects.discoverLogExplorer.getDatasetSelectorButtonText(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorButtonText(); - await PageObjects.discoverLogExplorer.assertRestoreFailureToastExist(); + await PageObjects.observabilityLogExplorer.assertRestoreFailureToastExist(); expect(datasetSelectionTitle).to.be('All log datasets'); }); }); @@ -55,7 +55,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should decode and restore the selection for the current index', async () => { await PageObjects.common.navigateToApp('discover', { hash: '/p/log-explorer' }); const allDatasetSelectionTitle = - await PageObjects.discoverLogExplorer.getDatasetSelectorButtonText(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorButtonText(); expect(allDatasetSelectionTitle).to.be('All log datasets'); const azureActivitylogsIndex = @@ -66,14 +66,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { )})&controlPanels=()`, }); const azureDatasetSelectionTitle = - await PageObjects.discoverLogExplorer.getDatasetSelectorButtonText(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorButtonText(); expect(azureDatasetSelectionTitle).to.be('[Azure Logs] activitylogs'); // Go back to previous page selection await retry.try(async () => { await browser.goBack(); const backNavigationDatasetSelectionTitle = - await PageObjects.discoverLogExplorer.getDatasetSelectorButtonText(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorButtonText(); expect(backNavigationDatasetSelectionTitle).to.be('All log datasets'); }); @@ -81,7 +81,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await retry.try(async () => { await browser.goForward(); const forwardNavigationDatasetSelectionTitle = - await PageObjects.discoverLogExplorer.getDatasetSelectorButtonText(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorButtonText(); expect(forwardNavigationDatasetSelectionTitle).to.be('[Azure Logs] activitylogs'); }); }); diff --git a/x-pack/test_serverless/functional/test_suites/observability/discover_log_explorer/dataset_selector.ts b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selector.ts similarity index 63% rename from x-pack/test_serverless/functional/test_suites/observability/discover_log_explorer/dataset_selector.ts rename to x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selector.ts index cbb3ea9d95de5..79251545a5d6d 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/discover_log_explorer/dataset_selector.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selector.ts @@ -20,11 +20,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const browser = getService('browser'); const esArchiver = getService('esArchiver'); const retry = getService('retry'); - const PageObjects = getPageObjects(['common', 'discoverLogExplorer']); + const PageObjects = getPageObjects(['common', 'observabilityLogExplorer']); describe('Dataset Selector', () => { before(async () => { - await PageObjects.discoverLogExplorer.removeInstalledPackages(); + await PageObjects.observabilityLogExplorer.removeInstalledPackages(); }); describe('without installed integrations or uncategorized data streams', () => { @@ -34,14 +34,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { beforeEach(async () => { await browser.refresh(); - await PageObjects.discoverLogExplorer.openDatasetSelector(); + await PageObjects.observabilityLogExplorer.openDatasetSelector(); }); describe('when open on the first navigation level', () => { it('should always display the "All log datasets" entry as the first item', async () => { const allLogDatasetButton = - await PageObjects.discoverLogExplorer.getAllLogDatasetsButton(); - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + await PageObjects.observabilityLogExplorer.getAllLogDatasetsButton(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); const allLogDatasetTitle = await allLogDatasetButton.getVisibleText(); const firstEntryTitle = await menuEntries[0].getVisibleText(); @@ -52,8 +52,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should always display the unmanaged datasets entry as the second item', async () => { const unamanagedDatasetButton = - await PageObjects.discoverLogExplorer.getUnmanagedDatasetsButton(); - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + await PageObjects.observabilityLogExplorer.getUnmanagedDatasetsButton(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); const unmanagedDatasetTitle = await unamanagedDatasetButton.getVisibleText(); const secondEntryTitle = await menuEntries[1].getVisibleText(); @@ -66,15 +66,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // Skip the test in case network condition utils are not available try { await retry.try(async () => { - await PageObjects.discoverLogExplorer.assertNoIntegrationsPromptExists(); + await PageObjects.observabilityLogExplorer.assertNoIntegrationsPromptExists(); }); await PageObjects.common.sleep(5000); await browser.setNetworkConditions('OFFLINE'); - await PageObjects.discoverLogExplorer.typeSearchFieldWith('a'); + await PageObjects.observabilityLogExplorer.typeSearchFieldWith('a'); await retry.try(async () => { - await PageObjects.discoverLogExplorer.assertNoIntegrationsErrorExists(); + await PageObjects.observabilityLogExplorer.assertNoIntegrationsErrorExists(); }); await browser.restoreNetworkConditions(); @@ -84,10 +84,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should display an empty prompt for no integrations', async () => { - const { integrations } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { integrations } = await PageObjects.observabilityLogExplorer.getIntegrations(); expect(integrations.length).to.be(0); - await PageObjects.discoverLogExplorer.assertNoIntegrationsPromptExists(); + await PageObjects.observabilityLogExplorer.assertNoIntegrationsPromptExists(); }); }); @@ -97,10 +97,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { try { await browser.setNetworkConditions('SLOW_3G'); // Almost stuck network conditions const unamanagedDatasetButton = - await PageObjects.discoverLogExplorer.getUnmanagedDatasetsButton(); + await PageObjects.observabilityLogExplorer.getUnmanagedDatasetsButton(); await unamanagedDatasetButton.click(); - await PageObjects.discoverLogExplorer.assertLoadingSkeletonExists(); + await PageObjects.observabilityLogExplorer.assertLoadingSkeletonExists(); await browser.restoreNetworkConditions(); } catch (error) { @@ -112,18 +112,18 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // Skip the test in case network condition utils are not available try { const unamanagedDatasetButton = - await PageObjects.discoverLogExplorer.getUnmanagedDatasetsButton(); + await PageObjects.observabilityLogExplorer.getUnmanagedDatasetsButton(); await unamanagedDatasetButton.click(); await retry.try(async () => { - await PageObjects.discoverLogExplorer.assertNoDataStreamsPromptExists(); + await PageObjects.observabilityLogExplorer.assertNoDataStreamsPromptExists(); }); await browser.setNetworkConditions('OFFLINE'); - await PageObjects.discoverLogExplorer.typeSearchFieldWith('a'); + await PageObjects.observabilityLogExplorer.typeSearchFieldWith('a'); await retry.try(async () => { - await PageObjects.discoverLogExplorer.assertNoDataStreamsErrorExists(); + await PageObjects.observabilityLogExplorer.assertNoDataStreamsErrorExists(); }); await browser.restoreNetworkConditions(); @@ -134,15 +134,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should display an empty prompt for no data streams', async () => { const unamanagedDatasetButton = - await PageObjects.discoverLogExplorer.getUnmanagedDatasetsButton(); + await PageObjects.observabilityLogExplorer.getUnmanagedDatasetsButton(); await unamanagedDatasetButton.click(); const unamanagedDatasetEntries = - await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(unamanagedDatasetEntries.length).to.be(0); - await PageObjects.discoverLogExplorer.assertNoDataStreamsPromptExists(); + await PageObjects.observabilityLogExplorer.assertNoDataStreamsPromptExists(); }); }); }); @@ -152,14 +152,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { before(async () => { await esArchiver.load( - 'x-pack/test/functional/es_archives/discover_log_explorer/data_streams' + 'x-pack/test/functional/es_archives/observability_log_explorer/data_streams' ); - cleanupIntegrationsSetup = await PageObjects.discoverLogExplorer.setupInitialIntegrations(); + cleanupIntegrationsSetup = + await PageObjects.observabilityLogExplorer.setupInitialIntegrations(); }); after(async () => { await esArchiver.unload( - 'x-pack/test/functional/es_archives/discover_log_explorer/data_streams' + 'x-pack/test/functional/es_archives/observability_log_explorer/data_streams' ); await cleanupIntegrationsSetup(); }); @@ -171,13 +172,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { beforeEach(async () => { await browser.refresh(); - await PageObjects.discoverLogExplorer.openDatasetSelector(); + await PageObjects.observabilityLogExplorer.openDatasetSelector(); }); it('should always display the "All log datasets" entry as the first item', async () => { const allLogDatasetButton = - await PageObjects.discoverLogExplorer.getAllLogDatasetsButton(); - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + await PageObjects.observabilityLogExplorer.getAllLogDatasetsButton(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); const allLogDatasetTitle = await allLogDatasetButton.getVisibleText(); const firstEntryTitle = await menuEntries[0].getVisibleText(); @@ -188,8 +189,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should always display the unmanaged datasets entry as the second item', async () => { const unamanagedDatasetButton = - await PageObjects.discoverLogExplorer.getUnmanagedDatasetsButton(); - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + await PageObjects.observabilityLogExplorer.getUnmanagedDatasetsButton(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); const unmanagedDatasetTitle = await unamanagedDatasetButton.getVisibleText(); const secondEntryTitle = await menuEntries[1].getVisibleText(); @@ -199,7 +200,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should display a list of installed integrations', async () => { - const { integrations } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { integrations } = await PageObjects.observabilityLogExplorer.getIntegrations(); expect(integrations.length).to.be(3); expect(integrations).to.eql(initialPackagesTexts); @@ -207,82 +208,82 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should sort the integrations list by the clicked sorting option', async () => { // Test ascending order - await PageObjects.discoverLogExplorer.clickSortButtonBy('asc'); + await PageObjects.observabilityLogExplorer.clickSortButtonBy('asc'); await retry.try(async () => { - const { integrations } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { integrations } = await PageObjects.observabilityLogExplorer.getIntegrations(); expect(integrations).to.eql(initialPackagesTexts); }); // Test descending order - await PageObjects.discoverLogExplorer.clickSortButtonBy('desc'); + await PageObjects.observabilityLogExplorer.clickSortButtonBy('desc'); await retry.try(async () => { - const { integrations } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { integrations } = await PageObjects.observabilityLogExplorer.getIntegrations(); expect(integrations).to.eql(initialPackagesTexts.slice().reverse()); }); // Test back ascending order - await PageObjects.discoverLogExplorer.clickSortButtonBy('asc'); + await PageObjects.observabilityLogExplorer.clickSortButtonBy('asc'); await retry.try(async () => { - const { integrations } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { integrations } = await PageObjects.observabilityLogExplorer.getIntegrations(); expect(integrations).to.eql(initialPackagesTexts); }); }); it('should filter the integrations list by the typed integration name', async () => { - await PageObjects.discoverLogExplorer.typeSearchFieldWith('system'); + await PageObjects.observabilityLogExplorer.typeSearchFieldWith('system'); await retry.try(async () => { - const { integrations } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { integrations } = await PageObjects.observabilityLogExplorer.getIntegrations(); expect(integrations).to.eql([initialPackageMap.system]); }); - await PageObjects.discoverLogExplorer.typeSearchFieldWith('a'); + await PageObjects.observabilityLogExplorer.typeSearchFieldWith('a'); await retry.try(async () => { - const { integrations } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { integrations } = await PageObjects.observabilityLogExplorer.getIntegrations(); expect(integrations).to.eql([initialPackageMap.apache, initialPackageMap.aws]); }); }); it('should display an empty prompt when the search does not match any result', async () => { - await PageObjects.discoverLogExplorer.typeSearchFieldWith('no result search text'); + await PageObjects.observabilityLogExplorer.typeSearchFieldWith('no result search text'); await retry.try(async () => { - const { integrations } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { integrations } = await PageObjects.observabilityLogExplorer.getIntegrations(); expect(integrations.length).to.be(0); }); - await PageObjects.discoverLogExplorer.assertNoIntegrationsPromptExists(); + await PageObjects.observabilityLogExplorer.assertNoIntegrationsPromptExists(); }); it('should load more integrations by scrolling to the end of the list', async () => { // Install more integrations and reload the page const cleanupAdditionalSetup = - await PageObjects.discoverLogExplorer.setupAdditionalIntegrations(); + await PageObjects.observabilityLogExplorer.setupAdditionalIntegrations(); await browser.refresh(); - await PageObjects.discoverLogExplorer.openDatasetSelector(); + await PageObjects.observabilityLogExplorer.openDatasetSelector(); // Initially fetched integrations await retry.try(async () => { - const { nodes } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { nodes } = await PageObjects.observabilityLogExplorer.getIntegrations(); expect(nodes.length).to.be(15); await nodes.at(-1)?.scrollIntoViewIfNecessary(); }); // Load more integrations await retry.try(async () => { - const { nodes } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { nodes } = await PageObjects.observabilityLogExplorer.getIntegrations(); expect(nodes.length).to.be(20); await nodes.at(-1)?.scrollIntoViewIfNecessary(); }); // No other integrations to load after scrolling to last integration await retry.try(async () => { - const { nodes } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { nodes } = await PageObjects.observabilityLogExplorer.getIntegrations(); expect(nodes.length).to.be(20); }); @@ -297,19 +298,19 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { beforeEach(async () => { await browser.refresh(); - await PageObjects.discoverLogExplorer.openDatasetSelector(); + await PageObjects.observabilityLogExplorer.openDatasetSelector(); }); it('should display a list of available datasets', async () => { await retry.try(async () => { - const { nodes } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { nodes } = await PageObjects.observabilityLogExplorer.getIntegrations(); await nodes[0].click(); }); await retry.try(async () => { const panelTitleNode = - await PageObjects.discoverLogExplorer.getDatasetSelectorContextMenuPanelTitle(); - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorContextMenuPanelTitle(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(await panelTitleNode.getVisibleText()).to.be('Apache HTTP Server'); expect(await menuEntries[0].getVisibleText()).to.be('access'); @@ -319,39 +320,39 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should sort the datasets list by the clicked sorting option', async () => { await retry.try(async () => { - const { nodes } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { nodes } = await PageObjects.observabilityLogExplorer.getIntegrations(); await nodes[0].click(); }); await retry.try(async () => { const panelTitleNode = - await PageObjects.discoverLogExplorer.getDatasetSelectorContextMenuPanelTitle(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorContextMenuPanelTitle(); expect(await panelTitleNode.getVisibleText()).to.be('Apache HTTP Server'); }); // Test ascending order - await PageObjects.discoverLogExplorer.clickSortButtonBy('asc'); + await PageObjects.observabilityLogExplorer.clickSortButtonBy('asc'); await retry.try(async () => { - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(await menuEntries[0].getVisibleText()).to.be('access'); expect(await menuEntries[1].getVisibleText()).to.be('error'); }); // Test descending order - await PageObjects.discoverLogExplorer.clickSortButtonBy('desc'); + await PageObjects.observabilityLogExplorer.clickSortButtonBy('desc'); await retry.try(async () => { - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(await menuEntries[0].getVisibleText()).to.be('error'); expect(await menuEntries[1].getVisibleText()).to.be('access'); }); // Test back ascending order - await PageObjects.discoverLogExplorer.clickSortButtonBy('asc'); + await PageObjects.observabilityLogExplorer.clickSortButtonBy('asc'); await retry.try(async () => { - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(await menuEntries[0].getVisibleText()).to.be('access'); expect(await menuEntries[1].getVisibleText()).to.be('error'); @@ -360,28 +361,28 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should filter the datasets list by the typed dataset name', async () => { await retry.try(async () => { - const { nodes } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { nodes } = await PageObjects.observabilityLogExplorer.getIntegrations(); await nodes[0].click(); }); await retry.try(async () => { const panelTitleNode = - await PageObjects.discoverLogExplorer.getDatasetSelectorContextMenuPanelTitle(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorContextMenuPanelTitle(); expect(await panelTitleNode.getVisibleText()).to.be('Apache HTTP Server'); }); await retry.try(async () => { - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(await menuEntries[0].getVisibleText()).to.be('access'); expect(await menuEntries[1].getVisibleText()).to.be('error'); }); - await PageObjects.discoverLogExplorer.typeSearchFieldWith('err'); + await PageObjects.observabilityLogExplorer.typeSearchFieldWith('err'); await retry.try(async () => { - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(menuEntries.length).to.be(1); expect(await menuEntries[0].getVisibleText()).to.be('error'); @@ -390,26 +391,27 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should update the current selection with the clicked dataset', async () => { await retry.try(async () => { - const { nodes } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { nodes } = await PageObjects.observabilityLogExplorer.getIntegrations(); await nodes[0].click(); }); await retry.try(async () => { const panelTitleNode = - await PageObjects.discoverLogExplorer.getDatasetSelectorContextMenuPanelTitle(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorContextMenuPanelTitle(); expect(await panelTitleNode.getVisibleText()).to.be('Apache HTTP Server'); }); await retry.try(async () => { - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(await menuEntries[0].getVisibleText()).to.be('access'); menuEntries[0].click(); }); await retry.try(async () => { - const selectorButton = await PageObjects.discoverLogExplorer.getDatasetSelectorButton(); + const selectorButton = + await PageObjects.observabilityLogExplorer.getDatasetSelectorButton(); expect(await selectorButton.getVisibleText()).to.be('[Apache HTTP Server] access'); }); @@ -423,17 +425,17 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { beforeEach(async () => { await browser.refresh(); - await PageObjects.discoverLogExplorer.openDatasetSelector(); + await PageObjects.observabilityLogExplorer.openDatasetSelector(); }); it('should display a list of available datasets', async () => { - const button = await PageObjects.discoverLogExplorer.getUnmanagedDatasetsButton(); + const button = await PageObjects.observabilityLogExplorer.getUnmanagedDatasetsButton(); await button.click(); await retry.try(async () => { const panelTitleNode = - await PageObjects.discoverLogExplorer.getDatasetSelectorContextMenuPanelTitle(); - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorContextMenuPanelTitle(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(await panelTitleNode.getVisibleText()).to.be('Uncategorized'); expect(await menuEntries[0].getVisibleText()).to.be(expectedUncategorized[0]); @@ -443,20 +445,20 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should sort the datasets list by the clicked sorting option', async () => { - const button = await PageObjects.discoverLogExplorer.getUnmanagedDatasetsButton(); + const button = await PageObjects.observabilityLogExplorer.getUnmanagedDatasetsButton(); await button.click(); await retry.try(async () => { const panelTitleNode = - await PageObjects.discoverLogExplorer.getDatasetSelectorContextMenuPanelTitle(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorContextMenuPanelTitle(); expect(await panelTitleNode.getVisibleText()).to.be('Uncategorized'); }); // Test ascending order - await PageObjects.discoverLogExplorer.clickSortButtonBy('asc'); + await PageObjects.observabilityLogExplorer.clickSortButtonBy('asc'); await retry.try(async () => { - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(await menuEntries[0].getVisibleText()).to.be(expectedUncategorized[0]); expect(await menuEntries[1].getVisibleText()).to.be(expectedUncategorized[1]); @@ -464,9 +466,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); // Test descending order - await PageObjects.discoverLogExplorer.clickSortButtonBy('desc'); + await PageObjects.observabilityLogExplorer.clickSortButtonBy('desc'); await retry.try(async () => { - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(await menuEntries[0].getVisibleText()).to.be(expectedUncategorized[2]); expect(await menuEntries[1].getVisibleText()).to.be(expectedUncategorized[1]); @@ -474,9 +476,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); // Test back ascending order - await PageObjects.discoverLogExplorer.clickSortButtonBy('asc'); + await PageObjects.observabilityLogExplorer.clickSortButtonBy('asc'); await retry.try(async () => { - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(await menuEntries[0].getVisibleText()).to.be(expectedUncategorized[0]); expect(await menuEntries[1].getVisibleText()).to.be(expectedUncategorized[1]); @@ -485,28 +487,28 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should filter the datasets list by the typed dataset name', async () => { - const button = await PageObjects.discoverLogExplorer.getUnmanagedDatasetsButton(); + const button = await PageObjects.observabilityLogExplorer.getUnmanagedDatasetsButton(); await button.click(); await retry.try(async () => { const panelTitleNode = - await PageObjects.discoverLogExplorer.getDatasetSelectorContextMenuPanelTitle(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorContextMenuPanelTitle(); expect(await panelTitleNode.getVisibleText()).to.be('Uncategorized'); }); await retry.try(async () => { - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(await menuEntries[0].getVisibleText()).to.be(expectedUncategorized[0]); expect(await menuEntries[1].getVisibleText()).to.be(expectedUncategorized[1]); expect(await menuEntries[2].getVisibleText()).to.be(expectedUncategorized[2]); }); - await PageObjects.discoverLogExplorer.typeSearchFieldWith('retail'); + await PageObjects.observabilityLogExplorer.typeSearchFieldWith('retail'); await retry.try(async () => { - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(menuEntries.length).to.be(1); expect(await menuEntries[0].getVisibleText()).to.be('logs-retail-*'); @@ -514,25 +516,26 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should update the current selection with the clicked dataset', async () => { - const button = await PageObjects.discoverLogExplorer.getUnmanagedDatasetsButton(); + const button = await PageObjects.observabilityLogExplorer.getUnmanagedDatasetsButton(); await button.click(); await retry.try(async () => { const panelTitleNode = - await PageObjects.discoverLogExplorer.getDatasetSelectorContextMenuPanelTitle(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorContextMenuPanelTitle(); expect(await panelTitleNode.getVisibleText()).to.be('Uncategorized'); }); await retry.try(async () => { - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(await menuEntries[0].getVisibleText()).to.be('logs-gaming-*'); menuEntries[0].click(); }); await retry.try(async () => { - const selectorButton = await PageObjects.discoverLogExplorer.getDatasetSelectorButton(); + const selectorButton = + await PageObjects.observabilityLogExplorer.getDatasetSelectorButton(); expect(await selectorButton.getVisibleText()).to.be('logs-gaming-*'); }); @@ -546,32 +549,32 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { beforeEach(async () => { await browser.refresh(); - await PageObjects.discoverLogExplorer.openDatasetSelector(); + await PageObjects.observabilityLogExplorer.openDatasetSelector(); }); it('should restore the latest navigation panel', async () => { await retry.try(async () => { - const { nodes } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { nodes } = await PageObjects.observabilityLogExplorer.getIntegrations(); await nodes[0].click(); }); await retry.try(async () => { const panelTitleNode = - await PageObjects.discoverLogExplorer.getDatasetSelectorContextMenuPanelTitle(); - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorContextMenuPanelTitle(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(await panelTitleNode.getVisibleText()).to.be('Apache HTTP Server'); expect(await menuEntries[0].getVisibleText()).to.be('access'); expect(await menuEntries[1].getVisibleText()).to.be('error'); }); - await PageObjects.discoverLogExplorer.closeDatasetSelector(); - await PageObjects.discoverLogExplorer.openDatasetSelector(); + await PageObjects.observabilityLogExplorer.closeDatasetSelector(); + await PageObjects.observabilityLogExplorer.openDatasetSelector(); await retry.try(async () => { const panelTitleNode = - await PageObjects.discoverLogExplorer.getDatasetSelectorContextMenuPanelTitle(); - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorContextMenuPanelTitle(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(await panelTitleNode.getVisibleText()).to.be('Apache HTTP Server'); expect(await menuEntries[0].getVisibleText()).to.be('access'); @@ -580,18 +583,18 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should restore the latest search results', async () => { - await PageObjects.discoverLogExplorer.typeSearchFieldWith('system'); + await PageObjects.observabilityLogExplorer.typeSearchFieldWith('system'); await retry.try(async () => { - const { integrations } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { integrations } = await PageObjects.observabilityLogExplorer.getIntegrations(); expect(integrations).to.eql([initialPackageMap.system]); }); - await PageObjects.discoverLogExplorer.closeDatasetSelector(); - await PageObjects.discoverLogExplorer.openDatasetSelector(); + await PageObjects.observabilityLogExplorer.closeDatasetSelector(); + await PageObjects.observabilityLogExplorer.openDatasetSelector(); await retry.try(async () => { - const { integrations } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { integrations } = await PageObjects.observabilityLogExplorer.getIntegrations(); expect(integrations).to.eql([initialPackageMap.system]); }); }); @@ -603,31 +606,32 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should remember the latest search and restore its results for each integration', async () => { - await PageObjects.discoverLogExplorer.openDatasetSelector(); - await PageObjects.discoverLogExplorer.clearSearchField(); + await PageObjects.observabilityLogExplorer.openDatasetSelector(); + await PageObjects.observabilityLogExplorer.clearSearchField(); - await PageObjects.discoverLogExplorer.typeSearchFieldWith('apache'); + await PageObjects.observabilityLogExplorer.typeSearchFieldWith('apache'); await retry.try(async () => { - const { nodes, integrations } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { nodes, integrations } = + await PageObjects.observabilityLogExplorer.getIntegrations(); expect(integrations).to.eql([initialPackageMap.apache]); nodes[0].click(); }); await retry.try(async () => { const panelTitleNode = - await PageObjects.discoverLogExplorer.getDatasetSelectorContextMenuPanelTitle(); - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorContextMenuPanelTitle(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(await panelTitleNode.getVisibleText()).to.be('Apache HTTP Server'); expect(await menuEntries[0].getVisibleText()).to.be('access'); expect(await menuEntries[1].getVisibleText()).to.be('error'); }); - await PageObjects.discoverLogExplorer.typeSearchFieldWith('err'); + await PageObjects.observabilityLogExplorer.typeSearchFieldWith('err'); await retry.try(async () => { - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); expect(menuEntries.length).to.be(1); expect(await menuEntries[0].getVisibleText()).to.be('error'); @@ -635,23 +639,24 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // Navigate back to integrations const panelTitleNode = - await PageObjects.discoverLogExplorer.getDatasetSelectorContextMenuPanelTitle(); + await PageObjects.observabilityLogExplorer.getDatasetSelectorContextMenuPanelTitle(); panelTitleNode.click(); await retry.try(async () => { - const { nodes, integrations } = await PageObjects.discoverLogExplorer.getIntegrations(); + const { nodes, integrations } = + await PageObjects.observabilityLogExplorer.getIntegrations(); expect(integrations).to.eql([initialPackageMap.apache]); - const searchValue = await PageObjects.discoverLogExplorer.getSearchFieldValue(); + const searchValue = await PageObjects.observabilityLogExplorer.getSearchFieldValue(); expect(searchValue).to.eql('apache'); nodes[0].click(); }); await retry.try(async () => { - const menuEntries = await PageObjects.discoverLogExplorer.getCurrentPanelEntries(); + const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries(); - const searchValue = await PageObjects.discoverLogExplorer.getSearchFieldValue(); + const searchValue = await PageObjects.observabilityLogExplorer.getSearchFieldValue(); expect(searchValue).to.eql('err'); expect(menuEntries.length).to.be(1); diff --git a/x-pack/test_serverless/functional/test_suites/observability/discover_log_explorer/index.ts b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/index.ts similarity index 91% rename from x-pack/test_serverless/functional/test_suites/observability/discover_log_explorer/index.ts rename to x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/index.ts index 8e9843fc02815..2d5c13a336395 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/discover_log_explorer/index.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/index.ts @@ -8,7 +8,7 @@ import { FtrProviderContext } from '../../../ftr_provider_context'; export default function (loadTestFile: FtrProviderContext['loadTestFile']) { - describe('Discover Log-Explorer profile', function () { + describe('Observability Log Explorer', function () { loadTestFile(require.resolve('./columns_selection')); loadTestFile(require.resolve('./customization')); loadTestFile(require.resolve('./dataset_selection_state')); From b894bf9d145bd8f10f79526f72a3b341590f73f1 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 24 Aug 2023 17:17:00 +0000 Subject: [PATCH 19/46] [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' --- packages/deeplinks/observability/deep_links.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/deeplinks/observability/deep_links.ts b/packages/deeplinks/observability/deep_links.ts index 00916ced40374..1d405c1a20620 100644 --- a/packages/deeplinks/observability/deep_links.ts +++ b/packages/deeplinks/observability/deep_links.ts @@ -5,7 +5,6 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -import { DISCOVER_APP_ID } from '@kbn/deeplinks-analytics'; import { LOGS_APP_ID, @@ -31,7 +30,6 @@ export type AppId = | ApmApp | MetricsApp; - export type LogsLinkId = 'log-categories' | 'settings' | 'anomalies' | 'stream'; export type ObservabilityOverviewLinkId = From f89e67471e6738994a27c01787758c78ad71fae0 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 24 Aug 2023 17:24:32 +0000 Subject: [PATCH 20/46] [CI] Auto-commit changed files from 'node scripts/lint_ts_projects --fix' --- packages/deeplinks/observability/tsconfig.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/deeplinks/observability/tsconfig.json b/packages/deeplinks/observability/tsconfig.json index 9f5bc24d4f316..94b099694eaf4 100644 --- a/packages/deeplinks/observability/tsconfig.json +++ b/packages/deeplinks/observability/tsconfig.json @@ -16,6 +16,5 @@ "target/**/*" ], "kbn_references": [ - "@kbn/deeplinks-analytics", ] } From 7277e81a7442dbf5172a623711f794bc4371ff0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Fri, 25 Aug 2023 11:36:20 +0000 Subject: [PATCH 21/46] Initialize bundle limits --- packages/kbn-optimizer/limits.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml index 4e89396b29ad9..4d9105df3fe95 100644 --- a/packages/kbn-optimizer/limits.yml +++ b/packages/kbn-optimizer/limits.yml @@ -28,7 +28,7 @@ pageLoadAssetSize: dashboard: 82025 dashboardEnhanced: 65646 data: 454087 - dataViewEditor: 13000 + dataViewEditor: 28082 dataViewFieldEditor: 27000 dataViewManagement: 5000 dataViews: 47000 @@ -98,6 +98,7 @@ pageLoadAssetSize: newsfeed: 42228 observability: 115443 observabilityAIAssistant: 25000 + observabilityLogExplorer: 23686 observabilityOnboarding: 19573 observabilityShared: 52256 osquery: 107090 From 7ac3a3bd3a8668c3c8801ac12f5291baf8e2d28c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Fri, 25 Aug 2023 12:39:43 +0000 Subject: [PATCH 22/46] Fix stateful functional tests --- .../apps/observability_log_explorer/app.ts | 37 ++++++++++ .../columns_selection.ts | 6 +- .../customization.ts | 74 ------------------- .../dataset_selection_state.ts | 18 ++--- .../dataset_selector.ts | 12 +-- .../filter_controls.ts | 28 +++++++ .../apps/observability_log_explorer/index.ts | 3 +- .../observability_log_explorer.ts | 12 ++- 8 files changed, 95 insertions(+), 95 deletions(-) create mode 100644 x-pack/test/functional/apps/observability_log_explorer/app.ts delete mode 100644 x-pack/test/functional/apps/observability_log_explorer/customization.ts create mode 100644 x-pack/test/functional/apps/observability_log_explorer/filter_controls.ts diff --git a/x-pack/test/functional/apps/observability_log_explorer/app.ts b/x-pack/test/functional/apps/observability_log_explorer/app.ts new file mode 100644 index 0000000000000..11c1077188abe --- /dev/null +++ b/x-pack/test/functional/apps/observability_log_explorer/app.ts @@ -0,0 +1,37 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../ftr_provider_context'; + +export default function ({ getService, getPageObjects }: FtrProviderContext) { + const kibanaServer = getService('kibanaServer'); + const PageObjects = getPageObjects(['common', 'navigationalSearch', 'observabilityLogExplorer']); + const testSubjects = getService('testSubjects'); + + describe('Application', () => { + before('initialize tests', async () => { + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); + }); + + after('clean up archives', async () => { + await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); + }); + + it('is shown in the global search', async () => { + await PageObjects.common.navigateToApp('home'); + await PageObjects.navigationalSearch.searchFor('log explorer'); + + const results = await PageObjects.navigationalSearch.getDisplayedResults(); + expect(results[0].label).to.eql('Log Explorer'); + }); + + it('is shown in the observability side navigation', async () => { + await PageObjects.observabilityLogExplorer.navigateTo(); + await testSubjects.existOrFail('observability-nav-observability-log-explorer-explorer'); + }); + }); +} diff --git a/x-pack/test/functional/apps/observability_log_explorer/columns_selection.ts b/x-pack/test/functional/apps/observability_log_explorer/columns_selection.ts index 61aca6f8723a4..d8364278a2aba 100644 --- a/x-pack/test/functional/apps/observability_log_explorer/columns_selection.ts +++ b/x-pack/test/functional/apps/observability_log_explorer/columns_selection.ts @@ -12,7 +12,7 @@ const defaultLogColumns = ['@timestamp', 'message']; export default function ({ getService, getPageObjects }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const retry = getService('retry'); - const PageObjects = getPageObjects(['common', 'discover']); + const PageObjects = getPageObjects(['discover', 'observabilityLogExplorer']); describe('Columns selection initialization and update', () => { before(async () => { @@ -29,7 +29,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('when the log explorer loads', () => { it("should initialize the table columns to logs' default selection", async () => { - await PageObjects.common.navigateToApp('observabilityLogExplorer'); + await PageObjects.observabilityLogExplorer.navigateTo(); await PageObjects.discover.expandTimeRangeAsSuggestedInNoResultsMessage(); @@ -39,7 +39,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should restore the table columns from the URL state if exists', async () => { - await PageObjects.common.navigateToApp('observabilityLogExplorer', { + await PageObjects.observabilityLogExplorer.navigateTo({ hash: '?_a=(columns:!(message,data_stream.namespace))', }); diff --git a/x-pack/test/functional/apps/observability_log_explorer/customization.ts b/x-pack/test/functional/apps/observability_log_explorer/customization.ts deleted file mode 100644 index 6cd713a40f63a..0000000000000 --- a/x-pack/test/functional/apps/observability_log_explorer/customization.ts +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ -import expect from '@kbn/expect'; -import { FtrProviderContext } from '../../ftr_provider_context'; - -export default function ({ getService, getPageObjects }: FtrProviderContext) { - const kibanaServer = getService('kibanaServer'); - const PageObjects = getPageObjects(['common', 'navigationalSearch']); - const testSubjects = getService('testSubjects'); - - describe('Customizations', () => { - before('initialize tests', async () => { - await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); - }); - - after('clean up archives', async () => { - await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); - }); - - describe('when Discover is loaded with the log-explorer profile', () => { - it('DatasetSelector should replace the DataViewPicker', async () => { - // Assert does not render on discover app - await PageObjects.common.navigateToApp('discover'); - await testSubjects.missingOrFail('datasetSelectorPopover'); - - // Assert it renders on log-explorer profile - await PageObjects.common.navigateToApp('discover', { hash: '/p/log-explorer' }); - await testSubjects.existOrFail('datasetSelectorPopover'); - }); - - it('the TopNav bar should hide then New, Open and Save options', async () => { - // Assert does not render on discover app - await PageObjects.common.navigateToApp('discover'); - await testSubjects.existOrFail('discoverNewButton'); - await testSubjects.existOrFail('discoverOpenButton'); - await testSubjects.existOrFail('shareTopNavButton'); - await testSubjects.existOrFail('discoverAlertsButton'); - await testSubjects.existOrFail('openInspectorButton'); - await testSubjects.existOrFail('discoverSaveButton'); - - // Assert it renders on log-explorer profile - await PageObjects.common.navigateToApp('discover', { hash: '/p/log-explorer' }); - await testSubjects.missingOrFail('discoverNewButton'); - await testSubjects.missingOrFail('discoverOpenButton'); - await testSubjects.existOrFail('shareTopNavButton'); - await testSubjects.existOrFail('discoverAlertsButton'); - await testSubjects.existOrFail('openInspectorButton'); - await testSubjects.missingOrFail('discoverSaveButton'); - }); - - it('should add a searchable deep link to the profile page', async () => { - await PageObjects.common.navigateToApp('home'); - await PageObjects.navigationalSearch.searchFor('discover log explorer'); - - const results = await PageObjects.navigationalSearch.getDisplayedResults(); - expect(results[0].label).to.eql('Discover / Logs Explorer'); - }); - - it('should render a filter controls section as part of the unified search bar', async () => { - // Assert does not render on discover app - await PageObjects.common.navigateToApp('discover'); - await testSubjects.missingOrFail('datasetFiltersCustomization'); - - // Assert it renders on log-explorer profile - await PageObjects.common.navigateToApp('discover', { hash: '/p/log-explorer' }); - await testSubjects.existOrFail('datasetFiltersCustomization', { allowHidden: true }); - }); - }); - }); -} diff --git a/x-pack/test/functional/apps/observability_log_explorer/dataset_selection_state.ts b/x-pack/test/functional/apps/observability_log_explorer/dataset_selection_state.ts index bf6e899ed269d..dcd5c2ed29409 100644 --- a/x-pack/test/functional/apps/observability_log_explorer/dataset_selection_state.ts +++ b/x-pack/test/functional/apps/observability_log_explorer/dataset_selection_state.ts @@ -15,7 +15,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('DatasetSelection initialization and update', () => { describe('when the "index" query param does not exist', () => { it('should initialize the "All log datasets" selection', async () => { - await PageObjects.common.navigateToApp('discover', { hash: '/p/log-explorer' }); + await PageObjects.observabilityLogExplorer.navigateTo(); const datasetSelectionTitle = await PageObjects.observabilityLogExplorer.getDatasetSelectorButtonText(); @@ -27,8 +27,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should decode and restore the selection from a valid encoded index', async () => { const azureActivitylogsIndex = 'BQZwpgNmDGAuCWB7AdgLmAEwIay+W6yWAtmKgOQSIDmIAtFgF4CuATmAHRZzwBu8sAJ5VadAFTkANAlhRU3BPyEiQASklFS8lu2kC55AII6wAAgAyNEFN5hWIJGnIBGDgFYOAJgDM5deCgeFAAVQQAHMgdkaihVIA==='; - await PageObjects.common.navigateToApp('discover', { - hash: `/p/log-explorer?_a=(index:${encodeURIComponent(azureActivitylogsIndex)})`, + await PageObjects.observabilityLogExplorer.navigateTo({ + hash: `?_a=(index:${encodeURIComponent(azureActivitylogsIndex)})`, }); const datasetSelectionTitle = @@ -39,8 +39,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should fallback to the "All log datasets" selection and notify the user of an invalid encoded index', async () => { const invalidEncodedIndex = 'invalid-encoded-index'; - await PageObjects.common.navigateToApp('discover', { - hash: `/p/log-explorer?_a=(index:${encodeURIComponent(invalidEncodedIndex)})`, + await PageObjects.observabilityLogExplorer.navigateTo({ + hash: `?_a=(index:${encodeURIComponent(invalidEncodedIndex)})`, }); const datasetSelectionTitle = @@ -53,17 +53,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('when navigating back and forth on the page history', () => { it('should decode and restore the selection for the current index', async () => { - await PageObjects.common.navigateToApp('discover', { hash: '/p/log-explorer' }); + await PageObjects.observabilityLogExplorer.navigateTo(); const allDatasetSelectionTitle = await PageObjects.observabilityLogExplorer.getDatasetSelectorButtonText(); expect(allDatasetSelectionTitle).to.be('All log datasets'); const azureActivitylogsIndex = 'BQZwpgNmDGAuCWB7AdgLmAEwIay+W6yWAtmKgOQSIDmIAtFgF4CuATmAHRZzwBu8sAJ5VadAFTkANAlhRU3BPyEiQASklFS8lu2kC55AII6wAAgAyNEFN5hWIJGnIBGDgFYOAJgDM5deCgeFAAVQQAHMgdkaihVIA==='; - await PageObjects.common.navigateToApp('discover', { - hash: `/p/log-explorer?_a=(index:${encodeURIComponent( - azureActivitylogsIndex - )})&controlPanels=()`, + await PageObjects.observabilityLogExplorer.navigateTo({ + hash: `?_a=(index:${encodeURIComponent(azureActivitylogsIndex)})&controlPanels=()`, }); const azureDatasetSelectionTitle = await PageObjects.observabilityLogExplorer.getDatasetSelectorButtonText(); diff --git a/x-pack/test/functional/apps/observability_log_explorer/dataset_selector.ts b/x-pack/test/functional/apps/observability_log_explorer/dataset_selector.ts index 96c218a6faaec..fed56edd463d8 100644 --- a/x-pack/test/functional/apps/observability_log_explorer/dataset_selector.ts +++ b/x-pack/test/functional/apps/observability_log_explorer/dataset_selector.ts @@ -29,7 +29,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('without installed integrations or uncategorized data streams', () => { before(async () => { - await PageObjects.common.navigateToApp('discover', { hash: '/p/log-explorer' }); + await PageObjects.observabilityLogExplorer.navigateTo(); }); beforeEach(async () => { @@ -167,7 +167,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('when open on the first navigation level', () => { before(async () => { - await PageObjects.common.navigateToApp('discover', { hash: '/p/log-explorer' }); + await PageObjects.observabilityLogExplorer.navigateTo(); }); beforeEach(async () => { @@ -293,7 +293,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('when clicking on integration and moving into the second navigation level', () => { before(async () => { - await PageObjects.common.navigateToApp('discover', { hash: '/p/log-explorer' }); + await PageObjects.observabilityLogExplorer.navigateTo(); }); beforeEach(async () => { @@ -420,7 +420,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('when navigating into Uncategorized data streams', () => { before(async () => { - await PageObjects.common.navigateToApp('discover', { hash: '/p/log-explorer' }); + await PageObjects.observabilityLogExplorer.navigateTo(); }); beforeEach(async () => { @@ -544,7 +544,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('when open/close the selector', () => { before(async () => { - await PageObjects.common.navigateToApp('discover', { hash: '/p/log-explorer' }); + await PageObjects.observabilityLogExplorer.navigateTo(); }); beforeEach(async () => { @@ -602,7 +602,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('when switching between integration panels', () => { before(async () => { - await PageObjects.common.navigateToApp('discover', { hash: '/p/log-explorer' }); + await PageObjects.observabilityLogExplorer.navigateTo(); }); it('should remember the latest search and restore its results for each integration', async () => { diff --git a/x-pack/test/functional/apps/observability_log_explorer/filter_controls.ts b/x-pack/test/functional/apps/observability_log_explorer/filter_controls.ts new file mode 100644 index 0000000000000..db04f6251d9bc --- /dev/null +++ b/x-pack/test/functional/apps/observability_log_explorer/filter_controls.ts @@ -0,0 +1,28 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { FtrProviderContext } from '../../ftr_provider_context'; + +export default function ({ getService, getPageObjects }: FtrProviderContext) { + const kibanaServer = getService('kibanaServer'); + const PageObjects = getPageObjects(['observabilityLogExplorer']); + const testSubjects = getService('testSubjects'); + + describe('Filter controls customization', () => { + before('initialize tests', async () => { + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); + }); + + after('clean up archives', async () => { + await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); + }); + + it('renders a filter controls section as part of the unified search bar', async () => { + await PageObjects.observabilityLogExplorer.navigateTo(); + await testSubjects.existOrFail('datasetFiltersCustomization', { allowHidden: true }); + }); + }); +} diff --git a/x-pack/test/functional/apps/observability_log_explorer/index.ts b/x-pack/test/functional/apps/observability_log_explorer/index.ts index 3bb90c56da722..90a52663e34ce 100644 --- a/x-pack/test/functional/apps/observability_log_explorer/index.ts +++ b/x-pack/test/functional/apps/observability_log_explorer/index.ts @@ -9,9 +9,10 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ loadTestFile }: FtrProviderContext) { describe('Observability Log Explorer', function () { + loadTestFile(require.resolve('./app')); loadTestFile(require.resolve('./columns_selection')); - loadTestFile(require.resolve('./customization')); loadTestFile(require.resolve('./dataset_selection_state')); loadTestFile(require.resolve('./dataset_selector')); + loadTestFile(require.resolve('./filter_controls')); }); } diff --git a/x-pack/test/functional/page_objects/observability_log_explorer.ts b/x-pack/test/functional/page_objects/observability_log_explorer.ts index 0613c13edf97b..7b1e7fcc575a1 100644 --- a/x-pack/test/functional/page_objects/observability_log_explorer.ts +++ b/x-pack/test/functional/page_objects/observability_log_explorer.ts @@ -98,12 +98,18 @@ const packages: IntegrationPackage[] = [ const initialPackages = packages.slice(0, 3); const additionalPackages = packages.slice(3); -export function ObservabilityLogExplorerPageObject({ getService }: FtrProviderContext) { +export function ObservabilityLogExplorerPageObject({ + getPageObjects, + getService, +}: FtrProviderContext) { + const PageObjects = getPageObjects(['common']); const log = getService('log'); const supertest = getService('supertest'); const testSubjects = getService('testSubjects'); const toasts = getService('toasts'); + type NavigateToAppOptions = Parameters[1]; + return { uninstallPackage: ({ name, version }: IntegrationPackage) => { return supertest.delete(`/api/fleet/epm/packages/${name}/${version}`).set('kbn-xsrf', 'xxxx'); @@ -165,6 +171,10 @@ export function ObservabilityLogExplorerPageObject({ getService }: FtrProviderCo }; }, + async navigateTo(options?: NavigateToAppOptions) { + return await PageObjects.common.navigateToApp('observabilityLogExplorer'); + }, + getDatasetSelector() { return testSubjects.find('datasetSelectorPopover'); }, From 9482dcb9c9cf142500f1aabb9f91feb2434cda3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Fri, 25 Aug 2023 12:54:01 +0000 Subject: [PATCH 23/46] Fix serverless function tests --- .../test_suites/observability/index.ts | 3 +- .../test_suites/observability/navigation.ts | 12 ++-- .../observability_log_explorer/app.ts | 32 +++++++++ .../columns_selection.ts | 10 +-- .../customization.ts | 65 ------------------- .../dataset_selection_state.ts | 22 +++---- .../dataset_selector.ts | 12 ++-- .../filter_controls.ts | 28 ++++++++ .../observability_log_explorer/index.ts | 5 +- 9 files changed, 92 insertions(+), 97 deletions(-) create mode 100644 x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/app.ts delete mode 100644 x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/customization.ts create mode 100644 x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/filter_controls.ts diff --git a/x-pack/test_serverless/functional/test_suites/observability/index.ts b/x-pack/test_serverless/functional/test_suites/observability/index.ts index 5c8fa55da1b25..94dc2f4c5593f 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/index.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/index.ts @@ -6,13 +6,12 @@ */ import { FtrProviderContext } from '../../ftr_provider_context'; -import loadObservabilityLogExplorerSuite from './observability_log_explorer'; export default function ({ loadTestFile }: FtrProviderContext) { describe('serverless observability UI', function () { loadTestFile(require.resolve('./landing_page')); loadTestFile(require.resolve('./navigation')); - loadObservabilityLogExplorerSuite(loadTestFile); + loadTestFile(require.resolve('./observability_log_explorer')); loadTestFile(require.resolve('./cases/attachment_framework')); }); } diff --git a/x-pack/test_serverless/functional/test_suites/observability/navigation.ts b/x-pack/test_serverless/functional/test_suites/observability/navigation.ts index eb56af9f88688..7eedcab11969f 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/navigation.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/navigation.ts @@ -35,13 +35,15 @@ export default function ({ getPageObject, getService }: FtrProviderContext) { }); await svlCommonNavigation.sidenav.expectSectionClosed('project_settings_project_nav'); - // navigate to discover - await svlCommonNavigation.sidenav.clickLink({ deepLinkId: 'discover:log-explorer' }); - await svlCommonNavigation.sidenav.expectLinkActive({ deepLinkId: 'discover:log-explorer' }); + // navigate to log explorer + await svlCommonNavigation.sidenav.clickLink({ deepLinkId: 'observabilityLogExplorer' }); + await svlCommonNavigation.sidenav.expectLinkActive({ + deepLinkId: 'observabilityLogExplorer', + }); await svlCommonNavigation.breadcrumbs.expectBreadcrumbExists({ - deepLinkId: 'discover:log-explorer', + deepLinkId: 'observabilityLogExplorer', }); - await expect(await browser.getCurrentUrl()).contain('/app/discover'); + await expect(await browser.getCurrentUrl()).contain('/app/observability-log-explorer'); // check the aiops subsection await svlCommonNavigation.sidenav.clickLink({ navId: 'aiops' }); // open ai ops subsection diff --git a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/app.ts b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/app.ts new file mode 100644 index 0000000000000..4efa47ed271cf --- /dev/null +++ b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/app.ts @@ -0,0 +1,32 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../ftr_provider_context'; + +export default function ({ getService, getPageObjects }: FtrProviderContext) { + const kibanaServer = getService('kibanaServer'); + const PageObjects = getPageObjects(['navigationalSearch', 'svlObltNavigation']); + const testSubjects = getService('testSubjects'); + + describe('Application', () => { + before('initialize tests', async () => { + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); + }); + + after('clean up archives', async () => { + await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); + }); + + it('is shown in the global search', async () => { + await PageObjects.svlObltNavigation.navigateToLandingPage(); + await PageObjects.navigationalSearch.searchFor('log explorer'); + + const results = await PageObjects.navigationalSearch.getDisplayedResults(); + expect(results[0].label).to.eql('Log Explorer'); + }); + }); +} diff --git a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/columns_selection.ts b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/columns_selection.ts index d38b0d847df45..bb9951dd8d489 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/columns_selection.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/columns_selection.ts @@ -12,7 +12,7 @@ const defaultLogColumns = ['@timestamp', 'message']; export default function ({ getService, getPageObjects }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const retry = getService('retry'); - const PageObjects = getPageObjects(['common', 'discover']); + const PageObjects = getPageObjects(['discover', 'observabilityLogExplorer']); describe('Columns selection initialization and update', () => { before(async () => { @@ -27,9 +27,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ); }); - describe('when the log explorer profile loads', () => { + describe('when the log explorer loads', () => { it("should initialize the table columns to logs' default selection", async () => { - await PageObjects.common.navigateToApp('discover', { hash: '/p/log-explorer' }); + await PageObjects.observabilityLogExplorer.navigateTo(); await PageObjects.discover.expandTimeRangeAsSuggestedInNoResultsMessage(); @@ -39,8 +39,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should restore the table columns from the URL state if exists', async () => { - await PageObjects.common.navigateToApp('discover', { - hash: '/p/log-explorer?_a=(columns:!(message,data_stream.namespace))', + await PageObjects.observabilityLogExplorer.navigateTo({ + hash: '?_a=(columns:!(message,data_stream.namespace))', }); await PageObjects.discover.expandTimeRangeAsSuggestedInNoResultsMessage(); diff --git a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/customization.ts b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/customization.ts deleted file mode 100644 index a647293a73145..0000000000000 --- a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/customization.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ -import { FtrProviderContext } from '../../../ftr_provider_context'; - -export default function ({ getService, getPageObjects }: FtrProviderContext) { - const kibanaServer = getService('kibanaServer'); - const PageObjects = getPageObjects(['common']); - const testSubjects = getService('testSubjects'); - - describe('Customizations', () => { - before('initialize tests', async () => { - await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); - }); - - after('clean up archives', async () => { - await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); - }); - - describe('when Discover is loaded with the log-explorer profile', () => { - it('DatasetSelector should replace the DataViewPicker', async () => { - // Assert does not render on discover app - await PageObjects.common.navigateToApp('discover'); - await testSubjects.missingOrFail('datasetSelectorPopover'); - - // Assert it renders on log-explorer profile - await PageObjects.common.navigateToApp('discover', { hash: '/p/log-explorer' }); - await testSubjects.existOrFail('datasetSelectorPopover'); - }); - - it('the TopNav bar should hide New, Open and Save options', async () => { - // Assert does not render on discover app - await PageObjects.common.navigateToApp('discover'); - await testSubjects.existOrFail('discoverNewButton'); - await testSubjects.existOrFail('discoverOpenButton'); - await testSubjects.existOrFail('shareTopNavButton'); - await testSubjects.existOrFail('discoverAlertsButton'); - await testSubjects.existOrFail('openInspectorButton'); - await testSubjects.existOrFail('discoverSaveButton'); - - // Assert it renders on log-explorer profile - await PageObjects.common.navigateToApp('discover', { hash: '/p/log-explorer' }); - await testSubjects.missingOrFail('discoverNewButton'); - await testSubjects.missingOrFail('discoverOpenButton'); - await testSubjects.existOrFail('shareTopNavButton'); - await testSubjects.existOrFail('discoverAlertsButton'); - await testSubjects.existOrFail('openInspectorButton'); - await testSubjects.missingOrFail('discoverSaveButton'); - }); - - it('should render a filter controls section as part of the unified search bar', async () => { - // Assert does not render on discover app - await PageObjects.common.navigateToApp('discover'); - await testSubjects.missingOrFail('datasetFiltersCustomization'); - - // Assert it renders on log-explorer profile - await PageObjects.common.navigateToApp('discover', { hash: '/p/log-explorer' }); - await testSubjects.existOrFail('datasetFiltersCustomization', { allowHidden: true }); - }); - }); - }); -} diff --git a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selection_state.ts b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selection_state.ts index 66a2f50b41ae4..d16590b955e96 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selection_state.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selection_state.ts @@ -15,7 +15,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('DatasetSelection initialization and update', () => { describe('when the "index" query param does not exist', () => { it('should initialize the "All log datasets" selection', async () => { - await PageObjects.common.navigateToApp('discover', { hash: '/p/log-explorer' }); + await PageObjects.observabilityLogExplorer.navigateTo(); const datasetSelectionTitle = await PageObjects.observabilityLogExplorer.getDatasetSelectorButtonText(); @@ -23,12 +23,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - describe('when the "index" query param exist', () => { + describe('when the "index" query param exists', () => { it('should decode and restore the selection from a valid encoded index', async () => { const azureActivitylogsIndex = 'BQZwpgNmDGAuCWB7AdgLmAEwIay+W6yWAtmKgOQSIDmIAtFgF4CuATmAHRZzwBu8sAJ5VadAFTkANAlhRU3BPyEiQASklFS8lu2kC55AII6wAAgAyNEFN5hWIJGnIBGDgFYOAJgDM5deCgeFAAVQQAHMgdkaihVIA==='; - await PageObjects.common.navigateToApp('discover', { - hash: `/p/log-explorer?_a=(index:${encodeURIComponent(azureActivitylogsIndex)})`, + await PageObjects.observabilityLogExplorer.navigateTo({ + hash: `?_a=(index:${encodeURIComponent(azureActivitylogsIndex)})`, }); const datasetSelectionTitle = @@ -37,10 +37,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(datasetSelectionTitle).to.be('[Azure Logs] activitylogs'); }); - it('should fallback to "All log datasets" selection and notify the user for an invalid encoded index', async () => { + it('should fallback to the "All log datasets" selection and notify the user of an invalid encoded index', async () => { const invalidEncodedIndex = 'invalid-encoded-index'; - await PageObjects.common.navigateToApp('discover', { - hash: `/p/log-explorer?_a=(index:${encodeURIComponent(invalidEncodedIndex)})`, + await PageObjects.observabilityLogExplorer.navigateTo({ + hash: `?_a=(index:${encodeURIComponent(invalidEncodedIndex)})`, }); const datasetSelectionTitle = @@ -53,17 +53,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('when navigating back and forth on the page history', () => { it('should decode and restore the selection for the current index', async () => { - await PageObjects.common.navigateToApp('discover', { hash: '/p/log-explorer' }); + await PageObjects.observabilityLogExplorer.navigateTo(); const allDatasetSelectionTitle = await PageObjects.observabilityLogExplorer.getDatasetSelectorButtonText(); expect(allDatasetSelectionTitle).to.be('All log datasets'); const azureActivitylogsIndex = 'BQZwpgNmDGAuCWB7AdgLmAEwIay+W6yWAtmKgOQSIDmIAtFgF4CuATmAHRZzwBu8sAJ5VadAFTkANAlhRU3BPyEiQASklFS8lu2kC55AII6wAAgAyNEFN5hWIJGnIBGDgFYOAJgDM5deCgeFAAVQQAHMgdkaihVIA==='; - await PageObjects.common.navigateToApp('discover', { - hash: `/p/log-explorer?_a=(index:${encodeURIComponent( - azureActivitylogsIndex - )})&controlPanels=()`, + await PageObjects.observabilityLogExplorer.navigateTo({ + hash: `?_a=(index:${encodeURIComponent(azureActivitylogsIndex)})&controlPanels=()`, }); const azureDatasetSelectionTitle = await PageObjects.observabilityLogExplorer.getDatasetSelectorButtonText(); diff --git a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selector.ts b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selector.ts index 79251545a5d6d..c9c1f45680d60 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selector.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selector.ts @@ -29,7 +29,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('without installed integrations or uncategorized data streams', () => { before(async () => { - await PageObjects.common.navigateToApp('discover', { hash: '/p/log-explorer' }); + await PageObjects.observabilityLogExplorer.navigateTo(); }); beforeEach(async () => { @@ -167,7 +167,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('when open on the first navigation level', () => { before(async () => { - await PageObjects.common.navigateToApp('discover', { hash: '/p/log-explorer' }); + await PageObjects.observabilityLogExplorer.navigateTo(); }); beforeEach(async () => { @@ -293,7 +293,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('when clicking on integration and moving into the second navigation level', () => { before(async () => { - await PageObjects.common.navigateToApp('discover', { hash: '/p/log-explorer' }); + await PageObjects.observabilityLogExplorer.navigateTo(); }); beforeEach(async () => { @@ -420,7 +420,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('when navigating into Uncategorized data streams', () => { before(async () => { - await PageObjects.common.navigateToApp('discover', { hash: '/p/log-explorer' }); + await PageObjects.observabilityLogExplorer.navigateTo(); }); beforeEach(async () => { @@ -544,7 +544,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('when open/close the selector', () => { before(async () => { - await PageObjects.common.navigateToApp('discover', { hash: '/p/log-explorer' }); + await PageObjects.observabilityLogExplorer.navigateTo(); }); beforeEach(async () => { @@ -602,7 +602,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('when switching between integration panels', () => { before(async () => { - await PageObjects.common.navigateToApp('discover', { hash: '/p/log-explorer' }); + await PageObjects.observabilityLogExplorer.navigateTo(); }); it('should remember the latest search and restore its results for each integration', async () => { diff --git a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/filter_controls.ts b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/filter_controls.ts new file mode 100644 index 0000000000000..b5e25744f2c5b --- /dev/null +++ b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/filter_controls.ts @@ -0,0 +1,28 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { FtrProviderContext } from '../../../ftr_provider_context'; + +export default function ({ getService, getPageObjects }: FtrProviderContext) { + const kibanaServer = getService('kibanaServer'); + const PageObjects = getPageObjects(['observabilityLogExplorer']); + const testSubjects = getService('testSubjects'); + + describe('Filter controls customization', () => { + before('initialize tests', async () => { + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); + }); + + after('clean up archives', async () => { + await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); + }); + + it('renders a filter controls section as part of the unified search bar', async () => { + await PageObjects.observabilityLogExplorer.navigateTo(); + await testSubjects.existOrFail('datasetFiltersCustomization', { allowHidden: true }); + }); + }); +} diff --git a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/index.ts b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/index.ts index 2d5c13a336395..b0555b4447d27 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/index.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/index.ts @@ -7,11 +7,12 @@ import { FtrProviderContext } from '../../../ftr_provider_context'; -export default function (loadTestFile: FtrProviderContext['loadTestFile']) { +export default function ({ loadTestFile }: FtrProviderContext) { describe('Observability Log Explorer', function () { + loadTestFile(require.resolve('./app')); loadTestFile(require.resolve('./columns_selection')); - loadTestFile(require.resolve('./customization')); loadTestFile(require.resolve('./dataset_selection_state')); loadTestFile(require.resolve('./dataset_selector')); + loadTestFile(require.resolve('./filter_controls')); }); } From d795bb306783312afc1eab19b447694070ec3896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Fri, 25 Aug 2023 15:52:27 +0000 Subject: [PATCH 24/46] Move nav link setting --- .../test_suites/core_plugins/rendering.ts | 1 + .../log_explorer/common/plugin_config.ts | 7 +--- .../plugins/log_explorer/public/deep_links.ts | 21 ---------- x-pack/plugins/log_explorer/server/config.ts | 16 +------- .../common/plugin_config.ts | 7 +++- .../public/plugin.ts | 10 ++--- .../server/config.ts | 39 +++++++++++++++++++ .../server/index.ts | 2 + 8 files changed, 56 insertions(+), 47 deletions(-) delete mode 100644 x-pack/plugins/log_explorer/public/deep_links.ts create mode 100644 x-pack/plugins/observability_log_explorer/server/config.ts diff --git a/test/plugin_functional/test_suites/core_plugins/rendering.ts b/test/plugin_functional/test_suites/core_plugins/rendering.ts index 38fecbe13e2f5..917869eebb9a9 100644 --- a/test/plugin_functional/test_suites/core_plugins/rendering.ts +++ b/test/plugin_functional/test_suites/core_plugins/rendering.ts @@ -291,6 +291,7 @@ export default function ({ getService }: PluginFunctionalProviderContext) { 'xpack.observability.unsafe.alertDetails.observability.enabled (boolean)', 'xpack.observability.unsafe.thresholdRule.enabled (boolean)', 'xpack.observability_onboarding.ui.enabled (boolean)', + 'xpack.observabilityLogExplorer.navigation.showAppLink (boolean)', ]; // We don't assert that actualExposedConfigKeys and expectedExposedConfigKeys are equal, because test failure messages with large // arrays are hard to grok. Instead, we take the difference between the two arrays and assert them separately, that way it's diff --git a/x-pack/plugins/log_explorer/common/plugin_config.ts b/x-pack/plugins/log_explorer/common/plugin_config.ts index 5c83b84c184e8..b9a9274392d61 100644 --- a/x-pack/plugins/log_explorer/common/plugin_config.ts +++ b/x-pack/plugins/log_explorer/common/plugin_config.ts @@ -5,8 +5,5 @@ * 2.0. */ -export interface LogExplorerConfig { - featureFlags: { - deepLinkVisible: boolean; - }; -} +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface LogExplorerConfig {} diff --git a/x-pack/plugins/log_explorer/public/deep_links.ts b/x-pack/plugins/log_explorer/public/deep_links.ts deleted file mode 100644 index 2740fbab56b16..0000000000000 --- a/x-pack/plugins/log_explorer/public/deep_links.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { AppDeepLink, AppNavLinkStatus, DEFAULT_APP_CATEGORIES } from '@kbn/core/public'; -import { i18n } from '@kbn/i18n'; -import { LOG_EXPLORER_PROFILE_ID } from '../common/constants'; - -export const getLogExplorerDeepLink = ({ isVisible }: { isVisible: boolean }): AppDeepLink => ({ - id: LOG_EXPLORER_PROFILE_ID, - title: i18n.translate('xpack.discoverLogExplorer.deepLink', { - defaultMessage: 'Logs Explorer', - }), - path: `#/p/${LOG_EXPLORER_PROFILE_ID}`, - category: DEFAULT_APP_CATEGORIES.observability, - euiIconType: 'logoObservability', - navLinkStatus: isVisible ? AppNavLinkStatus.visible : AppNavLinkStatus.default, -}); diff --git a/x-pack/plugins/log_explorer/server/config.ts b/x-pack/plugins/log_explorer/server/config.ts index 1b8f3583dab08..5f4a3411d8f44 100644 --- a/x-pack/plugins/log_explorer/server/config.ts +++ b/x-pack/plugins/log_explorer/server/config.ts @@ -5,24 +5,12 @@ * 2.0. */ -import { schema, offeringBasedSchema } from '@kbn/config-schema'; +import { schema } from '@kbn/config-schema'; import { PluginConfigDescriptor } from '@kbn/core/server'; import { LogExplorerConfig } from '../common/plugin_config'; -export const configSchema = schema.object({ - featureFlags: schema.object({ - deepLinkVisible: offeringBasedSchema({ - serverless: schema.boolean(), - options: { - defaultValue: false, - }, - }), - }), -}); +export const configSchema = schema.object({}); export const config: PluginConfigDescriptor = { schema: configSchema, - deprecations: ({ unusedFromRoot }) => [ - unusedFromRoot('xpack.discoverLogExplorer.featureFlags.deepLinkVisible', { level: 'warning' }), - ], }; diff --git a/x-pack/plugins/observability_log_explorer/common/plugin_config.ts b/x-pack/plugins/observability_log_explorer/common/plugin_config.ts index 9d86e61c12faa..6d467f4236c3e 100644 --- a/x-pack/plugins/observability_log_explorer/common/plugin_config.ts +++ b/x-pack/plugins/observability_log_explorer/common/plugin_config.ts @@ -5,5 +5,8 @@ * 2.0. */ -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface ObservabilityLogExplorerConfig {} +export interface ObservabilityLogExplorerConfig { + navigation: { + showAppLink: boolean; + }; +} diff --git a/x-pack/plugins/observability_log_explorer/public/plugin.ts b/x-pack/plugins/observability_log_explorer/public/plugin.ts index 064cac55aa1f4..6afb62235ba15 100644 --- a/x-pack/plugins/observability_log_explorer/public/plugin.ts +++ b/x-pack/plugins/observability_log_explorer/public/plugin.ts @@ -34,16 +34,16 @@ export class ObservabilityLogExplorerPlugin public setup( core: CoreSetup, - pluginsSetup: ObservabilityLogExplorerSetupDeps + _pluginsSetup: ObservabilityLogExplorerSetupDeps ) { - const isServerless = !!pluginsSetup.serverless; - core.application.register({ id: 'observability-log-explorer', title: logExplorerAppTitle, category: DEFAULT_APP_CATEGORIES.observability, euiIconType: 'logoLogging', - navLinkStatus: isServerless ? AppNavLinkStatus.visible : AppNavLinkStatus.hidden, + navLinkStatus: this.config.navigation.showAppLink + ? AppNavLinkStatus.visible + : AppNavLinkStatus.hidden, searchable: true, mount: async (appMountParams) => { const [coreStart, pluginsStart, ownPluginStart] = await core.getStartServices(); @@ -60,7 +60,7 @@ export class ObservabilityLogExplorerPlugin return {}; } - public start(core: CoreStart, plugins: ObservabilityLogExplorerStartDeps) { + public start(_core: CoreStart, _pluginsStart: ObservabilityLogExplorerStartDeps) { return {}; } } diff --git a/x-pack/plugins/observability_log_explorer/server/config.ts b/x-pack/plugins/observability_log_explorer/server/config.ts new file mode 100644 index 0000000000000..1977c5e625c15 --- /dev/null +++ b/x-pack/plugins/observability_log_explorer/server/config.ts @@ -0,0 +1,39 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { schema, offeringBasedSchema } from '@kbn/config-schema'; +import { PluginConfigDescriptor } from '@kbn/core/server'; +import { ObservabilityLogExplorerConfig } from '../common/plugin_config'; + +export const configSchema = schema.object({ + navigation: schema.object({ + showAppLink: offeringBasedSchema({ + serverless: schema.boolean({ + defaultValue: true, + }), + options: { + defaultValue: false, + }, + }), + }), +}); + +export const config: PluginConfigDescriptor = { + schema: configSchema, + deprecations: ({ renameFromRoot }) => [ + renameFromRoot( + 'xpack.discoverLogExplorer.featureFlags.deepLinkVisible', + 'xpack.observabilityLogExplorer.navigation.showAppLink', + { level: 'warning' } + ), + ], + exposeToBrowser: { + navigation: { + showAppLink: true, + }, + }, +}; diff --git a/x-pack/plugins/observability_log_explorer/server/index.ts b/x-pack/plugins/observability_log_explorer/server/index.ts index 1310dd1227141..a487aefc8fd14 100644 --- a/x-pack/plugins/observability_log_explorer/server/index.ts +++ b/x-pack/plugins/observability_log_explorer/server/index.ts @@ -7,4 +7,6 @@ import { ObservabilityLogExplorerServerPlugin } from './plugin'; +export { config } from './config'; + export const plugin = () => new ObservabilityLogExplorerServerPlugin(); From 3b57f3aec7e616ae9247e9cd87768e5d50e4622c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Fri, 25 Aug 2023 15:52:38 +0000 Subject: [PATCH 25/46] Fix translation prefix --- x-pack/.i18nrc.json | 1 + .../plugins/observability_log_explorer/common/translations.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/.i18nrc.json b/x-pack/.i18nrc.json index 741565cb31f90..40f1d6ae0c198 100644 --- a/x-pack/.i18nrc.json +++ b/x-pack/.i18nrc.json @@ -37,6 +37,7 @@ "xpack.idxMgmt": "plugins/index_management", "xpack.indexLifecycleMgmt": "plugins/index_lifecycle_management", "xpack.infra": "plugins/infra", + "xpack.logExplorer": "plugins/log_explorer", "xpack.logsShared": "plugins/logs_shared", "xpack.fleet": "plugins/fleet", "xpack.ingestPipelines": "plugins/ingest_pipelines", diff --git a/x-pack/plugins/observability_log_explorer/common/translations.ts b/x-pack/plugins/observability_log_explorer/common/translations.ts index 726dee617c535..728f10895c0e2 100644 --- a/x-pack/plugins/observability_log_explorer/common/translations.ts +++ b/x-pack/plugins/observability_log_explorer/common/translations.ts @@ -7,6 +7,6 @@ import { i18n } from '@kbn/i18n'; -export const logExplorerAppTitle = i18n.translate('xpack.observability_log_explorer.appTitle', { +export const logExplorerAppTitle = i18n.translate('xpack.observabilityLogExplorer.appTitle', { defaultMessage: 'Log Explorer', }); From b94f54b7aba9eb9e3108139763c37d8fe8a4cf88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Fri, 25 Aug 2023 16:06:56 +0000 Subject: [PATCH 26/46] Fix application usage tracking schema --- .../server/collectors/application_usage/schema.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts b/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts index c335f56998ce3..55f2d1e63f7e3 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts @@ -154,6 +154,7 @@ export const applicationUsageSchema = { maps: commonSchema, ml: commonSchema, monitoring: commonSchema, + 'observability-log-explorer': commonSchema, 'observability-overview': commonSchema, observabilityOnboarding: commonSchema, observabilityAIAssistant: commonSchema, From 50e5dca40ea1f314d53516259ed65112dccfb0fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Fri, 25 Aug 2023 16:45:20 +0000 Subject: [PATCH 27/46] Fix functional test navigation method --- .../test/functional/page_objects/observability_log_explorer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/test/functional/page_objects/observability_log_explorer.ts b/x-pack/test/functional/page_objects/observability_log_explorer.ts index 7b1e7fcc575a1..33e85e06a16a9 100644 --- a/x-pack/test/functional/page_objects/observability_log_explorer.ts +++ b/x-pack/test/functional/page_objects/observability_log_explorer.ts @@ -172,7 +172,7 @@ export function ObservabilityLogExplorerPageObject({ }, async navigateTo(options?: NavigateToAppOptions) { - return await PageObjects.common.navigateToApp('observabilityLogExplorer'); + return await PageObjects.common.navigateToApp('observabilityLogExplorer', options); }, getDatasetSelector() { From fe12e04e347cb01b2669fc832a31baeb3576c45d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Fri, 25 Aug 2023 16:51:16 +0000 Subject: [PATCH 28/46] Restore global search test to pre-profile state --- .../test_suites/global_search/global_search_providers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/test/plugin_functional/test_suites/global_search/global_search_providers.ts b/x-pack/test/plugin_functional/test_suites/global_search/global_search_providers.ts index 684633d4aac13..daf1821ef5c05 100644 --- a/x-pack/test/plugin_functional/test_suites/global_search/global_search_providers.ts +++ b/x-pack/test/plugin_functional/test_suites/global_search/global_search_providers.ts @@ -87,7 +87,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { describe('Applications provider', function () { it('can search for root-level applications', async () => { const results = await findResultsWithApi('discover'); - expect(results.length).to.be(2); + expect(results.length).to.be(1); expect(results[0].title).to.be('Discover'); }); From 14b886e9e967473edb9063c77ac28d1c0310442e Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Fri, 25 Aug 2023 16:58:17 +0000 Subject: [PATCH 29/46] [CI] Auto-commit changed files from 'node scripts/lint_ts_projects --fix' --- x-pack/plugins/observability_log_explorer/tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/plugins/observability_log_explorer/tsconfig.json b/x-pack/plugins/observability_log_explorer/tsconfig.json index 724d6494e1192..5f94d15d30fea 100644 --- a/x-pack/plugins/observability_log_explorer/tsconfig.json +++ b/x-pack/plugins/observability_log_explorer/tsconfig.json @@ -21,6 +21,7 @@ "@kbn/kibana-react-plugin", "@kbn/serverless", "@kbn/core-chrome-browser", + "@kbn/config-schema", ], "exclude": [ "target/**/*" From 75030fa66cb769e767ae5968f7cdd5eb0537259b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Fri, 25 Aug 2023 17:15:29 +0000 Subject: [PATCH 30/46] Fix telemetry schema --- src/plugins/telemetry/schema/oss_plugins.json | 131 ++++++++++++++++++ 1 file changed, 131 insertions(+) diff --git a/src/plugins/telemetry/schema/oss_plugins.json b/src/plugins/telemetry/schema/oss_plugins.json index de4f1fae8f675..8cc02275bf5a6 100644 --- a/src/plugins/telemetry/schema/oss_plugins.json +++ b/src/plugins/telemetry/schema/oss_plugins.json @@ -4587,6 +4587,137 @@ } } }, + "observability-log-explorer": { + "properties": { + "appId": { + "type": "keyword", + "_meta": { + "description": "The application being tracked" + } + }, + "viewId": { + "type": "keyword", + "_meta": { + "description": "Always `main`" + } + }, + "clicks_total": { + "type": "long", + "_meta": { + "description": "General number of clicks in the application since we started counting them" + } + }, + "clicks_7_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the application over the last 7 days" + } + }, + "clicks_30_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the application over the last 30 days" + } + }, + "clicks_90_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the application over the last 90 days" + } + }, + "minutes_on_screen_total": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen since we started counting them." + } + }, + "minutes_on_screen_7_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen over the last 7 days" + } + }, + "minutes_on_screen_30_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen over the last 30 days" + } + }, + "minutes_on_screen_90_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen over the last 90 days" + } + }, + "views": { + "type": "array", + "items": { + "properties": { + "appId": { + "type": "keyword", + "_meta": { + "description": "The application being tracked" + } + }, + "viewId": { + "type": "keyword", + "_meta": { + "description": "The application view being tracked" + } + }, + "clicks_total": { + "type": "long", + "_meta": { + "description": "General number of clicks in the application sub view since we started counting them" + } + }, + "clicks_7_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the active application sub view over the last 7 days" + } + }, + "clicks_30_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the active application sub view over the last 30 days" + } + }, + "clicks_90_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the active application sub view over the last 90 days" + } + }, + "minutes_on_screen_total": { + "type": "float", + "_meta": { + "description": "Minutes the application sub view is active and on-screen since we started counting them." + } + }, + "minutes_on_screen_7_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen active application sub view over the last 7 days" + } + }, + "minutes_on_screen_30_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen active application sub view over the last 30 days" + } + }, + "minutes_on_screen_90_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen active application sub view over the last 90 days" + } + } + } + } + } + } + }, "observability-overview": { "properties": { "appId": { From ba729df1936a82c045f38730e6275a6bfda0759f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Fri, 25 Aug 2023 19:23:16 +0000 Subject: [PATCH 31/46] Fix test for exposed config keys --- test/plugin_functional/test_suites/core_plugins/rendering.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/plugin_functional/test_suites/core_plugins/rendering.ts b/test/plugin_functional/test_suites/core_plugins/rendering.ts index 917869eebb9a9..044586a3f7210 100644 --- a/test/plugin_functional/test_suites/core_plugins/rendering.ts +++ b/test/plugin_functional/test_suites/core_plugins/rendering.ts @@ -291,7 +291,7 @@ export default function ({ getService }: PluginFunctionalProviderContext) { 'xpack.observability.unsafe.alertDetails.observability.enabled (boolean)', 'xpack.observability.unsafe.thresholdRule.enabled (boolean)', 'xpack.observability_onboarding.ui.enabled (boolean)', - 'xpack.observabilityLogExplorer.navigation.showAppLink (boolean)', + 'xpack.observabilityLogExplorer.navigation.showAppLink (any)', ]; // We don't assert that actualExposedConfigKeys and expectedExposedConfigKeys are equal, because test failure messages with large // arrays are hard to grok. Instead, we take the difference between the two arrays and assert them separately, that way it's From 15a354820cfaded268b379d1b5d4379a3963177f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Fri, 25 Aug 2023 20:04:02 +0000 Subject: [PATCH 32/46] Fix cypress e2e test --- .../test_suites/observability/cypress/e2e/navigation.cy.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x-pack/test_serverless/functional/test_suites/observability/cypress/e2e/navigation.cy.ts b/x-pack/test_serverless/functional/test_suites/observability/cypress/e2e/navigation.cy.ts index df1bea1e56e85..9b4a8f355f77f 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/cypress/e2e/navigation.cy.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/cypress/e2e/navigation.cy.ts @@ -12,7 +12,7 @@ describe('Serverless', () => { it('contains the side navigation for observabilitity serverless', () => { cy.loginAsElasticUser(); - cy.contains('Discover'); + cy.contains('Log Explorer'); cy.contains('Dashboards'); cy.contains('Alerts'); cy.contains('AIOps'); @@ -25,8 +25,8 @@ describe('Serverless', () => { it('navigates to discover-dashboard-viz links', () => { cy.loginAsElasticUser(); - cy.contains('Discover').click(); - cy.url().should('include', '/app/discover'); + cy.contains('Log Explorer').click(); + cy.url().should('include', '/app/observability-log-explorer'); cy.contains('Dashboards').click(); cy.url().should('include', '/app/dashboards'); From a321268c931a6854b150b5a9a2a3a6e1da5b02c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Mon, 28 Aug 2023 13:53:30 +0000 Subject: [PATCH 33/46] Fix serverless navigation tests --- .../observability/observability_log_explorer/app.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/app.ts b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/app.ts index 4efa47ed271cf..b201911f76aad 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/app.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/app.ts @@ -9,8 +9,8 @@ import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { const kibanaServer = getService('kibanaServer'); - const PageObjects = getPageObjects(['navigationalSearch', 'svlObltNavigation']); - const testSubjects = getService('testSubjects'); + const PageObjects = getPageObjects(['navigationalSearch']); + const serverlessNavigation = getService('svlObltNavigation'); describe('Application', () => { before('initialize tests', async () => { @@ -22,7 +22,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('is shown in the global search', async () => { - await PageObjects.svlObltNavigation.navigateToLandingPage(); + await serverlessNavigation.navigateToLandingPage(); await PageObjects.navigationalSearch.searchFor('log explorer'); const results = await PageObjects.navigationalSearch.getDisplayedResults(); From 5d07c888ad2bc239b6f54eb2d793471bbe7270de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Mon, 28 Aug 2023 15:24:22 +0000 Subject: [PATCH 34/46] Fix serverless log explorer nav tests --- x-pack/test_serverless/functional/config.base.ts | 3 +++ .../test_suites/observability/navigation.ts | 15 +++------------ .../observability_log_explorer/app.ts | 12 +++++++----- 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/x-pack/test_serverless/functional/config.base.ts b/x-pack/test_serverless/functional/config.base.ts index 640ae2402b544..c266d184151af 100644 --- a/x-pack/test_serverless/functional/config.base.ts +++ b/x-pack/test_serverless/functional/config.base.ts @@ -52,6 +52,9 @@ export function createTestConfig(options: CreateTestConfigOptions) { observability: { pathname: '/app/observability', }, + observabilityLogExplorer: { + pathname: '/app/observability-log-explorer', + }, management: { pathname: '/app/management', }, diff --git a/x-pack/test_serverless/functional/test_suites/observability/navigation.ts b/x-pack/test_serverless/functional/test_suites/observability/navigation.ts index 7eedcab11969f..7e84512ab4b0a 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/navigation.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/navigation.ts @@ -36,12 +36,12 @@ export default function ({ getPageObject, getService }: FtrProviderContext) { await svlCommonNavigation.sidenav.expectSectionClosed('project_settings_project_nav'); // navigate to log explorer - await svlCommonNavigation.sidenav.clickLink({ deepLinkId: 'observabilityLogExplorer' }); + await svlCommonNavigation.sidenav.clickLink({ deepLinkId: 'observability-log-explorer' }); await svlCommonNavigation.sidenav.expectLinkActive({ - deepLinkId: 'observabilityLogExplorer', + deepLinkId: 'observability-log-explorer', }); await svlCommonNavigation.breadcrumbs.expectBreadcrumbExists({ - deepLinkId: 'observabilityLogExplorer', + deepLinkId: 'observability-log-explorer', }); await expect(await browser.getCurrentUrl()).contain('/app/observability-log-explorer'); @@ -79,15 +79,6 @@ export default function ({ getPageObject, getService }: FtrProviderContext) { await svlCommonNavigation.sidenav.expectSectionOpen('project_settings_project_nav'); }); - it('navigate using search', async () => { - await svlCommonNavigation.search.showSearch(); - await svlCommonNavigation.search.searchFor('discover log explorer'); - await svlCommonNavigation.search.clickOnOption(0); - await svlCommonNavigation.search.hideSearch(); - - await expect(await browser.getCurrentUrl()).contain('/app/discover#/p/log-explorer'); - }); - it('shows cases in sidebar navigation', async () => { await svlCommonNavigation.expectExists(); diff --git a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/app.ts b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/app.ts index b201911f76aad..e1a2c72f04472 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/app.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/app.ts @@ -9,8 +9,7 @@ import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { const kibanaServer = getService('kibanaServer'); - const PageObjects = getPageObjects(['navigationalSearch']); - const serverlessNavigation = getService('svlObltNavigation'); + const PageObjects = getPageObjects(['observabilityLogExplorer', 'svlCommonNavigation']); describe('Application', () => { before('initialize tests', async () => { @@ -22,11 +21,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('is shown in the global search', async () => { - await serverlessNavigation.navigateToLandingPage(); - await PageObjects.navigationalSearch.searchFor('log explorer'); + await PageObjects.observabilityLogExplorer.navigateTo(); + await PageObjects.svlCommonNavigation.search.showSearch(); + await PageObjects.svlCommonNavigation.search.searchFor('log explorer'); - const results = await PageObjects.navigationalSearch.getDisplayedResults(); + const results = await PageObjects.svlCommonNavigation.search.getDisplayedResults(); expect(results[0].label).to.eql('Log Explorer'); + + await PageObjects.svlCommonNavigation.search.hideSearch(); }); }); } From 6a5c8d491a951a38ddba7dee00b62ae7740253e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Tue, 29 Aug 2023 11:54:50 +0000 Subject: [PATCH 35/46] Temporarily skip tests relying on broken utils --- .../apps/observability_log_explorer/dataset_selector.ts | 1 + .../observability_log_explorer/dataset_selector.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/x-pack/test/functional/apps/observability_log_explorer/dataset_selector.ts b/x-pack/test/functional/apps/observability_log_explorer/dataset_selector.ts index fed56edd463d8..243799b68c5f6 100644 --- a/x-pack/test/functional/apps/observability_log_explorer/dataset_selector.ts +++ b/x-pack/test/functional/apps/observability_log_explorer/dataset_selector.ts @@ -259,6 +259,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.observabilityLogExplorer.assertNoIntegrationsPromptExists(); }); + // skipped until https://github.com/elastic/kibana/pull/165080 is available it('should load more integrations by scrolling to the end of the list', async () => { // Install more integrations and reload the page const cleanupAdditionalSetup = diff --git a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selector.ts b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selector.ts index c9c1f45680d60..6d51cdd28be50 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selector.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selector.ts @@ -259,7 +259,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.observabilityLogExplorer.assertNoIntegrationsPromptExists(); }); - it('should load more integrations by scrolling to the end of the list', async () => { + // skipped until https://github.com/elastic/kibana/pull/165080 is available + it.skip('should load more integrations by scrolling to the end of the list', async () => { // Install more integrations and reload the page const cleanupAdditionalSetup = await PageObjects.observabilityLogExplorer.setupAdditionalIntegrations(); From fbaf210c995b946a022977fdcf6455bdb8dd08fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Tue, 29 Aug 2023 15:52:01 +0000 Subject: [PATCH 36/46] Adapt to upstream Discover component changes --- .../components/log_explorer/log_explorer.tsx | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/x-pack/plugins/log_explorer/public/components/log_explorer/log_explorer.tsx b/x-pack/plugins/log_explorer/public/components/log_explorer/log_explorer.tsx index 7224d8d50e5a3..10bd9039751f1 100644 --- a/x-pack/plugins/log_explorer/public/components/log_explorer/log_explorer.tsx +++ b/x-pack/plugins/log_explorer/public/components/log_explorer/log_explorer.tsx @@ -8,7 +8,7 @@ import { ScopedHistory } from '@kbn/core-application-browser'; import { DataPublicPluginStart, ISearchStart, ISessionService } from '@kbn/data-plugin/public'; import { DiscoverStart } from '@kbn/discover-plugin/public'; -import React, { useMemo } from 'react'; +import React from 'react'; import { createLogExplorerProfileCustomizations, CreateLogExplorerProfileCustomizationsDeps, @@ -28,19 +28,16 @@ export const createLogExplorer = ({ data, discover: { DiscoverContainer }, }: CreateLogExplorerArgs) => { - const customizeLogExplorer = createLogExplorerProfileCustomizations({ core, data }); + const logExplorerCustomizations = [createLogExplorerProfileCustomizations({ core, data })]; - return ({ scopedHistory }: LogExplorerProps) => { - const overrideServices = useMemo( - () => ({ - data: createDataServiceProxy(data), - }), - [] - ); + const overrideServices = { + data: createDataServiceProxy(data), + }; + return ({ scopedHistory }: LogExplorerProps) => { return ( From ec686023a247084cce16bf2e65bea667d88581ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Tue, 29 Aug 2023 15:52:20 +0000 Subject: [PATCH 37/46] Adapt functional tests to routing changes --- .../columns_selection.ts | 8 +++++++- .../dataset_selection_state.ts | 15 ++++++++++++--- .../columns_selection.ts | 8 +++++++- .../dataset_selection_state.ts | 15 ++++++++++++--- 4 files changed, 38 insertions(+), 8 deletions(-) diff --git a/x-pack/test/functional/apps/observability_log_explorer/columns_selection.ts b/x-pack/test/functional/apps/observability_log_explorer/columns_selection.ts index d8364278a2aba..c61a2586522fd 100644 --- a/x-pack/test/functional/apps/observability_log_explorer/columns_selection.ts +++ b/x-pack/test/functional/apps/observability_log_explorer/columns_selection.ts @@ -5,6 +5,8 @@ * 2.0. */ import expect from '@kbn/expect'; +import rison from '@kbn/rison'; +import querystring from 'querystring'; import { FtrProviderContext } from '../../ftr_provider_context'; const defaultLogColumns = ['@timestamp', 'message']; @@ -40,7 +42,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should restore the table columns from the URL state if exists', async () => { await PageObjects.observabilityLogExplorer.navigateTo({ - hash: '?_a=(columns:!(message,data_stream.namespace))', + search: querystring.stringify({ + _a: rison.encode({ + columns: ['message', 'data_stream.namespace'], + }), + }), }); await PageObjects.discover.expandTimeRangeAsSuggestedInNoResultsMessage(); diff --git a/x-pack/test/functional/apps/observability_log_explorer/dataset_selection_state.ts b/x-pack/test/functional/apps/observability_log_explorer/dataset_selection_state.ts index dcd5c2ed29409..c9bcade9dce5b 100644 --- a/x-pack/test/functional/apps/observability_log_explorer/dataset_selection_state.ts +++ b/x-pack/test/functional/apps/observability_log_explorer/dataset_selection_state.ts @@ -5,6 +5,8 @@ * 2.0. */ import expect from '@kbn/expect'; +import rison from '@kbn/rison'; +import querystring from 'querystring'; import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { @@ -28,7 +30,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const azureActivitylogsIndex = 'BQZwpgNmDGAuCWB7AdgLmAEwIay+W6yWAtmKgOQSIDmIAtFgF4CuATmAHRZzwBu8sAJ5VadAFTkANAlhRU3BPyEiQASklFS8lu2kC55AII6wAAgAyNEFN5hWIJGnIBGDgFYOAJgDM5deCgeFAAVQQAHMgdkaihVIA==='; await PageObjects.observabilityLogExplorer.navigateTo({ - hash: `?_a=(index:${encodeURIComponent(azureActivitylogsIndex)})`, + search: querystring.stringify({ + _a: rison.encode({ index: azureActivitylogsIndex }), + }), }); const datasetSelectionTitle = @@ -40,7 +44,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should fallback to the "All log datasets" selection and notify the user of an invalid encoded index', async () => { const invalidEncodedIndex = 'invalid-encoded-index'; await PageObjects.observabilityLogExplorer.navigateTo({ - hash: `?_a=(index:${encodeURIComponent(invalidEncodedIndex)})`, + search: querystring.stringify({ + _a: rison.encode({ index: invalidEncodedIndex }), + }), }); const datasetSelectionTitle = @@ -61,7 +67,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const azureActivitylogsIndex = 'BQZwpgNmDGAuCWB7AdgLmAEwIay+W6yWAtmKgOQSIDmIAtFgF4CuATmAHRZzwBu8sAJ5VadAFTkANAlhRU3BPyEiQASklFS8lu2kC55AII6wAAgAyNEFN5hWIJGnIBGDgFYOAJgDM5deCgeFAAVQQAHMgdkaihVIA==='; await PageObjects.observabilityLogExplorer.navigateTo({ - hash: `?_a=(index:${encodeURIComponent(azureActivitylogsIndex)})&controlPanels=()`, + search: querystring.stringify({ + _a: rison.encode({ index: azureActivitylogsIndex }), + controlPanels: rison.encode({}), + }), }); const azureDatasetSelectionTitle = await PageObjects.observabilityLogExplorer.getDatasetSelectorButtonText(); diff --git a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/columns_selection.ts b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/columns_selection.ts index bb9951dd8d489..92ccb09a27f00 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/columns_selection.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/columns_selection.ts @@ -5,6 +5,8 @@ * 2.0. */ import expect from '@kbn/expect'; +import rison from '@kbn/rison'; +import querystring from 'querystring'; import { FtrProviderContext } from '../../../ftr_provider_context'; const defaultLogColumns = ['@timestamp', 'message']; @@ -40,7 +42,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should restore the table columns from the URL state if exists', async () => { await PageObjects.observabilityLogExplorer.navigateTo({ - hash: '?_a=(columns:!(message,data_stream.namespace))', + search: querystring.stringify({ + _a: rison.encode({ + columns: ['message', 'data_stream.namespace'], + }), + }), }); await PageObjects.discover.expandTimeRangeAsSuggestedInNoResultsMessage(); diff --git a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selection_state.ts b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selection_state.ts index d16590b955e96..5652843c3fc0c 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selection_state.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selection_state.ts @@ -5,6 +5,8 @@ * 2.0. */ import expect from '@kbn/expect'; +import rison from '@kbn/rison'; +import querystring from 'querystring'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { @@ -28,7 +30,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const azureActivitylogsIndex = 'BQZwpgNmDGAuCWB7AdgLmAEwIay+W6yWAtmKgOQSIDmIAtFgF4CuATmAHRZzwBu8sAJ5VadAFTkANAlhRU3BPyEiQASklFS8lu2kC55AII6wAAgAyNEFN5hWIJGnIBGDgFYOAJgDM5deCgeFAAVQQAHMgdkaihVIA==='; await PageObjects.observabilityLogExplorer.navigateTo({ - hash: `?_a=(index:${encodeURIComponent(azureActivitylogsIndex)})`, + search: querystring.stringify({ + _a: rison.encode({ index: azureActivitylogsIndex }), + }), }); const datasetSelectionTitle = @@ -40,7 +44,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should fallback to the "All log datasets" selection and notify the user of an invalid encoded index', async () => { const invalidEncodedIndex = 'invalid-encoded-index'; await PageObjects.observabilityLogExplorer.navigateTo({ - hash: `?_a=(index:${encodeURIComponent(invalidEncodedIndex)})`, + search: querystring.stringify({ + _a: rison.encode({ index: invalidEncodedIndex }), + }), }); const datasetSelectionTitle = @@ -61,7 +67,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const azureActivitylogsIndex = 'BQZwpgNmDGAuCWB7AdgLmAEwIay+W6yWAtmKgOQSIDmIAtFgF4CuATmAHRZzwBu8sAJ5VadAFTkANAlhRU3BPyEiQASklFS8lu2kC55AII6wAAgAyNEFN5hWIJGnIBGDgFYOAJgDM5deCgeFAAVQQAHMgdkaihVIA==='; await PageObjects.observabilityLogExplorer.navigateTo({ - hash: `?_a=(index:${encodeURIComponent(azureActivitylogsIndex)})&controlPanels=()`, + search: querystring.stringify({ + _a: rison.encode({ index: azureActivitylogsIndex }), + controlPanels: rison.encode({}), + }), }); const azureDatasetSelectionTitle = await PageObjects.observabilityLogExplorer.getDatasetSelectorButtonText(); From b8f07e6a452f25c350eeb8b24cbd351e105f0299 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Tue, 29 Aug 2023 15:55:22 +0000 Subject: [PATCH 38/46] Unskip test --- .../apps/observability_log_explorer/dataset_selector.ts | 5 ++--- .../observability_log_explorer/dataset_selector.ts | 7 +++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/x-pack/test/functional/apps/observability_log_explorer/dataset_selector.ts b/x-pack/test/functional/apps/observability_log_explorer/dataset_selector.ts index 243799b68c5f6..f7a5595634895 100644 --- a/x-pack/test/functional/apps/observability_log_explorer/dataset_selector.ts +++ b/x-pack/test/functional/apps/observability_log_explorer/dataset_selector.ts @@ -259,7 +259,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.observabilityLogExplorer.assertNoIntegrationsPromptExists(); }); - // skipped until https://github.com/elastic/kibana/pull/165080 is available it('should load more integrations by scrolling to the end of the list', async () => { // Install more integrations and reload the page const cleanupAdditionalSetup = @@ -272,14 +271,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await retry.try(async () => { const { nodes } = await PageObjects.observabilityLogExplorer.getIntegrations(); expect(nodes.length).to.be(15); - await nodes.at(-1)?.scrollIntoViewIfNecessary(); + await nodes.at(-1)?.scrollIntoView(); }); // Load more integrations await retry.try(async () => { const { nodes } = await PageObjects.observabilityLogExplorer.getIntegrations(); expect(nodes.length).to.be(20); - await nodes.at(-1)?.scrollIntoViewIfNecessary(); + await nodes.at(-1)?.scrollIntoView(); }); // No other integrations to load after scrolling to last integration diff --git a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selector.ts b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selector.ts index 6d51cdd28be50..ff022ab74a904 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selector.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selector.ts @@ -259,8 +259,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.observabilityLogExplorer.assertNoIntegrationsPromptExists(); }); - // skipped until https://github.com/elastic/kibana/pull/165080 is available - it.skip('should load more integrations by scrolling to the end of the list', async () => { + it('should load more integrations by scrolling to the end of the list', async () => { // Install more integrations and reload the page const cleanupAdditionalSetup = await PageObjects.observabilityLogExplorer.setupAdditionalIntegrations(); @@ -272,14 +271,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await retry.try(async () => { const { nodes } = await PageObjects.observabilityLogExplorer.getIntegrations(); expect(nodes.length).to.be(15); - await nodes.at(-1)?.scrollIntoViewIfNecessary(); + await nodes.at(-1)?.scrollIntoView(); }); // Load more integrations await retry.try(async () => { const { nodes } = await PageObjects.observabilityLogExplorer.getIntegrations(); expect(nodes.length).to.be(20); - await nodes.at(-1)?.scrollIntoViewIfNecessary(); + await nodes.at(-1)?.scrollIntoView(); }); // No other integrations to load after scrolling to last integration From d88e36e7843d333152813e9368d80061f4a9a58e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Tue, 29 Aug 2023 18:00:14 +0200 Subject: [PATCH 39/46] Update x-pack/plugins/log_explorer/kibana.jsonc Co-authored-by: Marco Antonio Ghiani --- x-pack/plugins/log_explorer/kibana.jsonc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/log_explorer/kibana.jsonc b/x-pack/plugins/log_explorer/kibana.jsonc index 4217879292916..612bd34859b98 100644 --- a/x-pack/plugins/log_explorer/kibana.jsonc +++ b/x-pack/plugins/log_explorer/kibana.jsonc @@ -2,7 +2,7 @@ "type": "plugin", "id": "@kbn/log-explorer-plugin", "owner": "@elastic/infra-monitoring-ui", - "description": "This plugin exposes and registers Logs+ features.", + "description": "This plugin provides a LogExplorer component using the Discover customization framework, offering several affordances specifically designed for log consumption.", "plugin": { "id": "logExplorer", "server": true, From f98302106082261d4da6109403ea1294f2ba1988 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 29 Aug 2023 16:05:45 +0000 Subject: [PATCH 40/46] [CI] Auto-commit changed files from 'node scripts/lint_ts_projects --fix' --- x-pack/test_serverless/tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/test_serverless/tsconfig.json b/x-pack/test_serverless/tsconfig.json index cf52b712de521..7def05dc78151 100644 --- a/x-pack/test_serverless/tsconfig.json +++ b/x-pack/test_serverless/tsconfig.json @@ -51,5 +51,6 @@ "@kbn/data-view-field-editor-plugin", "@kbn/data-plugin", "@kbn/bfetch-plugin", + "@kbn/rison", ] } From 23d88797811476b4dc2185ccd87ec7b8fa06a498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Tue, 29 Aug 2023 16:09:26 +0000 Subject: [PATCH 41/46] Add a basic description to the plugin README --- docs/developer/plugin-list.asciidoc | 2 +- x-pack/plugins/observability_log_explorer/README.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index 43d85b06e97be..e33bde623f518 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -670,7 +670,7 @@ Elastic. |{kib-repo}blob/{branch}/x-pack/plugins/observability_log_explorer/README.md[observabilityLogExplorer] -|undefined +|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] diff --git a/x-pack/plugins/observability_log_explorer/README.md b/x-pack/plugins/observability_log_explorer/README.md index e69de29bb2d1d..604b33dd2b288 100644 --- a/x-pack/plugins/observability_log_explorer/README.md +++ b/x-pack/plugins/observability_log_explorer/README.md @@ -0,0 +1,3 @@ +# Observability Log Explorer + +This plugin provides an app based on the `LogExplorer` component from the `log_explorer` plugin, but adds observability-specific affordances. From 7cf212991d0c06618bafaaffa809e11f3bcd23c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Tue, 29 Aug 2023 16:24:13 +0000 Subject: [PATCH 42/46] Remove unused config types --- x-pack/plugins/log_explorer/public/plugin.ts | 7 +------ x-pack/plugins/log_explorer/server/config.ts | 16 ---------------- x-pack/plugins/log_explorer/server/index.ts | 2 -- 3 files changed, 1 insertion(+), 24 deletions(-) delete mode 100644 x-pack/plugins/log_explorer/server/config.ts diff --git a/x-pack/plugins/log_explorer/public/plugin.ts b/x-pack/plugins/log_explorer/public/plugin.ts index 31df229523e34..5807e8260f326 100644 --- a/x-pack/plugins/log_explorer/public/plugin.ts +++ b/x-pack/plugins/log_explorer/public/plugin.ts @@ -6,7 +6,6 @@ */ import { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; -import { LogExplorerConfig } from '../common/plugin_config'; import { createLogExplorer } from './components/log_explorer'; import { LogExplorerPluginSetup, @@ -16,11 +15,7 @@ import { } from './types'; export class LogExplorerPlugin implements Plugin { - private config: LogExplorerConfig; - - constructor(context: PluginInitializerContext) { - this.config = context.config.get(); - } + constructor(context: PluginInitializerContext) {} public setup(core: CoreSetup, plugins: LogExplorerSetupDeps) {} diff --git a/x-pack/plugins/log_explorer/server/config.ts b/x-pack/plugins/log_explorer/server/config.ts deleted file mode 100644 index 5f4a3411d8f44..0000000000000 --- a/x-pack/plugins/log_explorer/server/config.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { schema } from '@kbn/config-schema'; -import { PluginConfigDescriptor } from '@kbn/core/server'; -import { LogExplorerConfig } from '../common/plugin_config'; - -export const configSchema = schema.object({}); - -export const config: PluginConfigDescriptor = { - schema: configSchema, -}; diff --git a/x-pack/plugins/log_explorer/server/index.ts b/x-pack/plugins/log_explorer/server/index.ts index d597de7dd71bc..634e4cfe02566 100644 --- a/x-pack/plugins/log_explorer/server/index.ts +++ b/x-pack/plugins/log_explorer/server/index.ts @@ -7,6 +7,4 @@ import { LogExplorerServerPlugin } from './plugin'; -export { config } from './config'; - export const plugin = () => new LogExplorerServerPlugin(); From 9906a21980e4914249604c4de2406540c4899ce2 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 29 Aug 2023 16:36:24 +0000 Subject: [PATCH 43/46] [CI] Auto-commit changed files from 'node scripts/lint_ts_projects --fix' --- x-pack/plugins/log_explorer/tsconfig.json | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/plugins/log_explorer/tsconfig.json b/x-pack/plugins/log_explorer/tsconfig.json index c9a7904531574..756f4bd6b156a 100644 --- a/x-pack/plugins/log_explorer/tsconfig.json +++ b/x-pack/plugins/log_explorer/tsconfig.json @@ -19,7 +19,6 @@ "@kbn/kibana-react-plugin", "@kbn/data-plugin", "@kbn/unified-field-list", - "@kbn/config-schema", "@kbn/core-application-browser", ], "exclude": ["target/**/*"] From b192889fd4a46d118d0f948ec3c7548f53e609ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Wed, 30 Aug 2023 09:28:59 +0000 Subject: [PATCH 44/46] Add comment to conditional config key in test --- test/plugin_functional/test_suites/core_plugins/rendering.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/plugin_functional/test_suites/core_plugins/rendering.ts b/test/plugin_functional/test_suites/core_plugins/rendering.ts index 528421c8770a3..c45c5548cf6bf 100644 --- a/test/plugin_functional/test_suites/core_plugins/rendering.ts +++ b/test/plugin_functional/test_suites/core_plugins/rendering.ts @@ -292,7 +292,7 @@ export default function ({ getService }: PluginFunctionalProviderContext) { 'xpack.observability.unsafe.alertDetails.observability.enabled (boolean)', 'xpack.observability.unsafe.thresholdRule.enabled (boolean)', 'xpack.observability_onboarding.ui.enabled (boolean)', - 'xpack.observabilityLogExplorer.navigation.showAppLink (any)', + 'xpack.observabilityLogExplorer.navigation.showAppLink (any)', // conditional, is actually a boolean ]; // We don't assert that actualExposedConfigKeys and expectedExposedConfigKeys are equal, because test failure messages with large // arrays are hard to grok. Instead, we take the difference between the two arrays and assert them separately, that way it's From d8e572c75d3c55bd87968db2f5b68a999c49fdec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Wed, 30 Aug 2023 10:14:15 +0000 Subject: [PATCH 45/46] Remove superfluous test fixtures --- .../functional/apps/observability_log_explorer/app.ts | 9 --------- .../observability/observability_log_explorer/app.ts | 9 --------- 2 files changed, 18 deletions(-) diff --git a/x-pack/test/functional/apps/observability_log_explorer/app.ts b/x-pack/test/functional/apps/observability_log_explorer/app.ts index 11c1077188abe..26fb9b4e8d19e 100644 --- a/x-pack/test/functional/apps/observability_log_explorer/app.ts +++ b/x-pack/test/functional/apps/observability_log_explorer/app.ts @@ -8,19 +8,10 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { - const kibanaServer = getService('kibanaServer'); const PageObjects = getPageObjects(['common', 'navigationalSearch', 'observabilityLogExplorer']); const testSubjects = getService('testSubjects'); describe('Application', () => { - before('initialize tests', async () => { - await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); - }); - - after('clean up archives', async () => { - await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); - }); - it('is shown in the global search', async () => { await PageObjects.common.navigateToApp('home'); await PageObjects.navigationalSearch.searchFor('log explorer'); diff --git a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/app.ts b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/app.ts index e1a2c72f04472..6a9d76a9b594c 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/app.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/app.ts @@ -8,18 +8,9 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { - const kibanaServer = getService('kibanaServer'); const PageObjects = getPageObjects(['observabilityLogExplorer', 'svlCommonNavigation']); describe('Application', () => { - before('initialize tests', async () => { - await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); - }); - - after('clean up archives', async () => { - await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); - }); - it('is shown in the global search', async () => { await PageObjects.observabilityLogExplorer.navigateTo(); await PageObjects.svlCommonNavigation.search.showSearch(); From b97c53d58f1d301aad36cd87a3e74579a9be853d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Thu, 31 Aug 2023 11:08:25 +0000 Subject: [PATCH 46/46] Add beta badge to chrome --- x-pack/plugins/infra/public/plugin.ts | 7 ++++++- .../common/translations.ts | 11 +++++++++++ .../public/utils/breadcrumbs.tsx | 14 +++++++++++--- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/infra/public/plugin.ts b/x-pack/plugins/infra/public/plugin.ts index e22cb6d13f747..04e3f34e067b4 100644 --- a/x-pack/plugins/infra/public/plugin.ts +++ b/x-pack/plugins/infra/public/plugin.ts @@ -130,7 +130,12 @@ export class Plugin implements InfraClientPluginClass { label: 'Logs', sortKey: 200, entries: [ - { label: 'Explorer', app: 'observability-log-explorer', path: '/' }, + { + label: 'Explorer', + app: 'observability-log-explorer', + path: '/', + isBetaFeature: true, + }, { label: 'Stream', app: 'logs', path: '/stream' }, { label: 'Anomalies', app: 'logs', path: '/anomalies' }, { label: 'Categories', app: 'logs', path: '/log-categories' }, diff --git a/x-pack/plugins/observability_log_explorer/common/translations.ts b/x-pack/plugins/observability_log_explorer/common/translations.ts index 728f10895c0e2..5ec1940fa8dff 100644 --- a/x-pack/plugins/observability_log_explorer/common/translations.ts +++ b/x-pack/plugins/observability_log_explorer/common/translations.ts @@ -10,3 +10,14 @@ import { i18n } from '@kbn/i18n'; export const logExplorerAppTitle = i18n.translate('xpack.observabilityLogExplorer.appTitle', { defaultMessage: 'Log Explorer', }); + +export const betaBadgeTitle = i18n.translate('xpack.observabilityLogExplorer.betaBadgeTitle', { + defaultMessage: 'Beta', +}); + +export const betaBadgeDescription = i18n.translate( + 'xpack.observabilityLogExplorer.betaBadgeDescription', + { + defaultMessage: 'This application is in beta and therefore subject to change.', + } +); diff --git a/x-pack/plugins/observability_log_explorer/public/utils/breadcrumbs.tsx b/x-pack/plugins/observability_log_explorer/public/utils/breadcrumbs.tsx index b1a44ac6d64cb..a8b575d5341dc 100644 --- a/x-pack/plugins/observability_log_explorer/public/utils/breadcrumbs.tsx +++ b/x-pack/plugins/observability_log_explorer/public/utils/breadcrumbs.tsx @@ -9,11 +9,15 @@ import { EuiBreadcrumb } from '@elastic/eui'; import type { ChromeStart } from '@kbn/core-chrome-browser'; import type { ServerlessPluginStart } from '@kbn/serverless/public'; import { useEffect } from 'react'; -import { logExplorerAppTitle } from '../../common/translations'; +import { + betaBadgeDescription, + betaBadgeTitle, + logExplorerAppTitle, +} from '../../common/translations'; export const useBreadcrumbs = ( breadcrumbs: EuiBreadcrumb[], - chromeService?: ChromeStart, + chromeService: ChromeStart, serverlessService?: ServerlessPluginStart ) => { useEffect(() => { @@ -23,7 +27,7 @@ export const useBreadcrumbs = ( export function setBreadcrumbs( breadcrumbs: EuiBreadcrumb[], - chromeService?: ChromeStart, + chromeService: ChromeStart, serverlessService?: ServerlessPluginStart ) { if (serverlessService) { @@ -36,6 +40,10 @@ export function setBreadcrumbs( ...breadcrumbs, ]); } + chromeService.setBadge({ + text: betaBadgeTitle, + tooltip: betaBadgeDescription, + }); } export const noBreadcrumbs: EuiBreadcrumb[] = [];