From d74c52a5a18e52288f385aaafdc32582daff457c Mon Sep 17 00:00:00 2001 From: Kate Patticha Date: Tue, 17 Sep 2024 20:10:51 +0300 Subject: [PATCH 01/42] [Inventory] Remove inventory dependencies --- .../inventory/public/plugin.tsx | 24 +++++++++++++++++++ .../observability/kibana.jsonc | 14 ++++------- .../observability/public/plugin.ts | 15 ------------ .../observability/tsconfig.json | 9 +++---- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/x-pack/plugins/observability_solution/inventory/public/plugin.tsx b/x-pack/plugins/observability_solution/inventory/public/plugin.tsx index 355309939ea6c..bdb2ecdbedf8e 100644 --- a/x-pack/plugins/observability_solution/inventory/public/plugin.tsx +++ b/x-pack/plugins/observability_solution/inventory/public/plugin.tsx @@ -7,6 +7,8 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { i18n } from '@kbn/i18n'; +import { from } from 'rxjs'; +import { map } from 'rxjs'; import { AppMountParameters, APP_WRAPPER_CLASS, @@ -49,6 +51,28 @@ export class InventoryPlugin ): InventoryPublicSetup { const inventoryAPIClient = createCallInventoryAPI(coreSetup); + pluginsSetup.observabilityShared.navigation.registerSections( + from(coreSetup.getStartServices()).pipe( + map(([coreStart, pluginsStart]) => { + return [ + { + label: '', + sortKey: 101, + entries: [ + { + label: i18n.translate('xpack.inventory.inventoryLinkTitle', { + defaultMessage: 'Inventory', + }), + app: INVENTORY_APP_ID, + path: '', + }, + ], + }, + ]; + }) + ) + ); + coreSetup.application.register({ id: INVENTORY_APP_ID, title: i18n.translate('xpack.inventory.appTitle', { diff --git a/x-pack/plugins/observability_solution/observability/kibana.jsonc b/x-pack/plugins/observability_solution/observability/kibana.jsonc index 3697fa0ff628a..859e7340a799d 100644 --- a/x-pack/plugins/observability_solution/observability/kibana.jsonc +++ b/x-pack/plugins/observability_solution/observability/kibana.jsonc @@ -6,10 +6,7 @@ "id": "observability", "server": true, "browser": true, - "configPath": [ - "xpack", - "observability" - ], + "configPath": ["xpack", "observability"], "requiredPlugins": [ "aiops", "alerting", @@ -52,8 +49,7 @@ "serverless", "guidedOnboarding", "observabilityAIAssistant", - "investigate", - "inventory" + "investigate" ], "requiredBundles": [ "data", @@ -61,10 +57,8 @@ "kibanaUtils", "unifiedSearch", "stackAlerts", - "spaces", + "spaces" ], - "extraPublicDirs": [ - "common" - ] + "extraPublicDirs": ["common"] } } diff --git a/x-pack/plugins/observability_solution/observability/public/plugin.ts b/x-pack/plugins/observability_solution/observability/public/plugin.ts index a22638213adbf..d9957a39f9f43 100644 --- a/x-pack/plugins/observability_solution/observability/public/plugin.ts +++ b/x-pack/plugins/observability_solution/observability/public/plugin.ts @@ -48,11 +48,9 @@ import { BehaviorSubject, from, map, mergeMap } from 'rxjs'; import type { AiopsPluginStart } from '@kbn/aiops-plugin/public/types'; import type { DataViewFieldEditorStart } from '@kbn/data-view-field-editor-plugin/public'; -import { INVENTORY_APP_ID } from '@kbn/deeplinks-observability/constants'; import type { EmbeddableSetup } from '@kbn/embeddable-plugin/public'; import type { ExploratoryViewPublicStart } from '@kbn/exploratory-view-plugin/public'; import type { GuidedOnboardingPluginStart } from '@kbn/guided-onboarding-plugin/public'; -import type { InventoryPublicSetup, InventoryPublicStart } from '@kbn/inventory-plugin/public'; import type { InvestigatePublicStart } from '@kbn/investigate-plugin/public'; import type { LicenseManagementUIPluginSetup } from '@kbn/license-management-plugin/public'; import type { LicensingPluginStart } from '@kbn/licensing-plugin/public'; @@ -361,18 +359,6 @@ export class Plugin ] : []; - const inventoryLink = pluginsSetup.inventory - ? [ - { - label: i18n.translate('xpack.observability.inventoryLinkTitle', { - defaultMessage: 'Inventory', - }), - app: INVENTORY_APP_ID, - path: '', - }, - ] - : []; - const isAiAssistantEnabled = pluginsStart.observabilityAIAssistant?.service.isEnabled(); @@ -436,7 +422,6 @@ export class Plugin sortKey: 100, entries: [ ...overviewLink, - ...inventoryLink, ...alertsLink, ...sloLink, ...casesLink, diff --git a/x-pack/plugins/observability_solution/observability/tsconfig.json b/x-pack/plugins/observability_solution/observability/tsconfig.json index 873a87c11d1a4..d7a33cb6492cb 100644 --- a/x-pack/plugins/observability_solution/observability/tsconfig.json +++ b/x-pack/plugins/observability_solution/observability/tsconfig.json @@ -9,7 +9,7 @@ "public/**/*.json", "server/**/*", "typings/**/*", - "../../../../typings/**/*", + "../../../../typings/**/*" ], "kbn_references": [ "@kbn/rule-data-utils", @@ -94,7 +94,6 @@ "@kbn/home-plugin", "@kbn/data-view-field-editor-plugin", "@kbn/guided-onboarding-plugin", - "@kbn/inventory-plugin", "@kbn/investigate-plugin", "@kbn/license-management-plugin", "@kbn/presentation-util-plugin", @@ -114,9 +113,7 @@ "@kbn/io-ts-utils", "@kbn/core-ui-settings-server-mocks", "@kbn/es-types", - "@kbn/logging-mocks", + "@kbn/logging-mocks" ], - "exclude": [ - "target/**/*" - ] + "exclude": ["target/**/*"] } From 9acb10585648f71efdd28a66a673e986ef68761a Mon Sep 17 00:00:00 2001 From: Kate Patticha Date: Wed, 18 Sep 2024 11:06:04 +0300 Subject: [PATCH 02/42] Use deep links to show the inventory nav --- .../observability/public/navigation_tree.ts | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts b/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts index 67062d2230235..6d63c9c89eaf1 100644 --- a/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts +++ b/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts @@ -49,22 +49,6 @@ export function createNavTree(pluginsStart: ObservabilityPublicPluginsStart) { return pathNameSerialized.startsWith(prepend('/app/dashboards')); }, }, - ...(pluginsStart.inventory - ? [ - { - link: 'inventory' as const, - getIsActive: ({ - pathNameSerialized, - prepend, - }: { - pathNameSerialized: string; - prepend: (path: string) => string; - }) => { - return pathNameSerialized.startsWith(prepend('/app/observability/inventory')); - }, - }, - ] - : []), { link: 'observability-overview:alerts', }, @@ -83,6 +67,9 @@ export function createNavTree(pluginsStart: ObservabilityPublicPluginsStart) { { link: 'slo', }, + { + link: 'inventory', + }, { id: 'aiMl', title: i18n.translate('xpack.observability.obltNav.ml.aiAndMlGroupTitle', { From ff54d98ca4dd7f8a12040b622bb8cb82ffe1dcd7 Mon Sep 17 00:00:00 2001 From: Kate Patticha Date: Wed, 18 Sep 2024 14:57:50 +0300 Subject: [PATCH 03/42] Address PR comments --- .../observability_solution/inventory/public/plugin.tsx | 5 ++--- .../observability_solution/observability/public/plugin.ts | 2 -- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/x-pack/plugins/observability_solution/inventory/public/plugin.tsx b/x-pack/plugins/observability_solution/inventory/public/plugin.tsx index bdb2ecdbedf8e..f87726c865630 100644 --- a/x-pack/plugins/observability_solution/inventory/public/plugin.tsx +++ b/x-pack/plugins/observability_solution/inventory/public/plugin.tsx @@ -7,8 +7,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { i18n } from '@kbn/i18n'; -import { from } from 'rxjs'; -import { map } from 'rxjs'; +import { from, map } from 'rxjs'; import { AppMountParameters, APP_WRAPPER_CLASS, @@ -64,7 +63,7 @@ export class InventoryPlugin defaultMessage: 'Inventory', }), app: INVENTORY_APP_ID, - path: '', + path: '/', }, ], }, diff --git a/x-pack/plugins/observability_solution/observability/public/plugin.ts b/x-pack/plugins/observability_solution/observability/public/plugin.ts index d9957a39f9f43..a4b0d8e57ce4b 100644 --- a/x-pack/plugins/observability_solution/observability/public/plugin.ts +++ b/x-pack/plugins/observability_solution/observability/public/plugin.ts @@ -124,7 +124,6 @@ export interface ObservabilityPublicPluginsSetup { licensing: LicensingPluginSetup; serverless?: ServerlessPluginSetup; presentationUtil?: PresentationUtilPluginStart; - inventory?: InventoryPublicSetup; } export interface ObservabilityPublicPluginsStart { actionTypeRegistry: ActionTypeRegistryContract; @@ -163,7 +162,6 @@ export interface ObservabilityPublicPluginsStart { dataViewFieldEditor: DataViewFieldEditorStart; toastNotifications: ToastsStart; investigate?: InvestigatePublicStart; - inventory?: InventoryPublicStart; } export type ObservabilityPublicStart = ReturnType; From 3a0b5d7f9bd998f922f4c48af50d932716cce8bb Mon Sep 17 00:00:00 2001 From: iblancof Date: Wed, 18 Sep 2024 14:30:20 +0200 Subject: [PATCH 04/42] Remove config in InventoryPlugin --- .../inventory/server/config.ts | 14 -------------- .../inventory/server/index.ts | 15 ++------------- 2 files changed, 2 insertions(+), 27 deletions(-) delete mode 100644 x-pack/plugins/observability_solution/inventory/server/config.ts diff --git a/x-pack/plugins/observability_solution/inventory/server/config.ts b/x-pack/plugins/observability_solution/inventory/server/config.ts deleted file mode 100644 index 2d6d7604b40e1..0000000000000 --- a/x-pack/plugins/observability_solution/inventory/server/config.ts +++ /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 { schema, type TypeOf } from '@kbn/config-schema'; - -export const config = schema.object({ - enabled: schema.boolean({ defaultValue: false }), -}); - -export type InventoryConfig = TypeOf; diff --git a/x-pack/plugins/observability_solution/inventory/server/index.ts b/x-pack/plugins/observability_solution/inventory/server/index.ts index ad878918bad47..f24d561068c77 100644 --- a/x-pack/plugins/observability_solution/inventory/server/index.ts +++ b/x-pack/plugins/observability_solution/inventory/server/index.ts @@ -4,12 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import type { - PluginConfigDescriptor, - PluginInitializer, - PluginInitializerContext, -} from '@kbn/core/server'; -import type { InventoryConfig } from './config'; +import type { PluginInitializer, PluginInitializerContext } from '@kbn/core/server'; import { InventoryPlugin } from './plugin'; import type { InventoryServerSetup, @@ -22,16 +17,10 @@ export type { InventoryServerRouteRepository } from './routes/get_global_invento export type { InventoryServerSetup, InventoryServerStart }; -import { config as configSchema } from './config'; - -export const config: PluginConfigDescriptor = { - schema: configSchema, -}; - export const plugin: PluginInitializer< InventoryServerSetup, InventoryServerStart, InventorySetupDependencies, InventoryStartDependencies -> = async (pluginInitializerContext: PluginInitializerContext) => +> = async (pluginInitializerContext: PluginInitializerContext) => new InventoryPlugin(pluginInitializerContext); From c5a197509f2e424d678b18e96b2c34638afc9108 Mon Sep 17 00:00:00 2001 From: iblancof Date: Wed, 18 Sep 2024 14:34:08 +0200 Subject: [PATCH 05/42] Show inventory if EntityCentricExperience in stateful generic navigation --- .../observability_solution/inventory/public/plugin.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/observability_solution/inventory/public/plugin.tsx b/x-pack/plugins/observability_solution/inventory/public/plugin.tsx index f87726c865630..80a6dc2deebc5 100644 --- a/x-pack/plugins/observability_solution/inventory/public/plugin.tsx +++ b/x-pack/plugins/observability_solution/inventory/public/plugin.tsx @@ -49,6 +49,10 @@ export class InventoryPlugin pluginsSetup: InventorySetupDependencies ): InventoryPublicSetup { const inventoryAPIClient = createCallInventoryAPI(coreSetup); + const isEntityCentricExperienceSettingEnabled = coreSetup.uiSettings.get( + 'observability:entityCentricExperience', + true + ); pluginsSetup.observabilityShared.navigation.registerSections( from(coreSetup.getStartServices()).pipe( @@ -80,8 +84,8 @@ export class InventoryPlugin euiIconType: 'logoObservability', appRoute: '/app/observability/inventory', category: DEFAULT_APP_CATEGORIES.observability, - visibleIn: ['sideNav'], - order: 8001, + visibleIn: isEntityCentricExperienceSettingEnabled ? ['sideNav', 'globalSearch'] : [], + order: 8004, deepLinks: [ { id: 'inventory', From 59939631c6d5c84f782b8a0a6c73343ddadd66a2 Mon Sep 17 00:00:00 2001 From: iblancof Date: Wed, 18 Sep 2024 14:47:21 +0200 Subject: [PATCH 06/42] Show inventory if EntityCentricExperience in stateful obs navigation --- .../inventory/public/plugin.tsx | 44 ++++++++++--------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/x-pack/plugins/observability_solution/inventory/public/plugin.tsx b/x-pack/plugins/observability_solution/inventory/public/plugin.tsx index 80a6dc2deebc5..6a9b10a4a61e1 100644 --- a/x-pack/plugins/observability_solution/inventory/public/plugin.tsx +++ b/x-pack/plugins/observability_solution/inventory/public/plugin.tsx @@ -54,27 +54,29 @@ export class InventoryPlugin true ); - pluginsSetup.observabilityShared.navigation.registerSections( - from(coreSetup.getStartServices()).pipe( - map(([coreStart, pluginsStart]) => { - return [ - { - label: '', - sortKey: 101, - entries: [ - { - label: i18n.translate('xpack.inventory.inventoryLinkTitle', { - defaultMessage: 'Inventory', - }), - app: INVENTORY_APP_ID, - path: '/', - }, - ], - }, - ]; - }) - ) - ); + if (isEntityCentricExperienceSettingEnabled) { + pluginsSetup.observabilityShared.navigation.registerSections( + from(coreSetup.getStartServices()).pipe( + map(([coreStart, pluginsStart]) => { + return [ + { + label: '', + sortKey: 101, + entries: [ + { + label: i18n.translate('xpack.inventory.inventoryLinkTitle', { + defaultMessage: 'Inventory', + }), + app: INVENTORY_APP_ID, + path: '/', + }, + ], + }, + ]; + }) + ) + ); + } coreSetup.application.register({ id: INVENTORY_APP_ID, From fe3534c0e9900f12c57612744f1627f74739c930 Mon Sep 17 00:00:00 2001 From: iblancof Date: Wed, 18 Sep 2024 15:12:59 +0200 Subject: [PATCH 07/42] Add isTechnicalPreview flag to obs navigation --- .../plugins/observability_solution/inventory/public/plugin.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/plugins/observability_solution/inventory/public/plugin.tsx b/x-pack/plugins/observability_solution/inventory/public/plugin.tsx index 6a9b10a4a61e1..ba8b0c748313c 100644 --- a/x-pack/plugins/observability_solution/inventory/public/plugin.tsx +++ b/x-pack/plugins/observability_solution/inventory/public/plugin.tsx @@ -69,6 +69,7 @@ export class InventoryPlugin }), app: INVENTORY_APP_ID, path: '/', + isTechnicalPreview: true, }, ], }, From 1d98a57ee32da30a024e56ddcd6bdf21e8fc2f53 Mon Sep 17 00:00:00 2001 From: iblancof Date: Wed, 18 Sep 2024 15:14:36 +0200 Subject: [PATCH 08/42] Enable inventory deeplink only if EntityCentricExperience --- .../inventory/public/plugin.tsx | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/x-pack/plugins/observability_solution/inventory/public/plugin.tsx b/x-pack/plugins/observability_solution/inventory/public/plugin.tsx index ba8b0c748313c..a22a08f5fb164 100644 --- a/x-pack/plugins/observability_solution/inventory/public/plugin.tsx +++ b/x-pack/plugins/observability_solution/inventory/public/plugin.tsx @@ -89,15 +89,17 @@ export class InventoryPlugin category: DEFAULT_APP_CATEGORIES.observability, visibleIn: isEntityCentricExperienceSettingEnabled ? ['sideNav', 'globalSearch'] : [], order: 8004, - deepLinks: [ - { - id: 'inventory', - title: i18n.translate('xpack.inventory.inventoryDeepLinkTitle', { - defaultMessage: 'Inventory', - }), - path: '/', - }, - ], + deepLinks: isEntityCentricExperienceSettingEnabled + ? [ + { + id: 'inventory', + title: i18n.translate('xpack.inventory.inventoryDeepLinkTitle', { + defaultMessage: 'Inventory', + }), + path: '/', + }, + ] + : [], mount: async (appMountParameters: AppMountParameters) => { // Load application bundle and Get start services const [{ Application }, [coreStart, pluginsStart]] = await Promise.all([ From 38e3c2bc74c011a06f3e1b988198df935e19706f Mon Sep 17 00:00:00 2001 From: iblancof Date: Wed, 18 Sep 2024 15:20:42 +0200 Subject: [PATCH 09/42] Add inventory if EntityCentricExperience for serverless nav --- .../public/navigation_tree.ts | 516 +++++++++--------- .../serverless_observability/public/plugin.ts | 2 +- 2 files changed, 272 insertions(+), 246 deletions(-) diff --git a/x-pack/plugins/serverless_observability/public/navigation_tree.ts b/x-pack/plugins/serverless_observability/public/navigation_tree.ts index 135c687655e2e..18060fc218a0f 100644 --- a/x-pack/plugins/serverless_observability/public/navigation_tree.ts +++ b/x-pack/plugins/serverless_observability/public/navigation_tree.ts @@ -7,263 +7,289 @@ import { i18n } from '@kbn/i18n'; import type { NavigationTreeDefinition } from '@kbn/core-chrome-browser'; +import { CoreStart } from '@kbn/core/public'; -export const navigationTree: NavigationTreeDefinition = { - body: [ - { type: 'recentlyAccessed' }, - { - type: 'navGroup', - id: 'observability_project_nav', - title: 'Observability', - icon: 'logoObservability', - defaultIsCollapsed: false, - isCollapsible: false, - breadcrumbStatus: 'hidden', - children: [ - { - title: i18n.translate('xpack.serverlessObservability.nav.discover', { - defaultMessage: 'Discover', - }), - link: 'observability-logs-explorer', - // avoid duplicate "Discover" breadcrumbs - breadcrumbStatus: 'hidden', - renderAs: 'item', - children: [ - { - link: 'discover', - children: [ - { - link: 'observability-logs-explorer', - }, - ], - }, - ], - }, - { - title: i18n.translate('xpack.serverlessObservability.nav.dashboards', { - defaultMessage: 'Dashboards', - }), - link: 'dashboards', - getIsActive: ({ pathNameSerialized, prepend }) => { - return pathNameSerialized.startsWith(prepend('/app/dashboards')); +export const navigationTree = (core?: CoreStart): NavigationTreeDefinition => { + const isEntityCentricExperienceSettingEnabled = core?.uiSettings.get( + 'observability:entityCentricExperience', + true + ); + + return { + body: [ + { type: 'recentlyAccessed' }, + { + type: 'navGroup', + id: 'observability_project_nav', + title: 'Observability', + icon: 'logoObservability', + defaultIsCollapsed: false, + isCollapsible: false, + breadcrumbStatus: 'hidden', + children: [ + { + title: i18n.translate('xpack.serverlessObservability.nav.discover', { + defaultMessage: 'Discover', + }), + link: 'observability-logs-explorer', + // avoid duplicate "Discover" breadcrumbs + breadcrumbStatus: 'hidden', + renderAs: 'item', + children: [ + { + link: 'discover', + children: [ + { + link: 'observability-logs-explorer', + }, + ], + }, + ], }, - }, - { - link: 'observability-overview:alerts', - }, - { - link: 'observability-overview:cases', - renderAs: 'item', - children: [ - { - link: 'observability-overview:cases_configure', - }, - { - link: 'observability-overview:cases_create', + { + title: i18n.translate('xpack.serverlessObservability.nav.dashboards', { + defaultMessage: 'Dashboards', + }), + link: 'dashboards', + getIsActive: ({ pathNameSerialized, prepend }) => { + return pathNameSerialized.startsWith(prepend('/app/dashboards')); }, - ], - }, - { - title: i18n.translate('xpack.serverlessObservability.nav.slo', { - defaultMessage: 'SLOs', - }), - link: 'slo', - }, - { - id: 'aiops', - title: 'AIOps', - link: 'ml:anomalyDetection', - renderAs: 'accordion', - spaceBefore: null, - children: [ - { - title: i18n.translate('xpack.serverlessObservability.nav.ml.jobs', { - defaultMessage: 'Anomaly detection', - }), - link: 'ml:anomalyDetection', - id: 'ml:anomalyDetection', - renderAs: 'item', - children: [ + }, + { + link: 'observability-overview:alerts', + }, + { + link: 'observability-overview:cases', + renderAs: 'item', + children: [ + { + link: 'observability-overview:cases_configure', + }, + { + link: 'observability-overview:cases_create', + }, + ], + }, + ...(isEntityCentricExperienceSettingEnabled + ? [ { - link: 'ml:singleMetricViewer', + link: 'inventory' as const, + getIsActive: ({ + pathNameSerialized, + prepend, + }: { + pathNameSerialized: string; + prepend: (path: string) => string; + }) => { + return pathNameSerialized.startsWith(prepend('/app/observability/inventory')); + }, }, - { - link: 'ml:anomalyExplorer', + ] + : []), + { + title: i18n.translate('xpack.serverlessObservability.nav.slo', { + defaultMessage: 'SLOs', + }), + link: 'slo', + }, + { + id: 'aiops', + title: 'AIOps', + link: 'ml:anomalyDetection', + renderAs: 'accordion', + spaceBefore: null, + children: [ + { + title: i18n.translate('xpack.serverlessObservability.nav.ml.jobs', { + defaultMessage: 'Anomaly detection', + }), + link: 'ml:anomalyDetection', + id: 'ml:anomalyDetection', + renderAs: 'item', + children: [ + { + link: 'ml:singleMetricViewer', + }, + { + link: 'ml:anomalyExplorer', + }, + { + link: 'ml:settings', + }, + ], + }, + { + title: i18n.translate('xpack.serverlessObservability.ml.logRateAnalysis', { + defaultMessage: 'Log rate analysis', + }), + link: 'ml:logRateAnalysis', + getIsActive: ({ pathNameSerialized, prepend }) => { + return pathNameSerialized.includes(prepend('/app/ml/aiops/log_rate_analysis')); }, - { - link: 'ml:settings', + }, + { + title: i18n.translate('xpack.serverlessObservability.ml.changePointDetection', { + defaultMessage: 'Change point detection', + }), + link: 'ml:changePointDetections', + getIsActive: ({ pathNameSerialized, prepend }) => { + return pathNameSerialized.includes( + prepend('/app/ml/aiops/change_point_detection') + ); }, - ], - }, - { - title: i18n.translate('xpack.serverlessObservability.ml.logRateAnalysis', { - defaultMessage: 'Log rate analysis', - }), - link: 'ml:logRateAnalysis', - getIsActive: ({ pathNameSerialized, prepend }) => { - return pathNameSerialized.includes(prepend('/app/ml/aiops/log_rate_analysis')); }, - }, - { - title: i18n.translate('xpack.serverlessObservability.ml.changePointDetection', { - defaultMessage: 'Change point detection', - }), - link: 'ml:changePointDetections', - getIsActive: ({ pathNameSerialized, prepend }) => { - return pathNameSerialized.includes(prepend('/app/ml/aiops/change_point_detection')); + { + title: i18n.translate('xpack.serverlessObservability.nav.ml.job.notifications', { + defaultMessage: 'Job notifications', + }), + link: 'ml:notifications', }, - }, - { - title: i18n.translate('xpack.serverlessObservability.nav.ml.job.notifications', { - defaultMessage: 'Job notifications', - }), - link: 'ml:notifications', - }, - ], - }, - { - id: 'apm', - title: i18n.translate('xpack.serverlessObservability.nav.applications', { - defaultMessage: 'Applications', - }), - link: 'apm:services', - renderAs: 'accordion', - children: [ - { - link: 'apm:services', - getIsActive: ({ pathNameSerialized }) => { - const regex = /app\/apm\/.*service.*/; - return regex.test(pathNameSerialized); + ], + }, + { + id: 'apm', + title: i18n.translate('xpack.serverlessObservability.nav.applications', { + defaultMessage: 'Applications', + }), + link: 'apm:services', + renderAs: 'accordion', + children: [ + { + link: 'apm:services', + getIsActive: ({ pathNameSerialized }) => { + const regex = /app\/apm\/.*service.*/; + return regex.test(pathNameSerialized); + }, }, - }, - { - link: 'apm:traces', - getIsActive: ({ pathNameSerialized, prepend }) => { - return pathNameSerialized.startsWith(prepend('/app/apm/traces')); + { + link: 'apm:traces', + getIsActive: ({ pathNameSerialized, prepend }) => { + return pathNameSerialized.startsWith(prepend('/app/apm/traces')); + }, }, - }, - { - link: 'apm:dependencies', - getIsActive: ({ pathNameSerialized, prepend }) => { - return pathNameSerialized.startsWith(prepend('/app/apm/dependencies')); + { + link: 'apm:dependencies', + getIsActive: ({ pathNameSerialized, prepend }) => { + return pathNameSerialized.startsWith(prepend('/app/apm/dependencies')); + }, }, - }, - { - link: 'apm:settings', - sideNavStatus: 'hidden', // only to be considered in the breadcrumbs - }, - ], - }, - { - id: 'metrics', - title: i18n.translate('xpack.serverlessObservability.nav.infrastructure', { - defaultMessage: 'Infrastructure', - }), - link: 'metrics:inventory', - renderAs: 'accordion', - children: [ - { - link: 'metrics:inventory', - getIsActive: ({ pathNameSerialized, prepend }) => { - return pathNameSerialized.startsWith(prepend('/app/metrics/inventory')); + { + link: 'apm:settings', + sideNavStatus: 'hidden', // only to be considered in the breadcrumbs }, - }, - { - link: 'metrics:hosts', - getIsActive: ({ pathNameSerialized, prepend }) => { - return pathNameSerialized.startsWith(prepend('/app/metrics/hosts')); + ], + }, + { + id: 'metrics', + title: i18n.translate('xpack.serverlessObservability.nav.infrastructure', { + defaultMessage: 'Infrastructure', + }), + link: 'metrics:inventory', + renderAs: 'accordion', + children: [ + { + link: 'metrics:inventory', + getIsActive: ({ pathNameSerialized, prepend }) => { + return pathNameSerialized.startsWith(prepend('/app/metrics/inventory')); + }, }, - }, - { - link: 'metrics:settings', - sideNavStatus: 'hidden', // only to be considered in the breadcrumbs - }, - { - link: 'metrics:assetDetails', - sideNavStatus: 'hidden', // only to be considered in the breadcrumbs - }, - ], - }, - { - id: 'synthetics', - title: i18n.translate('xpack.serverlessObservability.nav.synthetics', { - defaultMessage: 'Synthetics', - }), - renderAs: 'accordion', - breadcrumbStatus: 'hidden', - children: [ - { - title: i18n.translate('xpack.serverlessObservability.nav.synthetics.overviewItem', { - defaultMessage: 'Overview', - }), - id: 'synthetics-overview', - link: 'synthetics:overview', - breadcrumbStatus: 'hidden', - }, - { - link: 'synthetics:certificates', - title: i18n.translate( - 'xpack.serverlessObservability.nav.synthetics.certificatesItem', - { - defaultMessage: 'TLS Certificates', - } - ), - id: 'synthetics-certificates', - breadcrumbStatus: 'hidden', - }, - ], - }, - ], - }, - ], - footer: [ - { - type: 'navItem', - title: i18n.translate('xpack.serverlessObservability.nav.getStarted', { - defaultMessage: 'Add data', - }), - link: 'observabilityOnboarding', - icon: 'launch', - }, - { - type: 'navItem', - id: 'devTools', - title: i18n.translate('xpack.serverlessObservability.nav.devTools', { - defaultMessage: 'Developer tools', - }), - link: 'dev_tools', - icon: 'editorCodeBlock', - }, - { - type: 'navGroup', - id: 'project_settings_project_nav', - title: i18n.translate('xpack.serverlessObservability.nav.projectSettings', { - defaultMessage: 'Project settings', - }), - icon: 'gear', - breadcrumbStatus: 'hidden', - children: [ - { - link: 'management', - title: i18n.translate('xpack.serverlessObservability.nav.mngt', { - defaultMessage: 'Management', - }), - }, - { - link: 'integrations', - }, - { - link: 'fleet', - }, - { - id: 'cloudLinkUserAndRoles', - cloudLink: 'userAndRoles', - }, - { - id: 'cloudLinkBilling', - cloudLink: 'billingAndSub', - }, - ], - }, - ], + { + link: 'metrics:hosts', + getIsActive: ({ pathNameSerialized, prepend }) => { + return pathNameSerialized.startsWith(prepend('/app/metrics/hosts')); + }, + }, + { + link: 'metrics:settings', + sideNavStatus: 'hidden', // only to be considered in the breadcrumbs + }, + { + link: 'metrics:assetDetails', + sideNavStatus: 'hidden', // only to be considered in the breadcrumbs + }, + ], + }, + { + id: 'synthetics', + title: i18n.translate('xpack.serverlessObservability.nav.synthetics', { + defaultMessage: 'Synthetics', + }), + renderAs: 'accordion', + breadcrumbStatus: 'hidden', + children: [ + { + title: i18n.translate('xpack.serverlessObservability.nav.synthetics.overviewItem', { + defaultMessage: 'Overview', + }), + id: 'synthetics-overview', + link: 'synthetics:overview', + breadcrumbStatus: 'hidden', + }, + { + link: 'synthetics:certificates', + title: i18n.translate( + 'xpack.serverlessObservability.nav.synthetics.certificatesItem', + { + defaultMessage: 'TLS Certificates', + } + ), + id: 'synthetics-certificates', + breadcrumbStatus: 'hidden', + }, + ], + }, + ], + }, + ], + footer: [ + { + type: 'navItem', + title: i18n.translate('xpack.serverlessObservability.nav.getStarted', { + defaultMessage: 'Add data', + }), + link: 'observabilityOnboarding', + icon: 'launch', + }, + { + type: 'navItem', + id: 'devTools', + title: i18n.translate('xpack.serverlessObservability.nav.devTools', { + defaultMessage: 'Developer tools', + }), + link: 'dev_tools', + icon: 'editorCodeBlock', + }, + { + type: 'navGroup', + id: 'project_settings_project_nav', + title: i18n.translate('xpack.serverlessObservability.nav.projectSettings', { + defaultMessage: 'Project settings', + }), + icon: 'gear', + breadcrumbStatus: 'hidden', + children: [ + { + link: 'management', + title: i18n.translate('xpack.serverlessObservability.nav.mngt', { + defaultMessage: 'Management', + }), + }, + { + link: 'integrations', + }, + { + link: 'fleet', + }, + { + id: 'cloudLinkUserAndRoles', + cloudLink: 'userAndRoles', + }, + { + id: 'cloudLinkBilling', + cloudLink: 'billingAndSub', + }, + ], + }, + ], + }; }; diff --git a/x-pack/plugins/serverless_observability/public/plugin.ts b/x-pack/plugins/serverless_observability/public/plugin.ts index 25cb2dae38192..163da944b05b7 100644 --- a/x-pack/plugins/serverless_observability/public/plugin.ts +++ b/x-pack/plugins/serverless_observability/public/plugin.ts @@ -50,7 +50,7 @@ export class ServerlessObservabilityPlugin setupDeps: ServerlessObservabilityPublicStartDependencies ): ServerlessObservabilityPublicStart { const { serverless, management, security } = setupDeps; - const navigationTree$ = of(navigationTree); + const navigationTree$ = of(navigationTree(core)); serverless.setProjectHome('/app/observability/landing'); serverless.initNavigation('oblt', navigationTree$, { dataTestSubj: 'svlObservabilitySideNav' }); const aiAssistantIsEnabled = core.application.capabilities.observabilityAIAssistant?.show; From 2cd411f97917a4a30aaee825a079f020025c7cb6 Mon Sep 17 00:00:00 2001 From: iblancof Date: Thu, 19 Sep 2024 10:43:48 +0200 Subject: [PATCH 10/42] Remove duplicate plugin register on merge --- .../inventory/public/plugin.tsx | 28 ++----------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/x-pack/plugins/observability_solution/inventory/public/plugin.tsx b/x-pack/plugins/observability_solution/inventory/public/plugin.tsx index 0e8c620afb42b..7606f8ff3e552 100644 --- a/x-pack/plugins/observability_solution/inventory/public/plugin.tsx +++ b/x-pack/plugins/observability_solution/inventory/public/plugin.tsx @@ -69,6 +69,9 @@ export class InventoryPlugin }), app: INVENTORY_APP_ID, path: '/', + matchPath(currentPath: string) { + return ['/', ''].some((testPath) => currentPath.startsWith(testPath)); + }, isTechnicalPreview: true, }, ], @@ -79,31 +82,6 @@ export class InventoryPlugin ); } - pluginsSetup.observabilityShared.navigation.registerSections( - from(coreSetup.getStartServices()).pipe( - map(([coreStart, pluginsStart]) => { - return [ - { - label: '', - sortKey: 101, - entries: [ - { - label: i18n.translate('xpack.inventory.inventoryLinkTitle', { - defaultMessage: 'Inventory', - }), - app: INVENTORY_APP_ID, - path: '/', - matchPath(currentPath: string) { - return ['/', ''].some((testPath) => currentPath.startsWith(testPath)); - }, - }, - ], - }, - ]; - }) - ) - ); - coreSetup.application.register({ id: INVENTORY_APP_ID, title: i18n.translate('xpack.inventory.appTitle', { From c516aea5715b9cf55be11916abfc9d69a44b6dd6 Mon Sep 17 00:00:00 2001 From: iblancof Date: Thu, 19 Sep 2024 11:09:43 +0200 Subject: [PATCH 11/42] Use const for entityCentricExperience --- .../plugins/observability_solution/inventory/public/plugin.tsx | 3 ++- .../plugins/serverless_observability/public/navigation_tree.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/observability_solution/inventory/public/plugin.tsx b/x-pack/plugins/observability_solution/inventory/public/plugin.tsx index 7606f8ff3e552..23364fdce9f41 100644 --- a/x-pack/plugins/observability_solution/inventory/public/plugin.tsx +++ b/x-pack/plugins/observability_solution/inventory/public/plugin.tsx @@ -20,6 +20,7 @@ import { import type { Logger } from '@kbn/logging'; import { INVENTORY_APP_ID } from '@kbn/deeplinks-observability/constants'; import { css } from '@emotion/css'; +import { entityCentricExperience } from '@kbn/observability-plugin/common/ui_settings_keys'; import type { ConfigSchema, InventoryPublicSetup, @@ -50,7 +51,7 @@ export class InventoryPlugin ): InventoryPublicSetup { const inventoryAPIClient = createCallInventoryAPI(coreSetup); const isEntityCentricExperienceSettingEnabled = coreSetup.uiSettings.get( - 'observability:entityCentricExperience', + entityCentricExperience, true ); diff --git a/x-pack/plugins/serverless_observability/public/navigation_tree.ts b/x-pack/plugins/serverless_observability/public/navigation_tree.ts index 18060fc218a0f..8ae69ef0ec329 100644 --- a/x-pack/plugins/serverless_observability/public/navigation_tree.ts +++ b/x-pack/plugins/serverless_observability/public/navigation_tree.ts @@ -8,10 +8,11 @@ import { i18n } from '@kbn/i18n'; import type { NavigationTreeDefinition } from '@kbn/core-chrome-browser'; import { CoreStart } from '@kbn/core/public'; +import { entityCentricExperience } from '@kbn/observability-plugin/common/ui_settings_keys'; export const navigationTree = (core?: CoreStart): NavigationTreeDefinition => { const isEntityCentricExperienceSettingEnabled = core?.uiSettings.get( - 'observability:entityCentricExperience', + entityCentricExperience, true ); From 7b4d66ec459b2bac433d804ae5a2565488124bdd Mon Sep 17 00:00:00 2001 From: iblancof Date: Thu, 19 Sep 2024 11:28:46 +0200 Subject: [PATCH 12/42] Revert "Remove duplicate plugin register on merge" This reverts commit 2cd411f97917a4a30aaee825a079f020025c7cb6. --- .../inventory/public/plugin.tsx | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/observability_solution/inventory/public/plugin.tsx b/x-pack/plugins/observability_solution/inventory/public/plugin.tsx index 23364fdce9f41..684be528daf5a 100644 --- a/x-pack/plugins/observability_solution/inventory/public/plugin.tsx +++ b/x-pack/plugins/observability_solution/inventory/public/plugin.tsx @@ -70,9 +70,6 @@ export class InventoryPlugin }), app: INVENTORY_APP_ID, path: '/', - matchPath(currentPath: string) { - return ['/', ''].some((testPath) => currentPath.startsWith(testPath)); - }, isTechnicalPreview: true, }, ], @@ -83,6 +80,31 @@ export class InventoryPlugin ); } + pluginsSetup.observabilityShared.navigation.registerSections( + from(coreSetup.getStartServices()).pipe( + map(([coreStart, pluginsStart]) => { + return [ + { + label: '', + sortKey: 101, + entries: [ + { + label: i18n.translate('xpack.inventory.inventoryLinkTitle', { + defaultMessage: 'Inventory', + }), + app: INVENTORY_APP_ID, + path: '/', + matchPath(currentPath: string) { + return ['/', ''].some((testPath) => currentPath.startsWith(testPath)); + }, + }, + ], + }, + ]; + }) + ) + ); + coreSetup.application.register({ id: INVENTORY_APP_ID, title: i18n.translate('xpack.inventory.appTitle', { From a49e313203f5310e977059dddb26ae99f6824467 Mon Sep 17 00:00:00 2001 From: iblancof Date: Thu, 19 Sep 2024 11:33:05 +0200 Subject: [PATCH 13/42] Remove usage of const for entityCentricExperience --- .../observability_solution/inventory/public/plugin.tsx | 3 +-- .../serverless_observability/public/navigation_tree.ts | 7 +++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/observability_solution/inventory/public/plugin.tsx b/x-pack/plugins/observability_solution/inventory/public/plugin.tsx index 684be528daf5a..0e8c620afb42b 100644 --- a/x-pack/plugins/observability_solution/inventory/public/plugin.tsx +++ b/x-pack/plugins/observability_solution/inventory/public/plugin.tsx @@ -20,7 +20,6 @@ import { import type { Logger } from '@kbn/logging'; import { INVENTORY_APP_ID } from '@kbn/deeplinks-observability/constants'; import { css } from '@emotion/css'; -import { entityCentricExperience } from '@kbn/observability-plugin/common/ui_settings_keys'; import type { ConfigSchema, InventoryPublicSetup, @@ -51,7 +50,7 @@ export class InventoryPlugin ): InventoryPublicSetup { const inventoryAPIClient = createCallInventoryAPI(coreSetup); const isEntityCentricExperienceSettingEnabled = coreSetup.uiSettings.get( - entityCentricExperience, + 'observability:entityCentricExperience', true ); diff --git a/x-pack/plugins/serverless_observability/public/navigation_tree.ts b/x-pack/plugins/serverless_observability/public/navigation_tree.ts index 8ae69ef0ec329..1cf1fd5c88c3d 100644 --- a/x-pack/plugins/serverless_observability/public/navigation_tree.ts +++ b/x-pack/plugins/serverless_observability/public/navigation_tree.ts @@ -8,11 +8,10 @@ import { i18n } from '@kbn/i18n'; import type { NavigationTreeDefinition } from '@kbn/core-chrome-browser'; import { CoreStart } from '@kbn/core/public'; -import { entityCentricExperience } from '@kbn/observability-plugin/common/ui_settings_keys'; export const navigationTree = (core?: CoreStart): NavigationTreeDefinition => { const isEntityCentricExperienceSettingEnabled = core?.uiSettings.get( - entityCentricExperience, + 'observability:entityCentricExperience', true ); @@ -74,6 +73,7 @@ export const navigationTree = (core?: CoreStart): NavigationTreeDefinition => { ...(isEntityCentricExperienceSettingEnabled ? [ { + title: 'pepito', link: 'inventory' as const, getIsActive: ({ pathNameSerialized, @@ -84,6 +84,8 @@ export const navigationTree = (core?: CoreStart): NavigationTreeDefinition => { }) => { return pathNameSerialized.startsWith(prepend('/app/observability/inventory')); }, + withBadge: true, + badgeOptions: { text: 'NEW' }, }, ] : []), @@ -161,6 +163,7 @@ export const navigationTree = (core?: CoreStart): NavigationTreeDefinition => { const regex = /app\/apm\/.*service.*/; return regex.test(pathNameSerialized); }, + withBadge: true, }, { link: 'apm:traces', From 593ee7de5238add375202b24b770601fce010737 Mon Sep 17 00:00:00 2001 From: iblancof Date: Thu, 19 Sep 2024 11:39:11 +0200 Subject: [PATCH 14/42] Handle app status during plugin start based on isEntityCentricExperienceSettingEnabled --- .../inventory/public/plugin.tsx | 64 ++++++++----------- 1 file changed, 26 insertions(+), 38 deletions(-) diff --git a/x-pack/plugins/observability_solution/inventory/public/plugin.tsx b/x-pack/plugins/observability_solution/inventory/public/plugin.tsx index 0e8c620afb42b..a5687df5d51b4 100644 --- a/x-pack/plugins/observability_solution/inventory/public/plugin.tsx +++ b/x-pack/plugins/observability_solution/inventory/public/plugin.tsx @@ -7,7 +7,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { i18n } from '@kbn/i18n'; -import { from, map } from 'rxjs'; +import { BehaviorSubject, from, map } from 'rxjs'; import { AppMountParameters, APP_WRAPPER_CLASS, @@ -16,6 +16,8 @@ import { DEFAULT_APP_CATEGORIES, Plugin, PluginInitializerContext, + AppStatus, + AppUpdater, } from '@kbn/core/public'; import type { Logger } from '@kbn/logging'; import { INVENTORY_APP_ID } from '@kbn/deeplinks-observability/constants'; @@ -40,6 +42,7 @@ export class InventoryPlugin > { logger: Logger; + inventoryAppUpdater = new BehaviorSubject(() => ({})); constructor(context: PluginInitializerContext) { this.logger = context.logger.get(); @@ -79,31 +82,6 @@ export class InventoryPlugin ); } - pluginsSetup.observabilityShared.navigation.registerSections( - from(coreSetup.getStartServices()).pipe( - map(([coreStart, pluginsStart]) => { - return [ - { - label: '', - sortKey: 101, - entries: [ - { - label: i18n.translate('xpack.inventory.inventoryLinkTitle', { - defaultMessage: 'Inventory', - }), - app: INVENTORY_APP_ID, - path: '/', - matchPath(currentPath: string) { - return ['/', ''].some((testPath) => currentPath.startsWith(testPath)); - }, - }, - ], - }, - ]; - }) - ) - ); - coreSetup.application.register({ id: INVENTORY_APP_ID, title: i18n.translate('xpack.inventory.appTitle', { @@ -112,19 +90,17 @@ export class InventoryPlugin euiIconType: 'logoObservability', appRoute: '/app/observability/inventory', category: DEFAULT_APP_CATEGORIES.observability, - visibleIn: isEntityCentricExperienceSettingEnabled ? ['sideNav', 'globalSearch'] : [], + visibleIn: ['sideNav', 'globalSearch'], order: 8004, - deepLinks: isEntityCentricExperienceSettingEnabled - ? [ - { - id: 'inventory', - title: i18n.translate('xpack.inventory.inventoryDeepLinkTitle', { - defaultMessage: 'Inventory', - }), - path: '/', - }, - ] - : [], + deepLinks: [ + { + id: 'inventory', + title: i18n.translate('xpack.inventory.inventoryDeepLinkTitle', { + defaultMessage: 'Inventory', + }), + path: '/', + }, + ], mount: async (appMountParameters: AppMountParameters) => { // Load application bundle and Get start services const [{ Application }, [coreStart, pluginsStart]] = await Promise.all([ @@ -160,12 +136,24 @@ export class InventoryPlugin appWrapperElement.classList.remove(appWrapperClassName); }; }, + updater$: this.inventoryAppUpdater, }); return {}; } start(coreStart: CoreStart, pluginsStart: InventoryStartDependencies): InventoryPublicStart { + const isEntityCentricExperienceSettingEnabled = coreStart.uiSettings.get( + 'observability:entityCentricExperience', + true + ); + + this.inventoryAppUpdater.next(() => ({ + status: isEntityCentricExperienceSettingEnabled + ? AppStatus.accessible + : AppStatus.inaccessible, + })); + return {}; } } From e8f11e19d855d21ed64a64c64f5e2fea4ddd6c89 Mon Sep 17 00:00:00 2001 From: iblancof Date: Thu, 19 Sep 2024 11:52:49 +0200 Subject: [PATCH 15/42] Manage inventory plugin register status --- .../inventory/public/plugin.tsx | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/x-pack/plugins/observability_solution/inventory/public/plugin.tsx b/x-pack/plugins/observability_solution/inventory/public/plugin.tsx index a5687df5d51b4..7a21bcc803991 100644 --- a/x-pack/plugins/observability_solution/inventory/public/plugin.tsx +++ b/x-pack/plugins/observability_solution/inventory/public/plugin.tsx @@ -7,7 +7,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { i18n } from '@kbn/i18n'; -import { BehaviorSubject, from, map } from 'rxjs'; +import { from, map } from 'rxjs'; import { AppMountParameters, APP_WRAPPER_CLASS, @@ -17,7 +17,6 @@ import { Plugin, PluginInitializerContext, AppStatus, - AppUpdater, } from '@kbn/core/public'; import type { Logger } from '@kbn/logging'; import { INVENTORY_APP_ID } from '@kbn/deeplinks-observability/constants'; @@ -42,7 +41,6 @@ export class InventoryPlugin > { logger: Logger; - inventoryAppUpdater = new BehaviorSubject(() => ({})); constructor(context: PluginInitializerContext) { this.logger = context.logger.get(); @@ -92,6 +90,9 @@ export class InventoryPlugin category: DEFAULT_APP_CATEGORIES.observability, visibleIn: ['sideNav', 'globalSearch'], order: 8004, + status: isEntityCentricExperienceSettingEnabled + ? AppStatus.accessible + : AppStatus.inaccessible, deepLinks: [ { id: 'inventory', @@ -136,24 +137,12 @@ export class InventoryPlugin appWrapperElement.classList.remove(appWrapperClassName); }; }, - updater$: this.inventoryAppUpdater, }); return {}; } start(coreStart: CoreStart, pluginsStart: InventoryStartDependencies): InventoryPublicStart { - const isEntityCentricExperienceSettingEnabled = coreStart.uiSettings.get( - 'observability:entityCentricExperience', - true - ); - - this.inventoryAppUpdater.next(() => ({ - status: isEntityCentricExperienceSettingEnabled - ? AppStatus.accessible - : AppStatus.inaccessible, - })); - return {}; } } From 18d9b7e330bdabb385529394b92041eb29a21c82 Mon Sep 17 00:00:00 2001 From: iblancof Date: Thu, 19 Sep 2024 12:50:43 +0200 Subject: [PATCH 16/42] Revert serverless obs nav tree changes --- .../public/navigation_tree.ts | 522 +++++++++--------- .../serverless_observability/public/plugin.ts | 2 +- 2 files changed, 248 insertions(+), 276 deletions(-) diff --git a/x-pack/plugins/serverless_observability/public/navigation_tree.ts b/x-pack/plugins/serverless_observability/public/navigation_tree.ts index 1cf1fd5c88c3d..100036fc488ab 100644 --- a/x-pack/plugins/serverless_observability/public/navigation_tree.ts +++ b/x-pack/plugins/serverless_observability/public/navigation_tree.ts @@ -7,293 +7,265 @@ import { i18n } from '@kbn/i18n'; import type { NavigationTreeDefinition } from '@kbn/core-chrome-browser'; -import { CoreStart } from '@kbn/core/public'; -export const navigationTree = (core?: CoreStart): NavigationTreeDefinition => { - const isEntityCentricExperienceSettingEnabled = core?.uiSettings.get( - 'observability:entityCentricExperience', - true - ); - - return { - body: [ - { type: 'recentlyAccessed' }, - { - type: 'navGroup', - id: 'observability_project_nav', - title: 'Observability', - icon: 'logoObservability', - defaultIsCollapsed: false, - isCollapsible: false, - breadcrumbStatus: 'hidden', - children: [ - { - title: i18n.translate('xpack.serverlessObservability.nav.discover', { - defaultMessage: 'Discover', - }), - link: 'observability-logs-explorer', - // avoid duplicate "Discover" breadcrumbs - breadcrumbStatus: 'hidden', - renderAs: 'item', - children: [ - { - link: 'discover', - children: [ - { - link: 'observability-logs-explorer', - }, - ], - }, - ], - }, - { - title: i18n.translate('xpack.serverlessObservability.nav.dashboards', { - defaultMessage: 'Dashboards', - }), - link: 'dashboards', - getIsActive: ({ pathNameSerialized, prepend }) => { - return pathNameSerialized.startsWith(prepend('/app/dashboards')); - }, - }, - { - link: 'observability-overview:alerts', - }, - { - link: 'observability-overview:cases', - renderAs: 'item', - children: [ - { - link: 'observability-overview:cases_configure', - }, - { - link: 'observability-overview:cases_create', - }, - ], - }, - ...(isEntityCentricExperienceSettingEnabled - ? [ +export const navigationTree: NavigationTreeDefinition = { + body: [ + { type: 'recentlyAccessed' }, + { + type: 'navGroup', + id: 'observability_project_nav', + title: 'Observability', + icon: 'logoObservability', + defaultIsCollapsed: false, + isCollapsible: false, + breadcrumbStatus: 'hidden', + children: [ + { + title: i18n.translate('xpack.serverlessObservability.nav.discover', { + defaultMessage: 'Discover', + }), + link: 'observability-logs-explorer', + // avoid duplicate "Discover" breadcrumbs + breadcrumbStatus: 'hidden', + renderAs: 'item', + children: [ + { + link: 'discover', + children: [ { - title: 'pepito', - link: 'inventory' as const, - getIsActive: ({ - pathNameSerialized, - prepend, - }: { - pathNameSerialized: string; - prepend: (path: string) => string; - }) => { - return pathNameSerialized.startsWith(prepend('/app/observability/inventory')); - }, - withBadge: true, - badgeOptions: { text: 'NEW' }, - }, - ] - : []), - { - title: i18n.translate('xpack.serverlessObservability.nav.slo', { - defaultMessage: 'SLOs', - }), - link: 'slo', - }, - { - id: 'aiops', - title: 'AIOps', - link: 'ml:anomalyDetection', - renderAs: 'accordion', - spaceBefore: null, - children: [ - { - title: i18n.translate('xpack.serverlessObservability.nav.ml.jobs', { - defaultMessage: 'Anomaly detection', - }), - link: 'ml:anomalyDetection', - id: 'ml:anomalyDetection', - renderAs: 'item', - children: [ - { - link: 'ml:singleMetricViewer', - }, - { - link: 'ml:anomalyExplorer', - }, - { - link: 'ml:settings', - }, - ], - }, - { - title: i18n.translate('xpack.serverlessObservability.ml.logRateAnalysis', { - defaultMessage: 'Log rate analysis', - }), - link: 'ml:logRateAnalysis', - getIsActive: ({ pathNameSerialized, prepend }) => { - return pathNameSerialized.includes(prepend('/app/ml/aiops/log_rate_analysis')); + link: 'observability-logs-explorer', }, - }, - { - title: i18n.translate('xpack.serverlessObservability.ml.changePointDetection', { - defaultMessage: 'Change point detection', - }), - link: 'ml:changePointDetections', - getIsActive: ({ pathNameSerialized, prepend }) => { - return pathNameSerialized.includes( - prepend('/app/ml/aiops/change_point_detection') - ); - }, - }, - { - title: i18n.translate('xpack.serverlessObservability.nav.ml.job.notifications', { - defaultMessage: 'Job notifications', - }), - link: 'ml:notifications', - }, - ], + ], + }, + ], + }, + { + title: i18n.translate('xpack.serverlessObservability.nav.dashboards', { + defaultMessage: 'Dashboards', + }), + link: 'dashboards', + getIsActive: ({ pathNameSerialized, prepend }) => { + return pathNameSerialized.startsWith(prepend('/app/dashboards')); }, - { - id: 'apm', - title: i18n.translate('xpack.serverlessObservability.nav.applications', { - defaultMessage: 'Applications', - }), - link: 'apm:services', - renderAs: 'accordion', - children: [ - { - link: 'apm:services', - getIsActive: ({ pathNameSerialized }) => { - const regex = /app\/apm\/.*service.*/; - return regex.test(pathNameSerialized); + }, + { + link: 'observability-overview:alerts', + }, + { + link: 'observability-overview:cases', + renderAs: 'item', + children: [ + { + link: 'observability-overview:cases_configure', + }, + { + link: 'observability-overview:cases_create', + }, + ], + }, + { + title: i18n.translate('xpack.serverlessObservability.nav.slo', { + defaultMessage: 'SLOs', + }), + link: 'slo', + }, + { link: 'inventory' }, + { + id: 'aiops', + title: 'AIOps', + link: 'ml:anomalyDetection', + renderAs: 'accordion', + spaceBefore: null, + children: [ + { + title: i18n.translate('xpack.serverlessObservability.nav.ml.jobs', { + defaultMessage: 'Anomaly detection', + }), + link: 'ml:anomalyDetection', + id: 'ml:anomalyDetection', + renderAs: 'item', + children: [ + { + link: 'ml:singleMetricViewer', }, - withBadge: true, - }, - { - link: 'apm:traces', - getIsActive: ({ pathNameSerialized, prepend }) => { - return pathNameSerialized.startsWith(prepend('/app/apm/traces')); + { + link: 'ml:anomalyExplorer', }, - }, - { - link: 'apm:dependencies', - getIsActive: ({ pathNameSerialized, prepend }) => { - return pathNameSerialized.startsWith(prepend('/app/apm/dependencies')); + { + link: 'ml:settings', }, + ], + }, + { + title: i18n.translate('xpack.serverlessObservability.ml.logRateAnalysis', { + defaultMessage: 'Log rate analysis', + }), + link: 'ml:logRateAnalysis', + getIsActive: ({ pathNameSerialized, prepend }) => { + return pathNameSerialized.includes(prepend('/app/ml/aiops/log_rate_analysis')); }, - { - link: 'apm:settings', - sideNavStatus: 'hidden', // only to be considered in the breadcrumbs - }, - ], - }, - { - id: 'metrics', - title: i18n.translate('xpack.serverlessObservability.nav.infrastructure', { - defaultMessage: 'Infrastructure', - }), - link: 'metrics:inventory', - renderAs: 'accordion', - children: [ - { - link: 'metrics:inventory', - getIsActive: ({ pathNameSerialized, prepend }) => { - return pathNameSerialized.startsWith(prepend('/app/metrics/inventory')); - }, + }, + { + title: i18n.translate('xpack.serverlessObservability.ml.changePointDetection', { + defaultMessage: 'Change point detection', + }), + link: 'ml:changePointDetections', + getIsActive: ({ pathNameSerialized, prepend }) => { + return pathNameSerialized.includes(prepend('/app/ml/aiops/change_point_detection')); }, - { - link: 'metrics:hosts', - getIsActive: ({ pathNameSerialized, prepend }) => { - return pathNameSerialized.startsWith(prepend('/app/metrics/hosts')); - }, + }, + { + title: i18n.translate('xpack.serverlessObservability.nav.ml.job.notifications', { + defaultMessage: 'Job notifications', + }), + link: 'ml:notifications', + }, + ], + }, + { + id: 'apm', + title: i18n.translate('xpack.serverlessObservability.nav.applications', { + defaultMessage: 'Applications', + }), + link: 'apm:services', + renderAs: 'accordion', + children: [ + { + link: 'apm:services', + getIsActive: ({ pathNameSerialized }) => { + const regex = /app\/apm\/.*service.*/; + return regex.test(pathNameSerialized); }, - { - link: 'metrics:settings', - sideNavStatus: 'hidden', // only to be considered in the breadcrumbs + withBadge: true, + }, + { + link: 'apm:traces', + getIsActive: ({ pathNameSerialized, prepend }) => { + return pathNameSerialized.startsWith(prepend('/app/apm/traces')); }, - { - link: 'metrics:assetDetails', - sideNavStatus: 'hidden', // only to be considered in the breadcrumbs + }, + { + link: 'apm:dependencies', + getIsActive: ({ pathNameSerialized, prepend }) => { + return pathNameSerialized.startsWith(prepend('/app/apm/dependencies')); }, - ], - }, - { - id: 'synthetics', - title: i18n.translate('xpack.serverlessObservability.nav.synthetics', { - defaultMessage: 'Synthetics', - }), - renderAs: 'accordion', - breadcrumbStatus: 'hidden', - children: [ - { - title: i18n.translate('xpack.serverlessObservability.nav.synthetics.overviewItem', { - defaultMessage: 'Overview', - }), - id: 'synthetics-overview', - link: 'synthetics:overview', - breadcrumbStatus: 'hidden', + }, + { + link: 'apm:settings', + sideNavStatus: 'hidden', // only to be considered in the breadcrumbs + }, + ], + }, + { + id: 'metrics', + title: i18n.translate('xpack.serverlessObservability.nav.infrastructure', { + defaultMessage: 'Infrastructure', + }), + link: 'metrics:inventory', + renderAs: 'accordion', + children: [ + { + link: 'metrics:inventory', + getIsActive: ({ pathNameSerialized, prepend }) => { + return pathNameSerialized.startsWith(prepend('/app/metrics/inventory')); }, - { - link: 'synthetics:certificates', - title: i18n.translate( - 'xpack.serverlessObservability.nav.synthetics.certificatesItem', - { - defaultMessage: 'TLS Certificates', - } - ), - id: 'synthetics-certificates', - breadcrumbStatus: 'hidden', + }, + { + link: 'metrics:hosts', + getIsActive: ({ pathNameSerialized, prepend }) => { + return pathNameSerialized.startsWith(prepend('/app/metrics/hosts')); }, - ], - }, - ], - }, - ], - footer: [ - { - type: 'navItem', - title: i18n.translate('xpack.serverlessObservability.nav.getStarted', { - defaultMessage: 'Add data', - }), - link: 'observabilityOnboarding', - icon: 'launch', - }, - { - type: 'navItem', - id: 'devTools', - title: i18n.translate('xpack.serverlessObservability.nav.devTools', { - defaultMessage: 'Developer tools', - }), - link: 'dev_tools', - icon: 'editorCodeBlock', - }, - { - type: 'navGroup', - id: 'project_settings_project_nav', - title: i18n.translate('xpack.serverlessObservability.nav.projectSettings', { - defaultMessage: 'Project settings', - }), - icon: 'gear', - breadcrumbStatus: 'hidden', - children: [ - { - link: 'management', - title: i18n.translate('xpack.serverlessObservability.nav.mngt', { - defaultMessage: 'Management', - }), - }, - { - link: 'integrations', - }, - { - link: 'fleet', - }, - { - id: 'cloudLinkUserAndRoles', - cloudLink: 'userAndRoles', - }, - { - id: 'cloudLinkBilling', - cloudLink: 'billingAndSub', - }, - ], - }, - ], - }; + }, + { + link: 'metrics:settings', + sideNavStatus: 'hidden', // only to be considered in the breadcrumbs + }, + { + link: 'metrics:assetDetails', + sideNavStatus: 'hidden', // only to be considered in the breadcrumbs + }, + ], + }, + { + id: 'synthetics', + title: i18n.translate('xpack.serverlessObservability.nav.synthetics', { + defaultMessage: 'Synthetics', + }), + renderAs: 'accordion', + breadcrumbStatus: 'hidden', + children: [ + { + title: i18n.translate('xpack.serverlessObservability.nav.synthetics.overviewItem', { + defaultMessage: 'Overview', + }), + id: 'synthetics-overview', + link: 'synthetics:overview', + breadcrumbStatus: 'hidden', + }, + { + link: 'synthetics:certificates', + title: i18n.translate( + 'xpack.serverlessObservability.nav.synthetics.certificatesItem', + { + defaultMessage: 'TLS Certificates', + } + ), + id: 'synthetics-certificates', + breadcrumbStatus: 'hidden', + }, + ], + }, + ], + }, + ], + footer: [ + { + type: 'navItem', + title: i18n.translate('xpack.serverlessObservability.nav.getStarted', { + defaultMessage: 'Add data', + }), + link: 'observabilityOnboarding', + icon: 'launch', + }, + { + type: 'navItem', + id: 'devTools', + title: i18n.translate('xpack.serverlessObservability.nav.devTools', { + defaultMessage: 'Developer tools', + }), + link: 'dev_tools', + icon: 'editorCodeBlock', + }, + { + type: 'navGroup', + id: 'project_settings_project_nav', + title: i18n.translate('xpack.serverlessObservability.nav.projectSettings', { + defaultMessage: 'Project settings', + }), + icon: 'gear', + breadcrumbStatus: 'hidden', + children: [ + { + link: 'management', + title: i18n.translate('xpack.serverlessObservability.nav.mngt', { + defaultMessage: 'Management', + }), + }, + { + link: 'integrations', + }, + { + link: 'fleet', + }, + { + id: 'cloudLinkUserAndRoles', + cloudLink: 'userAndRoles', + }, + { + id: 'cloudLinkBilling', + cloudLink: 'billingAndSub', + }, + ], + }, + ], }; diff --git a/x-pack/plugins/serverless_observability/public/plugin.ts b/x-pack/plugins/serverless_observability/public/plugin.ts index 163da944b05b7..25cb2dae38192 100644 --- a/x-pack/plugins/serverless_observability/public/plugin.ts +++ b/x-pack/plugins/serverless_observability/public/plugin.ts @@ -50,7 +50,7 @@ export class ServerlessObservabilityPlugin setupDeps: ServerlessObservabilityPublicStartDependencies ): ServerlessObservabilityPublicStart { const { serverless, management, security } = setupDeps; - const navigationTree$ = of(navigationTree(core)); + const navigationTree$ = of(navigationTree); serverless.setProjectHome('/app/observability/landing'); serverless.initNavigation('oblt', navigationTree$, { dataTestSubj: 'svlObservabilitySideNav' }); const aiAssistantIsEnabled = core.application.capabilities.observabilityAIAssistant?.show; From eb5373b3c7d2330cdfad1c82ef3d25cb2d151045 Mon Sep 17 00:00:00 2001 From: iblancof Date: Thu, 19 Sep 2024 16:39:31 +0200 Subject: [PATCH 17/42] Add tech preview badge to inventory page title --- .../inventory_page_template/index.tsx | 33 +++++++++++++++++-- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/observability_solution/inventory/public/components/inventory_page_template/index.tsx b/x-pack/plugins/observability_solution/inventory/public/components/inventory_page_template/index.tsx index 4dd8eaf3899ee..64330dd1db077 100644 --- a/x-pack/plugins/observability_solution/inventory/public/components/inventory_page_template/index.tsx +++ b/x-pack/plugins/observability_solution/inventory/public/components/inventory_page_template/index.tsx @@ -6,6 +6,7 @@ */ import { i18n } from '@kbn/i18n'; import React from 'react'; +import { EuiBetaBadge, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { useKibana } from '../../hooks/use_kibana'; export function InventoryPageTemplate({ children }: { children: React.ReactNode }) { @@ -17,12 +18,38 @@ export function InventoryPageTemplate({ children }: { children: React.ReactNode const { PageTemplate: ObservabilityPageTemplate } = observabilityShared.navigation; + const pageTitle = ( + + + {i18n.translate('xpack.inventory.inventoryPageHeaderLabel', { + defaultMessage: 'Inventory', + })} + + + + + + ); + return ( {children} From 1c1b83bf88d38bb8742675ccf11aab6507225f46 Mon Sep 17 00:00:00 2001 From: iblancof Date: Thu, 19 Sep 2024 16:43:41 +0200 Subject: [PATCH 18/42] Remove unused attr from serverless nav tree --- .../plugins/serverless_observability/public/navigation_tree.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/plugins/serverless_observability/public/navigation_tree.ts b/x-pack/plugins/serverless_observability/public/navigation_tree.ts index 100036fc488ab..11aeec747abcc 100644 --- a/x-pack/plugins/serverless_observability/public/navigation_tree.ts +++ b/x-pack/plugins/serverless_observability/public/navigation_tree.ts @@ -136,7 +136,6 @@ export const navigationTree: NavigationTreeDefinition = { const regex = /app\/apm\/.*service.*/; return regex.test(pathNameSerialized); }, - withBadge: true, }, { link: 'apm:traces', From 9c6e85b9e6f48af89c4e91d72a029149fe5f441d Mon Sep 17 00:00:00 2001 From: iblancof Date: Thu, 19 Sep 2024 16:47:14 +0200 Subject: [PATCH 19/42] Rename Services to Service Inventory --- x-pack/plugins/observability_solution/apm/public/plugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/observability_solution/apm/public/plugin.ts b/x-pack/plugins/observability_solution/apm/public/plugin.ts index c429fdaeb9ec5..f58b9d6d40969 100644 --- a/x-pack/plugins/observability_solution/apm/public/plugin.ts +++ b/x-pack/plugins/observability_solution/apm/public/plugin.ts @@ -156,7 +156,7 @@ const applicationsTitle = i18n.translate('xpack.apm.navigation.rootTitle', { }); const servicesTitle = i18n.translate('xpack.apm.navigation.servicesTitle', { - defaultMessage: 'Services', + defaultMessage: 'Service Inventory', }); const serviceGroupsTitle = i18n.translate('xpack.apm.navigation.serviceGroupsTitle', { From b82e0862aa51f48d98ce089c981e723cbbcc9241 Mon Sep 17 00:00:00 2001 From: iblancof Date: Thu, 19 Sep 2024 16:57:49 +0200 Subject: [PATCH 20/42] Add missing path match to inventory plugin --- .../plugins/observability_solution/inventory/public/plugin.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/x-pack/plugins/observability_solution/inventory/public/plugin.tsx b/x-pack/plugins/observability_solution/inventory/public/plugin.tsx index 7a21bcc803991..6d5d90f8c7c86 100644 --- a/x-pack/plugins/observability_solution/inventory/public/plugin.tsx +++ b/x-pack/plugins/observability_solution/inventory/public/plugin.tsx @@ -70,6 +70,9 @@ export class InventoryPlugin }), app: INVENTORY_APP_ID, path: '/', + matchPath(currentPath: string) { + return ['/', ''].some((testPath) => currentPath.startsWith(testPath)); + }, isTechnicalPreview: true, }, ], From 028a41a1c3cc95f81563b0284f8f03636e2b114b Mon Sep 17 00:00:00 2001 From: iblancof Date: Fri, 20 Sep 2024 12:31:11 +0200 Subject: [PATCH 21/42] Remove deeplinks from inventory register --- .../observability_solution/inventory/public/plugin.tsx | 9 --------- 1 file changed, 9 deletions(-) diff --git a/x-pack/plugins/observability_solution/inventory/public/plugin.tsx b/x-pack/plugins/observability_solution/inventory/public/plugin.tsx index 6d5d90f8c7c86..a3540c4a5f2ea 100644 --- a/x-pack/plugins/observability_solution/inventory/public/plugin.tsx +++ b/x-pack/plugins/observability_solution/inventory/public/plugin.tsx @@ -96,15 +96,6 @@ export class InventoryPlugin status: isEntityCentricExperienceSettingEnabled ? AppStatus.accessible : AppStatus.inaccessible, - deepLinks: [ - { - id: 'inventory', - title: i18n.translate('xpack.inventory.inventoryDeepLinkTitle', { - defaultMessage: 'Inventory', - }), - path: '/', - }, - ], mount: async (appMountParameters: AppMountParameters) => { // Load application bundle and Get start services const [{ Application }, [coreStart, pluginsStart]] = await Promise.all([ From acc2fe22772fc529405de203959454b4b0797133 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Fri, 20 Sep 2024 12:27:20 +0000 Subject: [PATCH 22/42] [CI] Auto-commit changed files from 'node scripts/yarn_deduplicate' --- x-pack/plugins/observability_solution/inventory/tsconfig.json | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/plugins/observability_solution/inventory/tsconfig.json b/x-pack/plugins/observability_solution/inventory/tsconfig.json index e5e530ce1233f..bbc342bb96b33 100644 --- a/x-pack/plugins/observability_solution/inventory/tsconfig.json +++ b/x-pack/plugins/observability_solution/inventory/tsconfig.json @@ -19,7 +19,6 @@ "kbn_references": [ "@kbn/core", "@kbn/logging", - "@kbn/config-schema", "@kbn/observability-shared-plugin", "@kbn/server-route-repository", "@kbn/shared-ux-link-redirect-app", From 0f6dbfa7b95c026155e5cdee968bad85c4b9c358 Mon Sep 17 00:00:00 2001 From: iblancof Date: Fri, 20 Sep 2024 14:41:39 +0200 Subject: [PATCH 23/42] Fix translation keys in InventoryPageTemplate --- .../components/inventory_page_template/index.tsx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/x-pack/plugins/observability_solution/inventory/public/components/inventory_page_template/index.tsx b/x-pack/plugins/observability_solution/inventory/public/components/inventory_page_template/index.tsx index 64330dd1db077..d3c180bfbf26a 100644 --- a/x-pack/plugins/observability_solution/inventory/public/components/inventory_page_template/index.tsx +++ b/x-pack/plugins/observability_solution/inventory/public/components/inventory_page_template/index.tsx @@ -28,18 +28,15 @@ export function InventoryPageTemplate({ children }: { children: React.ReactNode From 5130207932ef930298e8243b9ee7cb6c537afef5 Mon Sep 17 00:00:00 2001 From: iblancof Date: Mon, 23 Sep 2024 10:47:32 +0200 Subject: [PATCH 24/42] Create default INVENTORY_SERVER_FEATURE --- .../inventory/server/feature.ts | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 x-pack/plugins/observability_solution/inventory/server/feature.ts diff --git a/x-pack/plugins/observability_solution/inventory/server/feature.ts b/x-pack/plugins/observability_solution/inventory/server/feature.ts new file mode 100644 index 0000000000000..2b3f2e92a44de --- /dev/null +++ b/x-pack/plugins/observability_solution/inventory/server/feature.ts @@ -0,0 +1,64 @@ +/* + * 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'; +import { DEFAULT_APP_CATEGORIES } from '@kbn/core/server'; +import { KibanaFeatureScope } from '@kbn/features-plugin/common'; + +const INVENTORY_SERVER_FEATURE_ID = 'inventory'; + +export const INVENTORY_SERVER_FEATURE = { + id: INVENTORY_SERVER_FEATURE_ID, + name: i18n.translate('xpack.inventory.featureRegistry.inventoryFeatureName', { + defaultMessage: 'Inventory', + }), + order: 1000, + category: DEFAULT_APP_CATEGORIES.observability, + scope: [KibanaFeatureScope.Spaces, KibanaFeatureScope.Security], + app: [INVENTORY_SERVER_FEATURE_ID], + catalogue: [INVENTORY_SERVER_FEATURE_ID], + alerting: [], + // see x-pack/plugins/features/common/feature_kibana_privileges.ts + privileges: { + all: { + app: [INVENTORY_SERVER_FEATURE_ID], + api: [INVENTORY_SERVER_FEATURE_ID], + catalogue: [INVENTORY_SERVER_FEATURE_ID], + savedObject: { + all: [], + read: [], + }, + alerting: { + alert: { + all: [], + }, + rule: { + all: [], + }, + }, + ui: ['show', 'save'], + }, + read: { + app: [INVENTORY_SERVER_FEATURE_ID], + api: [INVENTORY_SERVER_FEATURE_ID], + catalogue: [INVENTORY_SERVER_FEATURE_ID], + savedObject: { + all: [], + read: [], + }, + alerting: { + alert: { + read: [], + }, + rule: { + read: [], + }, + }, + ui: ['show'], + }, + }, +}; From fa10132a4ec9222578e896b396c66d4a7aa7d967 Mon Sep 17 00:00:00 2001 From: iblancof Date: Mon, 23 Sep 2024 10:48:05 +0200 Subject: [PATCH 25/42] registerKibanaFeature for INVENTORY_SERVER_FEATURE --- .../plugins/observability_solution/inventory/kibana.jsonc | 7 +++---- .../observability_solution/inventory/server/plugin.ts | 4 ++++ .../observability_solution/inventory/server/types.ts | 2 ++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/observability_solution/inventory/kibana.jsonc b/x-pack/plugins/observability_solution/inventory/kibana.jsonc index 9262e111c401f..0d2a34403764a 100644 --- a/x-pack/plugins/observability_solution/inventory/kibana.jsonc +++ b/x-pack/plugins/observability_solution/inventory/kibana.jsonc @@ -12,11 +12,10 @@ "entityManager", "inference", "dataViews", - "share" - ], - "requiredBundles": [ - "kibanaReact" + "share", + "features" ], + "requiredBundles": ["kibanaReact"], "optionalPlugins": [], "extraPublicDirs": [] } diff --git a/x-pack/plugins/observability_solution/inventory/server/plugin.ts b/x-pack/plugins/observability_solution/inventory/server/plugin.ts index 1ac928b72cdb2..642dd12769fb4 100644 --- a/x-pack/plugins/observability_solution/inventory/server/plugin.ts +++ b/x-pack/plugins/observability_solution/inventory/server/plugin.ts @@ -17,6 +17,7 @@ import type { InventorySetupDependencies, InventoryStartDependencies, } from './types'; +import { INVENTORY_SERVER_FEATURE } from './feature'; export class InventoryPlugin implements @@ -55,6 +56,9 @@ export class InventoryPlugin }) as unknown as InventoryRouteHandlerResources['plugins'], }, }); + + pluginsSetup.features.registerKibanaFeature(INVENTORY_SERVER_FEATURE); + return {}; } diff --git a/x-pack/plugins/observability_solution/inventory/server/types.ts b/x-pack/plugins/observability_solution/inventory/server/types.ts index a58bd62fe57a9..05f75561674c6 100644 --- a/x-pack/plugins/observability_solution/inventory/server/types.ts +++ b/x-pack/plugins/observability_solution/inventory/server/types.ts @@ -13,6 +13,7 @@ import type { DataViewsServerPluginSetup, DataViewsServerPluginStart, } from '@kbn/data-views-plugin/server'; +import { FeaturesPluginSetup } from '@kbn/features-plugin/server'; /* eslint-disable @typescript-eslint/no-empty-interface*/ export interface ConfigSchema {} @@ -21,6 +22,7 @@ export interface InventorySetupDependencies { entityManager: EntityManagerServerPluginSetup; inference: InferenceServerSetup; dataViews: DataViewsServerPluginSetup; + features: FeaturesPluginSetup; } export interface InventoryStartDependencies { From be63a67f5f95c49b5a96c7690dd9498a403b5ff8 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Mon, 23 Sep 2024 10:17:11 +0000 Subject: [PATCH 26/42] [CI] Auto-commit changed files from 'node scripts/yarn_deduplicate' --- x-pack/plugins/observability_solution/inventory/tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/observability_solution/inventory/tsconfig.json b/x-pack/plugins/observability_solution/inventory/tsconfig.json index f1ebfa86e9ff0..6cf3440ac22fc 100644 --- a/x-pack/plugins/observability_solution/inventory/tsconfig.json +++ b/x-pack/plugins/observability_solution/inventory/tsconfig.json @@ -36,6 +36,7 @@ "@kbn/i18n-react", "@kbn/io-ts-utils", "@kbn/core-analytics-browser", - "@kbn/core-http-browser" + "@kbn/core-http-browser", + "@kbn/features-plugin" ] } From ec7d08889400916f6faf0dbdb11de51b0c04b65c Mon Sep 17 00:00:00 2001 From: iblancof Date: Wed, 25 Sep 2024 10:35:24 +0200 Subject: [PATCH 27/42] Remove duplicated import --- .../public/components/inventory_page_template/index.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/plugins/observability_solution/inventory/public/components/inventory_page_template/index.tsx b/x-pack/plugins/observability_solution/inventory/public/components/inventory_page_template/index.tsx index a3ca0a536c091..4572f7a4f9a79 100644 --- a/x-pack/plugins/observability_solution/inventory/public/components/inventory_page_template/index.tsx +++ b/x-pack/plugins/observability_solution/inventory/public/components/inventory_page_template/index.tsx @@ -4,7 +4,6 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; import { From ce2fb41542519e3c24fae379f291a1f42b855719 Mon Sep 17 00:00:00 2001 From: iblancof Date: Wed, 25 Sep 2024 10:53:40 +0200 Subject: [PATCH 28/42] Change Inventory order in stateful menu --- .../plugins/observability_solution/inventory/public/plugin.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/observability_solution/inventory/public/plugin.ts b/x-pack/plugins/observability_solution/inventory/public/plugin.ts index 12496679dd927..c02a57b45f691 100644 --- a/x-pack/plugins/observability_solution/inventory/public/plugin.ts +++ b/x-pack/plugins/observability_solution/inventory/public/plugin.ts @@ -62,7 +62,7 @@ export class InventoryPlugin return [ { label: '', - sortKey: 101, + sortKey: 300, entries: [ { label: i18n.translate('xpack.inventory.inventoryLinkTitle', { @@ -94,7 +94,7 @@ export class InventoryPlugin appRoute: '/app/observability/inventory', category: DEFAULT_APP_CATEGORIES.observability, visibleIn: ['sideNav', 'globalSearch'], - order: 8004, + order: 8200, status: isEntityCentricExperienceSettingEnabled ? AppStatus.accessible : AppStatus.inaccessible, From 04cca5edcd31e124868dad0a952f02e46ef8703a Mon Sep 17 00:00:00 2001 From: iblancof Date: Wed, 25 Sep 2024 11:19:29 +0200 Subject: [PATCH 29/42] Change Inventory order in stateful new --- .../observability/public/navigation_tree.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts b/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts index 309d2f2264300..353f1258fc7b8 100644 --- a/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts +++ b/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts @@ -67,9 +67,6 @@ export function createNavTree(pluginsStart: ObservabilityPublicPluginsStart) { { link: 'slo', }, - { - link: 'inventory', - }, { id: 'aiMl', title: i18n.translate('xpack.observability.obltNav.ml.aiAndMlGroupTitle', { @@ -132,6 +129,10 @@ export function createNavTree(pluginsStart: ObservabilityPublicPluginsStart) { }, ], }, + { + link: 'inventory', + spaceBefore: 'm', + }, { id: 'apm', title: i18n.translate('xpack.observability.obltNav.applications', { From f1cd6bd7561379b01f3921118800bac4836c1559 Mon Sep 17 00:00:00 2001 From: iblancof Date: Wed, 25 Sep 2024 11:22:50 +0200 Subject: [PATCH 30/42] Change Inventory order in serverless --- .../plugins/serverless_observability/public/navigation_tree.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/serverless_observability/public/navigation_tree.ts b/x-pack/plugins/serverless_observability/public/navigation_tree.ts index 11aeec747abcc..e3c61ec0b29e3 100644 --- a/x-pack/plugins/serverless_observability/public/navigation_tree.ts +++ b/x-pack/plugins/serverless_observability/public/navigation_tree.ts @@ -69,7 +69,6 @@ export const navigationTree: NavigationTreeDefinition = { }), link: 'slo', }, - { link: 'inventory' }, { id: 'aiops', title: 'AIOps', @@ -122,6 +121,7 @@ export const navigationTree: NavigationTreeDefinition = { }, ], }, + { link: 'inventory', spaceBefore: 'm' }, { id: 'apm', title: i18n.translate('xpack.serverlessObservability.nav.applications', { From 98f6b12afda83f0c46e8847d8000754166e2c5cd Mon Sep 17 00:00:00 2001 From: iblancof Date: Wed, 25 Sep 2024 11:47:37 +0200 Subject: [PATCH 31/42] Fixed test for telemetry --- .../spaces_api_integration/spaces_only/telemetry/telemetry.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/test/spaces_api_integration/spaces_only/telemetry/telemetry.ts b/x-pack/test/spaces_api_integration/spaces_only/telemetry/telemetry.ts index d39c58bd2b6e7..98b3c88354593 100644 --- a/x-pack/test/spaces_api_integration/spaces_only/telemetry/telemetry.ts +++ b/x-pack/test/spaces_api_integration/spaces_only/telemetry/telemetry.ts @@ -75,6 +75,7 @@ export default function ({ getService }: FtrProviderContext) { uptime: 0, slo: 0, infrastructure: 0, + inventory: 0, logs: 0, monitoring: 0, apm: 0, From 7b166645aea1fbaa1f2b7db608c973bf1f0860a1 Mon Sep 17 00:00:00 2001 From: iblancof Date: Wed, 25 Sep 2024 11:52:01 +0200 Subject: [PATCH 32/42] Fixed test for app usage --- .../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 87318e6c95fe8..06866afc65caa 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 @@ -152,6 +152,7 @@ export const applicationUsageSchema = { fleet: commonSchema, integrations: commonSchema, ingestManager: commonSchema, + inventory: commonSchema, lens: commonSchema, maps: commonSchema, ml: commonSchema, From 800b0f5ad7e48790f1d59f57d67c9a975bed4ffd Mon Sep 17 00:00:00 2001 From: iblancof Date: Wed, 25 Sep 2024 11:57:44 +0200 Subject: [PATCH 33/42] Fix security test --- x-pack/test/api_integration/apis/security/privileges.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/test/api_integration/apis/security/privileges.ts b/x-pack/test/api_integration/apis/security/privileges.ts index a809d0837abc9..8db8c08b16728 100644 --- a/x-pack/test/api_integration/apis/security/privileges.ts +++ b/x-pack/test/api_integration/apis/security/privileges.ts @@ -140,6 +140,7 @@ export default function ({ getService }: FtrProviderContext) { maintenanceWindow: ['all', 'read', 'minimal_all', 'minimal_read'], guidedOnboardingFeature: ['all', 'read', 'minimal_all', 'minimal_read'], aiAssistantManagementSelection: ['all', 'read', 'minimal_all', 'minimal_read'], + inventory: ['all', 'read', 'minimal_all', 'minimal_read'], }, reserved: ['fleet-setup', 'ml_user', 'ml_admin', 'ml_apm_user', 'monitoring'], }; From 9861bea23ef00dd7b93b094c6f37d60e3207784d Mon Sep 17 00:00:00 2001 From: iblancof Date: Wed, 25 Sep 2024 12:06:51 +0200 Subject: [PATCH 34/42] Fix test for features --- x-pack/test/api_integration/apis/features/features/features.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x-pack/test/api_integration/apis/features/features/features.ts b/x-pack/test/api_integration/apis/features/features/features.ts index d6602c0ce8cbb..895bfcb851bdd 100644 --- a/x-pack/test/api_integration/apis/features/features/features.ts +++ b/x-pack/test/api_integration/apis/features/features/features.ts @@ -120,6 +120,7 @@ export default function ({ getService }: FtrProviderContext) { 'canvas', 'generalCases', 'infrastructure', + 'inventory', 'logs', 'maintenanceWindow', 'maps', @@ -168,6 +169,7 @@ export default function ({ getService }: FtrProviderContext) { 'canvas', 'generalCases', 'infrastructure', + 'inventory', 'logs', 'maintenanceWindow', 'maps', From feb3b37164d552e2c6aed25484cf2ac0ff040779 Mon Sep 17 00:00:00 2001 From: iblancof Date: Wed, 25 Sep 2024 12:19:38 +0200 Subject: [PATCH 35/42] Fix security test --- x-pack/test/api_integration/apis/security/privileges_basic.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x-pack/test/api_integration/apis/security/privileges_basic.ts b/x-pack/test/api_integration/apis/security/privileges_basic.ts index 59829c673e408..a82ecc2aa4fd6 100644 --- a/x-pack/test/api_integration/apis/security/privileges_basic.ts +++ b/x-pack/test/api_integration/apis/security/privileges_basic.ts @@ -58,6 +58,7 @@ export default function ({ getService }: FtrProviderContext) { maintenanceWindow: ['all', 'read', 'minimal_all', 'minimal_read'], guidedOnboardingFeature: ['all', 'read', 'minimal_all', 'minimal_read'], aiAssistantManagementSelection: ['all', 'read', 'minimal_all', 'minimal_read'], + inventory: ['all', 'read', 'minimal_all', 'minimal_read'], }, global: ['all', 'read'], space: ['all', 'read'], @@ -226,6 +227,7 @@ export default function ({ getService }: FtrProviderContext) { maintenanceWindow: ['all', 'read', 'minimal_all', 'minimal_read'], guidedOnboardingFeature: ['all', 'read', 'minimal_all', 'minimal_read'], aiAssistantManagementSelection: ['all', 'read', 'minimal_all', 'minimal_read'], + inventory: ['all', 'read', 'minimal_all', 'minimal_read'], }, reserved: ['fleet-setup', 'ml_user', 'ml_admin', 'ml_apm_user', 'monitoring'], }; From 571d154bf65bdc7c60280df8e3d5b5a2e9c6eb1e Mon Sep 17 00:00:00 2001 From: iblancof Date: Wed, 25 Sep 2024 12:27:55 +0200 Subject: [PATCH 36/42] Fix APM navigation test --- .../apm/ftr_e2e/cypress/e2e/deep_links.cy.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/observability_solution/apm/ftr_e2e/cypress/e2e/deep_links.cy.ts b/x-pack/plugins/observability_solution/apm/ftr_e2e/cypress/e2e/deep_links.cy.ts index e7c75652c7d03..32ff06d1b3c6b 100644 --- a/x-pack/plugins/observability_solution/apm/ftr_e2e/cypress/e2e/deep_links.cy.ts +++ b/x-pack/plugins/observability_solution/apm/ftr_e2e/cypress/e2e/deep_links.cy.ts @@ -16,7 +16,7 @@ describe('APM deep links', () => { .type('APM', { force: true, delay: 100 }) .focus(); cy.contains('APM'); - cy.contains('APM / Services'); + cy.contains('APM / Service Inventory'); cy.contains('APM / Service groups'); cy.contains('APM / Traces'); cy.contains('APM / Service Map'); @@ -33,7 +33,7 @@ describe('APM deep links', () => { .should('be.visible') .type('APM', { force: true, delay: 100 }); // navigates to services page - cy.contains('APM / Services').click({ force: true }); + cy.contains('APM / Service Inventory').click({ force: true }); cy.url().should('include', '/apm/services'); cy.getByTestSubj('nav-search-input') From a715f24d988da721ddc11a80139a1ba099171818 Mon Sep 17 00:00:00 2001 From: iblancof Date: Wed, 25 Sep 2024 14:25:41 +0200 Subject: [PATCH 37/42] Run telemetry_check --- 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 37507c50e832c..82e7666018782 100644 --- a/src/plugins/telemetry/schema/oss_plugins.json +++ b/src/plugins/telemetry/schema/oss_plugins.json @@ -4194,6 +4194,137 @@ } } }, + "inventory": { + "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" + } + } + } + } + } + } + }, "lens": { "properties": { "appId": { From 48a5958b5470fde135dfbaaa6393fc9f83b07a6e Mon Sep 17 00:00:00 2001 From: iblancof Date: Thu, 26 Sep 2024 15:04:37 +0200 Subject: [PATCH 38/42] Use TechnicalPreviewBadge in InventoryPageTemplate --- .../inventory_page_template/index.tsx | 23 +++---------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/x-pack/plugins/observability_solution/inventory/public/components/inventory_page_template/index.tsx b/x-pack/plugins/observability_solution/inventory/public/components/inventory_page_template/index.tsx index 4572f7a4f9a79..bb14078ffa2b7 100644 --- a/x-pack/plugins/observability_solution/inventory/public/components/inventory_page_template/index.tsx +++ b/x-pack/plugins/observability_solution/inventory/public/components/inventory_page_template/index.tsx @@ -6,14 +6,9 @@ */ import { i18n } from '@kbn/i18n'; import React from 'react'; -import { - EuiBetaBadge, - EuiFlexGroup, - EuiFlexItem, - EuiEmptyPrompt, - EuiLoadingLogo, -} from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem, EuiEmptyPrompt, EuiLoadingLogo } from '@elastic/eui'; import {} from '@elastic/eui'; +import { TechnicalPreviewBadge } from '@kbn/observability-shared-plugin/public'; import { useKibana } from '../../hooks/use_kibana'; import { SearchBar } from '../search_bar'; import { getEntityManagerEnablement } from './no_data_config'; @@ -30,19 +25,7 @@ const pageTitle = ( })} - + ); From 11886c061a3fcdf7c352bc15fb432422fb94d641 Mon Sep 17 00:00:00 2001 From: iblancof Date: Fri, 27 Sep 2024 09:42:37 +0200 Subject: [PATCH 39/42] Revert "Remove config in InventoryPlugin" This reverts commit 3a0b5d7f9bd998f922f4c48af50d932716cce8bb. --- .../inventory/server/config.ts | 14 ++++++++++++++ .../inventory/server/index.ts | 15 +++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 x-pack/plugins/observability_solution/inventory/server/config.ts diff --git a/x-pack/plugins/observability_solution/inventory/server/config.ts b/x-pack/plugins/observability_solution/inventory/server/config.ts new file mode 100644 index 0000000000000..2d6d7604b40e1 --- /dev/null +++ b/x-pack/plugins/observability_solution/inventory/server/config.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 { schema, type TypeOf } from '@kbn/config-schema'; + +export const config = schema.object({ + enabled: schema.boolean({ defaultValue: false }), +}); + +export type InventoryConfig = TypeOf; diff --git a/x-pack/plugins/observability_solution/inventory/server/index.ts b/x-pack/plugins/observability_solution/inventory/server/index.ts index f24d561068c77..ad878918bad47 100644 --- a/x-pack/plugins/observability_solution/inventory/server/index.ts +++ b/x-pack/plugins/observability_solution/inventory/server/index.ts @@ -4,7 +4,12 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import type { PluginInitializer, PluginInitializerContext } from '@kbn/core/server'; +import type { + PluginConfigDescriptor, + PluginInitializer, + PluginInitializerContext, +} from '@kbn/core/server'; +import type { InventoryConfig } from './config'; import { InventoryPlugin } from './plugin'; import type { InventoryServerSetup, @@ -17,10 +22,16 @@ export type { InventoryServerRouteRepository } from './routes/get_global_invento export type { InventoryServerSetup, InventoryServerStart }; +import { config as configSchema } from './config'; + +export const config: PluginConfigDescriptor = { + schema: configSchema, +}; + export const plugin: PluginInitializer< InventoryServerSetup, InventoryServerStart, InventorySetupDependencies, InventoryStartDependencies -> = async (pluginInitializerContext: PluginInitializerContext) => +> = async (pluginInitializerContext: PluginInitializerContext) => new InventoryPlugin(pluginInitializerContext); From f6fa6a02b9d7fc8c843e8b9d33601f631b16fd5f Mon Sep 17 00:00:00 2001 From: iblancof Date: Fri, 27 Sep 2024 09:44:53 +0200 Subject: [PATCH 40/42] Set default enabled value to true --- .../plugins/observability_solution/inventory/server/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/observability_solution/inventory/server/config.ts b/x-pack/plugins/observability_solution/inventory/server/config.ts index 2d6d7604b40e1..36f19bd6579a7 100644 --- a/x-pack/plugins/observability_solution/inventory/server/config.ts +++ b/x-pack/plugins/observability_solution/inventory/server/config.ts @@ -8,7 +8,7 @@ import { schema, type TypeOf } from '@kbn/config-schema'; export const config = schema.object({ - enabled: schema.boolean({ defaultValue: false }), + enabled: schema.boolean({ defaultValue: true }), }); export type InventoryConfig = TypeOf; From ef0ab30d1eedb447f5c827a3650bff1ad251aa37 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Fri, 27 Sep 2024 07:56:28 +0000 Subject: [PATCH 41/42] [CI] Auto-commit changed files from 'node scripts/yarn_deduplicate' --- x-pack/plugins/observability_solution/inventory/tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/observability_solution/inventory/tsconfig.json b/x-pack/plugins/observability_solution/inventory/tsconfig.json index e355043c99bdf..163e87108bf75 100644 --- a/x-pack/plugins/observability_solution/inventory/tsconfig.json +++ b/x-pack/plugins/observability_solution/inventory/tsconfig.json @@ -41,6 +41,7 @@ "@kbn/core-http-browser", "@kbn/shared-svg", "@kbn/features-plugin", - "@kbn/es-query" + "@kbn/es-query", + "@kbn/config-schema" ] } From 1becc9a7a86db40c9556d5ef9a00afcb2233457c Mon Sep 17 00:00:00 2001 From: iblancof Date: Fri, 27 Sep 2024 13:29:35 +0200 Subject: [PATCH 42/42] Remove empty import --- .../public/components/inventory_page_template/index.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/plugins/observability_solution/inventory/public/components/inventory_page_template/index.tsx b/x-pack/plugins/observability_solution/inventory/public/components/inventory_page_template/index.tsx index bb14078ffa2b7..29a6ac31348b4 100644 --- a/x-pack/plugins/observability_solution/inventory/public/components/inventory_page_template/index.tsx +++ b/x-pack/plugins/observability_solution/inventory/public/components/inventory_page_template/index.tsx @@ -7,7 +7,6 @@ import { i18n } from '@kbn/i18n'; import React from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiEmptyPrompt, EuiLoadingLogo } from '@elastic/eui'; -import {} from '@elastic/eui'; import { TechnicalPreviewBadge } from '@kbn/observability-shared-plugin/public'; import { useKibana } from '../../hooks/use_kibana'; import { SearchBar } from '../search_bar';