From e7b9b842be66e2e4ce4f43c44d0c4e8912e8e619 Mon Sep 17 00:00:00 2001 From: Bryce Buchanan Date: Thu, 5 Jun 2025 14:44:49 -0700 Subject: [PATCH 01/19] disabled apm plugin, changed default route to /app/observability/overview --- config/serverless.oblt.essentials.yml | 4 +++- .../solutions/observability/plugins/apm/server/plugin.ts | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/config/serverless.oblt.essentials.yml b/config/serverless.oblt.essentials.yml index aec9ece04b877..452f448cc222e 100644 --- a/config/serverless.oblt.essentials.yml +++ b/config/serverless.oblt.essentials.yml @@ -2,4 +2,6 @@ ## Disable xpack plugins xpack.infra.enabled: false -xpack.slo.enabled: false \ No newline at end of file +xpack.slo.enabled: false +xpack.apm.enabled: false +uiSettings.overrides.defaultRoute: /app/observability/overview diff --git a/x-pack/solutions/observability/plugins/apm/server/plugin.ts b/x-pack/solutions/observability/plugins/apm/server/plugin.ts index 6ad2202a9e4b0..b82893aa98a05 100644 --- a/x-pack/solutions/observability/plugins/apm/server/plugin.ts +++ b/x-pack/solutions/observability/plugins/apm/server/plugin.ts @@ -74,6 +74,14 @@ export class APMPlugin const currentConfig = this.initContext.config.get(); this.currentConfig = currentConfig; + core.pricing.registerProductFeatures([ + { + id: 'observability-complete-apm', + products: [{ name: 'observability', tier: 'complete' }], + description: 'APM features only available in the Observability Complete license.', + }, + ]); + if ( plugins.taskManager && plugins.usageCollection && From 8415e445f80f532fdc5f951d809b6e63b2b8873c Mon Sep 17 00:00:00 2001 From: Bryce Buchanan Date: Fri, 6 Jun 2025 09:27:59 -0700 Subject: [PATCH 02/19] disables all features under Applications --- config/serverless.oblt.complete.yml | 17 +++++++++++++++++ config/serverless.oblt.essentials.yml | 12 ++++++++++++ config/serverless.oblt.yml | 14 +------------- .../observability/plugins/apm/server/plugin.ts | 8 -------- 4 files changed, 30 insertions(+), 21 deletions(-) diff --git a/config/serverless.oblt.complete.yml b/config/serverless.oblt.complete.yml index 8d677648b0ad0..0871091ff4c4d 100644 --- a/config/serverless.oblt.complete.yml +++ b/config/serverless.oblt.complete.yml @@ -3,6 +3,10 @@ ## Enabled plugins xpack.infra.enabled: true xpack.slo.enabled: true +xpack.uptime.enabled: true +overrides: + uptime + xpack.features.overrides: ### Applications feature privileges are fine-tuned to grant access to Logs, and Observability apps. @@ -23,6 +27,19 @@ xpack.features.overrides: - feature: "observability" privileges: [ "read" ] ### Fleet feature privileges are fine-tuned to grant access to Logs app. + ### Synthetics feature privileges are fine-tuned to grant access to Observability app. + uptime: + ### By default, this feature named as `Synthetics and Uptime`, but should be renamed to `Synthetics` since `Uptime` is not available. + name: "Synthetics" + privileges: + # Synthetics `All` feature privilege should implicitly grant `All` access to Observability app. + all.composedOf: + - feature: "observability" + privileges: [ "all" ] + # Synthetics `Read` feature privilege should implicitly grant `Read` access to Observability app. + read.composedOf: + - feature: "observability" + privileges: [ "read" ] fleetv2: privileges: # Fleet `All` feature privilege should implicitly grant `All` access to Logs app. diff --git a/config/serverless.oblt.essentials.yml b/config/serverless.oblt.essentials.yml index 452f448cc222e..dff76b031bde6 100644 --- a/config/serverless.oblt.essentials.yml +++ b/config/serverless.oblt.essentials.yml @@ -5,3 +5,15 @@ xpack.infra.enabled: false xpack.slo.enabled: false xpack.apm.enabled: false uiSettings.overrides.defaultRoute: /app/observability/overview + +xpack.legacy_uptime.enabled: false +# xpack.uptime.enabled: false +xpack.ux.enabled: false +xpack.uptime.enabled: false + +xpack.fleet.internal.registry.excludePackages: [ + # Oblt integrations + 'synthetics', + 'uptime', + 'synthetics_dashboards', +] \ No newline at end of file diff --git a/config/serverless.oblt.yml b/config/serverless.oblt.yml index 2876f791d3065..1298cbe983dd0 100644 --- a/config/serverless.oblt.yml +++ b/config/serverless.oblt.yml @@ -48,19 +48,7 @@ xpack.features.overrides: observability.hidden: true ### Stack alerts is hidden in Role management since it's not needed. stackAlerts.hidden: true - ### Synthetics feature privileges are fine-tuned to grant access to Observability app. - uptime: - ### By default, this feature named as `Synthetics and Uptime`, but should be renamed to `Synthetics` since `Uptime` is not available. - name: "Synthetics" - privileges: - # Synthetics `All` feature privilege should implicitly grant `All` access to Observability app. - all.composedOf: - - feature: "observability" - privileges: [ "all" ] - # Synthetics `Read` feature privilege should implicitly grant `Read` access to Observability app. - read.composedOf: - - feature: "observability" - privileges: [ "read" ] + ## Cloud settings diff --git a/x-pack/solutions/observability/plugins/apm/server/plugin.ts b/x-pack/solutions/observability/plugins/apm/server/plugin.ts index b82893aa98a05..6ad2202a9e4b0 100644 --- a/x-pack/solutions/observability/plugins/apm/server/plugin.ts +++ b/x-pack/solutions/observability/plugins/apm/server/plugin.ts @@ -74,14 +74,6 @@ export class APMPlugin const currentConfig = this.initContext.config.get(); this.currentConfig = currentConfig; - core.pricing.registerProductFeatures([ - { - id: 'observability-complete-apm', - products: [{ name: 'observability', tier: 'complete' }], - description: 'APM features only available in the Observability Complete license.', - }, - ]); - if ( plugins.taskManager && plugins.usageCollection && From 48b7b9b32b0de9deccb1e2b657c0669be2ce7f2e Mon Sep 17 00:00:00 2001 From: Bryce Buchanan Date: Fri, 6 Jun 2025 11:04:51 -0700 Subject: [PATCH 03/19] fixed observability-complete --- config/serverless.oblt.complete.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/config/serverless.oblt.complete.yml b/config/serverless.oblt.complete.yml index 0871091ff4c4d..d1aa6a509627f 100644 --- a/config/serverless.oblt.complete.yml +++ b/config/serverless.oblt.complete.yml @@ -4,8 +4,6 @@ xpack.infra.enabled: true xpack.slo.enabled: true xpack.uptime.enabled: true -overrides: - uptime xpack.features.overrides: From ea9ba6828f4b00dc98dc1b7826ac43d7d8b2e9ec Mon Sep 17 00:00:00 2001 From: Bryce Buchanan Date: Mon, 9 Jun 2025 11:14:05 -0700 Subject: [PATCH 04/19] Disables observability overview for logs essentials --- config/serverless.oblt.essentials.yml | 3 +-- .../observability/public/application/index.tsx | 11 +++++++++-- .../observability/public/routes/routes.tsx | 17 ++++++++++------- .../public/navigation_tree.ts | 18 ++++++++++++------ .../serverless_observability/public/plugin.ts | 5 ++++- .../serverless_observability/server/plugin.ts | 13 ++++++++++++- 6 files changed, 48 insertions(+), 19 deletions(-) diff --git a/config/serverless.oblt.essentials.yml b/config/serverless.oblt.essentials.yml index dff76b031bde6..8a6d2224c642d 100644 --- a/config/serverless.oblt.essentials.yml +++ b/config/serverless.oblt.essentials.yml @@ -4,10 +4,9 @@ xpack.infra.enabled: false xpack.slo.enabled: false xpack.apm.enabled: false -uiSettings.overrides.defaultRoute: /app/observability/overview +uiSettings.overrides.defaultRoute: /app/discover xpack.legacy_uptime.enabled: false -# xpack.uptime.enabled: false xpack.ux.enabled: false xpack.uptime.enabled: false diff --git a/x-pack/solutions/observability/plugins/observability/public/application/index.tsx b/x-pack/solutions/observability/plugins/observability/public/application/index.tsx index 20e2ada9eaf74..b854a8730c818 100644 --- a/x-pack/solutions/observability/plugins/observability/public/application/index.tsx +++ b/x-pack/solutions/observability/plugins/observability/public/application/index.tsx @@ -23,15 +23,22 @@ import { Storage } from '@kbn/kibana-utils-plugin/public'; import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; import { PluginContext } from '../context/plugin_context/plugin_context'; import { ConfigSchema, ObservabilityPublicPluginsStart } from '../plugin'; -import { routes } from '../routes/routes'; +import { routes, completeRoutes } from '../routes/routes'; +import { useKibana } from '../utils/kibana_react'; import { ObservabilityRuleTypeRegistry } from '../rules/create_observability_rule_type_registry'; import { HideableReactQueryDevTools } from './hideable_react_query_dev_tools'; function App() { + const { pricing } = useKibana().services; + const isCompleteOverviewEnabled = pricing.isFeatureAvailable('observability:complete_overview'); + const allRoutes = { + ...routes, + ...(isCompleteOverviewEnabled ? completeRoutes : {}), + }; return ( <> - {Object.keys(routes).map((key) => { + {Object.keys(allRoutes).map((key) => { const path = key as keyof typeof routes; const { handler, exact } = routes[path]; const Wrapper = () => { diff --git a/x-pack/solutions/observability/plugins/observability/public/routes/routes.tsx b/x-pack/solutions/observability/plugins/observability/public/routes/routes.tsx index 615efd58700d2..600ed57fa3688 100644 --- a/x-pack/solutions/observability/plugins/observability/public/routes/routes.tsx +++ b/x-pack/solutions/observability/plugins/observability/public/routes/routes.tsx @@ -62,7 +62,7 @@ function SimpleRedirect({ to, redirectToApp }: { to: string; redirectToApp?: str return null; } -export const routes = { +export const completeRoutes = { [ROOT_PATH]: { handler: () => { return ; @@ -70,24 +70,27 @@ export const routes = { params: {}, exact: true, }, - [LANDING_PATH]: { + [OVERVIEW_PATH]: { handler: () => { return ( - + + + ); }, params: {}, exact: true, }, - [OVERVIEW_PATH]: { +}; + +export const routes = { + [LANDING_PATH]: { handler: () => { return ( - - - + ); }, diff --git a/x-pack/solutions/observability/plugins/serverless_observability/public/navigation_tree.ts b/x-pack/solutions/observability/plugins/serverless_observability/public/navigation_tree.ts index 05cdba1a68cbc..c376be65455ee 100644 --- a/x-pack/solutions/observability/plugins/serverless_observability/public/navigation_tree.ts +++ b/x-pack/solutions/observability/plugins/serverless_observability/public/navigation_tree.ts @@ -10,8 +10,10 @@ import type { NavigationTreeDefinition } from '@kbn/core-chrome-browser'; export const createNavigationTree = ({ streamsAvailable, + overviewAvailable = true, }: { streamsAvailable?: boolean; + overviewAvailable?: boolean; }): NavigationTreeDefinition => { return { body: [ @@ -24,12 +26,16 @@ export const createNavigationTree = ({ isCollapsible: false, breadcrumbStatus: 'hidden', children: [ - { - title: i18n.translate('xpack.serverlessObservability.nav.overview', { - defaultMessage: 'Overview', - }), - link: 'observability-overview', - }, + ...(overviewAvailable + ? [ + { + title: i18n.translate('xpack.serverlessObservability.nav.overview', { + defaultMessage: 'Overview', + }), + link: 'observability-overview' as const, + }, + ] + : []), { title: i18n.translate('xpack.serverlessObservability.nav.discover', { defaultMessage: 'Discover', diff --git a/x-pack/solutions/observability/plugins/serverless_observability/public/plugin.ts b/x-pack/solutions/observability/plugins/serverless_observability/public/plugin.ts index a2bcf08bd29b2..47e2964ecd4d5 100644 --- a/x-pack/solutions/observability/plugins/serverless_observability/public/plugin.ts +++ b/x-pack/solutions/observability/plugins/serverless_observability/public/plugin.ts @@ -43,7 +43,10 @@ export class ServerlessObservabilityPlugin const { serverless, management, security } = setupDeps; const navigationTree$ = (setupDeps.streams?.status$ || of({ status: 'disabled' })).pipe( map(({ status }) => { - return createNavigationTree({ streamsAvailable: status === 'enabled' }); + return createNavigationTree({ + streamsAvailable: status === 'enabled', + overviewAvailable: core.pricing.isFeatureAvailable('observability:complete_overview'), + }); }) ); serverless.setProjectHome('/app/observability/landing'); diff --git a/x-pack/solutions/observability/plugins/serverless_observability/server/plugin.ts b/x-pack/solutions/observability/plugins/serverless_observability/server/plugin.ts index 973bfde638e8c..4490964b9e5d7 100644 --- a/x-pack/solutions/observability/plugins/serverless_observability/server/plugin.ts +++ b/x-pack/solutions/observability/plugins/serverless_observability/server/plugin.ts @@ -26,8 +26,19 @@ export class ServerlessObservabilityPlugin { constructor(_initializerContext: PluginInitializerContext) {} - public setup(_coreSetup: CoreSetup, pluginsSetup: SetupDependencies) { + public setup( + _coreSetup: CoreSetup, + pluginsSetup: SetupDependencies + ) { pluginsSetup.serverless.setupProjectSettings(OBSERVABILITY_PROJECT_SETTINGS); + _coreSetup.pricing.registerProductFeatures([ + { + id: 'observability:complete_overview', + products: [{ name: 'observability', tier: 'complete' }], + description: + 'Observability Overview Complete - Enables overview of the Observability solution.', + }, + ]); return {}; } From a5011b6b910ab385093daa25e24a27d74d050c67 Mon Sep 17 00:00:00 2001 From: Bryce Buchanan Date: Mon, 9 Jun 2025 12:52:40 -0700 Subject: [PATCH 05/19] corrected construction of observability routes --- .../plugins/observability/public/application/index.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/x-pack/solutions/observability/plugins/observability/public/application/index.tsx b/x-pack/solutions/observability/plugins/observability/public/application/index.tsx index b854a8730c818..6d0fe46f7d909 100644 --- a/x-pack/solutions/observability/plugins/observability/public/application/index.tsx +++ b/x-pack/solutions/observability/plugins/observability/public/application/index.tsx @@ -32,15 +32,14 @@ function App() { const { pricing } = useKibana().services; const isCompleteOverviewEnabled = pricing.isFeatureAvailable('observability:complete_overview'); const allRoutes = { - ...routes, - ...(isCompleteOverviewEnabled ? completeRoutes : {}), + ...(isCompleteOverviewEnabled ? { ...completeRoutes, ...routes } : { ...routes }), }; return ( <> {Object.keys(allRoutes).map((key) => { - const path = key as keyof typeof routes; - const { handler, exact } = routes[path]; + const path = key as keyof typeof allRoutes; + const { handler, exact } = allRoutes[path]; const Wrapper = () => { return handler(); }; From 307294cac6945e0b17a5bf67abbc6a610b9d44a5 Mon Sep 17 00:00:00 2001 From: Bryce Buchanan Date: Tue, 10 Jun 2025 09:33:12 -0700 Subject: [PATCH 06/19] disabled AI assistant in essentials --- config/serverless.oblt.essentials.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/serverless.oblt.essentials.yml b/config/serverless.oblt.essentials.yml index 8a6d2224c642d..793346ebf91b9 100644 --- a/config/serverless.oblt.essentials.yml +++ b/config/serverless.oblt.essentials.yml @@ -9,6 +9,7 @@ uiSettings.overrides.defaultRoute: /app/discover xpack.legacy_uptime.enabled: false xpack.ux.enabled: false xpack.uptime.enabled: false +xpack.observabilityAIAssistant.enabled: false xpack.fleet.internal.registry.excludePackages: [ # Oblt integrations From 79ae10b0eab00f115ea4518e99e4a808db38af80 Mon Sep 17 00:00:00 2001 From: Bryce Buchanan Date: Wed, 11 Jun 2025 10:40:49 -0700 Subject: [PATCH 07/19] added tests for pricing feature observability:overview_complete --- config/serverless.oblt.essentials.yml | 2 +- .../public/application/application.test.tsx | 55 ++++++++++++++++++- .../public/application/index.tsx | 2 +- .../serverless_observability/jest.config.js | 18 ++++++ .../public/navigation_tree.test.ts | 36 ++++++++++++ 5 files changed, 109 insertions(+), 4 deletions(-) create mode 100644 x-pack/solutions/observability/plugins/serverless_observability/jest.config.js create mode 100644 x-pack/solutions/observability/plugins/serverless_observability/public/navigation_tree.test.ts diff --git a/config/serverless.oblt.essentials.yml b/config/serverless.oblt.essentials.yml index 793346ebf91b9..8ca053d17dc11 100644 --- a/config/serverless.oblt.essentials.yml +++ b/config/serverless.oblt.essentials.yml @@ -9,7 +9,7 @@ uiSettings.overrides.defaultRoute: /app/discover xpack.legacy_uptime.enabled: false xpack.ux.enabled: false xpack.uptime.enabled: false -xpack.observabilityAIAssistant.enabled: false +# xpack.observabilityAIAssistant.enabled: false xpack.fleet.internal.registry.excludePackages: [ # Oblt integrations diff --git a/x-pack/solutions/observability/plugins/observability/public/application/application.test.tsx b/x-pack/solutions/observability/plugins/observability/public/application/application.test.tsx index c1148cb7d38df..94700a9a79ddb 100644 --- a/x-pack/solutions/observability/plugins/observability/public/application/application.test.tsx +++ b/x-pack/solutions/observability/plugins/observability/public/application/application.test.tsx @@ -5,17 +5,23 @@ * 2.0. */ -import { createMemoryHistory } from 'history'; +import { screen, render } from '@testing-library/react'; +import { pricingServiceMock } from '@kbn/core-pricing-browser-mocks'; import { noop } from 'lodash'; import React from 'react'; +import { MemoryRouter } from 'react-router-dom'; import { Observable } from 'rxjs'; +import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; + import { AppMountParameters, CoreStart } from '@kbn/core/public'; import { themeServiceMock } from '@kbn/core/public/mocks'; import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; import { ConfigSchema, ObservabilityPublicPluginsStart } from '../plugin'; import { createObservabilityRuleTypeRegistryMock } from '../rules/observability_rule_type_registry_mock'; -import { renderApp } from '.'; +import { renderApp, App } from '.'; import { mockService } from '@kbn/observability-ai-assistant-plugin/public/mock'; +import { createMemoryHistory } from 'history'; +import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; describe('renderApp', () => { const originalConsole = global.console; @@ -123,4 +129,49 @@ describe('renderApp', () => { expect(mockSearchSessionClear).toBeCalled(); }); + + it('should adjust routes for complete', () => { + const pricingStart = pricingServiceMock.createStartContract(); + + // Mock feature availability + pricingStart.isFeatureAvailable.mockImplementation((featureId) => { + if (featureId === 'observability:complete_overview') { + return true; + } + return true; + }); + + render( + + + + + + + + ); + expect(document.body.textContent).toContain('Unable to load page'); + }); + it('should adjust routes for essentials', () => { + const pricingStart = pricingServiceMock.createStartContract(); + + // Mock feature availability + pricingStart.isFeatureAvailable.mockImplementation((featureId) => { + if (featureId === 'observability:complete_overview') { + return false; + } + return true; + }); + + render( + + + + + + + + ); + expect(document.body.textContent).not.toContain('Unable to load page'); + }); }); diff --git a/x-pack/solutions/observability/plugins/observability/public/application/index.tsx b/x-pack/solutions/observability/plugins/observability/public/application/index.tsx index 6d0fe46f7d909..946392d1ce2f3 100644 --- a/x-pack/solutions/observability/plugins/observability/public/application/index.tsx +++ b/x-pack/solutions/observability/plugins/observability/public/application/index.tsx @@ -28,7 +28,7 @@ import { useKibana } from '../utils/kibana_react'; import { ObservabilityRuleTypeRegistry } from '../rules/create_observability_rule_type_registry'; import { HideableReactQueryDevTools } from './hideable_react_query_dev_tools'; -function App() { +export function App() { const { pricing } = useKibana().services; const isCompleteOverviewEnabled = pricing.isFeatureAvailable('observability:complete_overview'); const allRoutes = { diff --git a/x-pack/solutions/observability/plugins/serverless_observability/jest.config.js b/x-pack/solutions/observability/plugins/serverless_observability/jest.config.js new file mode 100644 index 0000000000000..1b711d3fd7411 --- /dev/null +++ b/x-pack/solutions/observability/plugins/serverless_observability/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/solutions/observability/plugins/serverless_observability'], + coverageDirectory: + '/target/kibana-coverage/jest/x-pack/solutions/observability/plugins/serverless_observability', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/solutions/observability/plugins/serverless_observability/{common,public,server}/**/*.{js,ts,tsx}', + ], +}; diff --git a/x-pack/solutions/observability/plugins/serverless_observability/public/navigation_tree.test.ts b/x-pack/solutions/observability/plugins/serverless_observability/public/navigation_tree.test.ts new file mode 100644 index 0000000000000..fb957192c6405 --- /dev/null +++ b/x-pack/solutions/observability/plugins/serverless_observability/public/navigation_tree.test.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. + */ + +import { createNavigationTree } from './navigation_tree'; +import type { GroupDefinition, AppDeepLinkId } from '@kbn/core-chrome-browser'; + +describe('Navigation Tree', () => { + it('should generate tree with overview', () => { + const navigation = createNavigationTree({}); + expect((navigation.body[0] as GroupDefinition).children).toEqual( + expect.arrayContaining([ + { + title: 'Overview', + link: 'observability-overview', + }, + ]) + ); + }); + it('should not generate tree with overview', () => { + const navigation = createNavigationTree({ overviewAvailable: false }); + expect( + (navigation.body[0] as GroupDefinition).children + ).not.toEqual( + expect.arrayContaining([ + { + title: 'Overview', + link: 'observability-overview', + }, + ]) + ); + }); +}); From 925bee3371ebe76df8c84b0a0fd92252d9e46510 Mon Sep 17 00:00:00 2001 From: Bryce Buchanan Date: Wed, 11 Jun 2025 10:56:05 -0700 Subject: [PATCH 08/19] removed unused import --- .../observability/public/application/application.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/solutions/observability/plugins/observability/public/application/application.test.tsx b/x-pack/solutions/observability/plugins/observability/public/application/application.test.tsx index 94700a9a79ddb..040373e903a88 100644 --- a/x-pack/solutions/observability/plugins/observability/public/application/application.test.tsx +++ b/x-pack/solutions/observability/plugins/observability/public/application/application.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { screen, render } from '@testing-library/react'; +import { render } from '@testing-library/react'; import { pricingServiceMock } from '@kbn/core-pricing-browser-mocks'; import { noop } from 'lodash'; import React from 'react'; From 0a49d62cd2882b143c3b7cf627a2bca57d19cd13 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 11 Jun 2025 18:08:08 +0000 Subject: [PATCH 09/19] [CI] Auto-commit changed files from 'node scripts/styled_components_mapping' --- .../observability/plugins/observability/tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/solutions/observability/plugins/observability/tsconfig.json b/x-pack/solutions/observability/plugins/observability/tsconfig.json index d6b65767f1e11..14cae1558b47b 100644 --- a/x-pack/solutions/observability/plugins/observability/tsconfig.json +++ b/x-pack/solutions/observability/plugins/observability/tsconfig.json @@ -121,7 +121,8 @@ "@kbn/deeplinks-analytics", "@kbn/object-utils", "@kbn/task-manager-plugin", - "@kbn/core-saved-objects-server" + "@kbn/core-saved-objects-server", + "@kbn/core-pricing-browser-mocks" ], "exclude": ["target/**/*"] } From 081fbedc79206ffd2022ee0ce2cdc2b59b4a6bd6 Mon Sep 17 00:00:00 2001 From: Bryce Buchanan Date: Wed, 11 Jun 2025 11:38:20 -0700 Subject: [PATCH 10/19] duplicate root fleet registery exludes for essentials --- config/serverless.oblt.essentials.yml | 28 +++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/config/serverless.oblt.essentials.yml b/config/serverless.oblt.essentials.yml index 8ca053d17dc11..b8bf093045b44 100644 --- a/config/serverless.oblt.essentials.yml +++ b/config/serverless.oblt.essentials.yml @@ -16,4 +16,32 @@ xpack.fleet.internal.registry.excludePackages: [ 'synthetics', 'uptime', 'synthetics_dashboards', + # Security integrations + 'endpoint', + 'beaconing', + 'cloud_security_posture', + 'cloud_defend', + 'security_detection_engine', + + # Deprecated security integrations + 'bluecoat', + 'cisco', + 'cyberark', + 'cylance', + 'f5', + 'fortinet_forticlient', + 'juniper_junos', + 'juniper_netscreen', + 'microsoft', + 'netscout', + 'radware', + 'symantec', + 'tomcat', + + # ML integrations + 'dga', + + # Profiling integrations + 'profiler_agent', + 'synthetics_dashboards', ] \ No newline at end of file From 35bfa6239567586a0afb194619289359ec33d9a6 Mon Sep 17 00:00:00 2001 From: Bryce Buchanan Date: Thu, 12 Jun 2025 10:43:17 -0700 Subject: [PATCH 11/19] reduced redundant code in test --- .../public/application/application.test.tsx | 49 ++++++++++--------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/x-pack/solutions/observability/plugins/observability/public/application/application.test.tsx b/x-pack/solutions/observability/plugins/observability/public/application/application.test.tsx index 040373e903a88..be45573e99038 100644 --- a/x-pack/solutions/observability/plugins/observability/public/application/application.test.tsx +++ b/x-pack/solutions/observability/plugins/observability/public/application/application.test.tsx @@ -8,7 +8,7 @@ import { render } from '@testing-library/react'; import { pricingServiceMock } from '@kbn/core-pricing-browser-mocks'; import { noop } from 'lodash'; -import React from 'react'; +import React, { ReactNode } from 'react'; import { MemoryRouter } from 'react-router-dom'; import { Observable } from 'rxjs'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; @@ -35,6 +35,8 @@ describe('renderApp', () => { global.console = originalConsole; }); + let pricingStart: ReturnType; + const mockSearchSessionClear = jest.fn(); const plugins = { @@ -88,6 +90,14 @@ describe('renderApp', () => { }, }; + beforeEach(() => { + pricingStart = pricingServiceMock.createStartContract(); + }); + + afterEach(() => { + jest.restoreAllMocks(); + }); + it('renders', async () => { expect(() => { const unmount = renderApp({ @@ -130,9 +140,19 @@ describe('renderApp', () => { expect(mockSearchSessionClear).toBeCalled(); }); - it('should adjust routes for complete', () => { - const pricingStart = pricingServiceMock.createStartContract(); + function AppWrapper({ children }: { children?: ReactNode }) { + return ( + + + + + + + + ); + } + it('should adjust routes for complete', () => { // Mock feature availability pricingStart.isFeatureAvailable.mockImplementation((featureId) => { if (featureId === 'observability:complete_overview') { @@ -141,20 +161,11 @@ describe('renderApp', () => { return true; }); - render( - - - - - - - - ); + render(, { wrapper: AppWrapper }); expect(document.body.textContent).toContain('Unable to load page'); }); - it('should adjust routes for essentials', () => { - const pricingStart = pricingServiceMock.createStartContract(); + it('should adjust routes for essentials', () => { // Mock feature availability pricingStart.isFeatureAvailable.mockImplementation((featureId) => { if (featureId === 'observability:complete_overview') { @@ -163,15 +174,7 @@ describe('renderApp', () => { return true; }); - render( - - - - - - - - ); + render(, { wrapper: AppWrapper }); expect(document.body.textContent).not.toContain('Unable to load page'); }); }); From ed6ced07bc9251a30862a4b0621061e405d586b3 Mon Sep 17 00:00:00 2001 From: Bryce Buchanan Date: Tue, 17 Jun 2025 13:47:55 -0700 Subject: [PATCH 12/19] cleaned up settings moved some overrides out of the common serverless.oblt.yml into '.complete.yml, as they were conflicting with logs-essentials settings --- config/serverless.oblt.complete.yml | 86 +++++------------------------ config/serverless.oblt.yml | 16 ------ 2 files changed, 15 insertions(+), 87 deletions(-) diff --git a/config/serverless.oblt.complete.yml b/config/serverless.oblt.complete.yml index b43a33e4c5322..8ab6ea4fb9cb7 100644 --- a/config/serverless.oblt.complete.yml +++ b/config/serverless.oblt.complete.yml @@ -5,76 +5,20 @@ xpack.infra.enabled: true xpack.slo.enabled: true xpack.uptime.enabled: true - xpack.features.overrides: -### Applications feature privileges are fine-tuned to grant access to Logs, and Observability apps. - apm: - ### By default, this feature named as `APM and User Experience`, but should be renamed to `Applications`. - name: "Applications" - privileges: - # Infrastructure's `All` feature privilege should implicitly grant `All` access to Logs and Observability apps. - all.composedOf: - - feature: "logs" - privileges: [ "all" ] - - feature: "observability" - privileges: [ "all" ] - # Infrastructure's `Read` feature privilege should implicitly grant `Read` access to Logs and Observability apps. - read.composedOf: - - feature: "logs" - privileges: [ "read" ] - - feature: "observability" - privileges: [ "read" ] - ### Fleet feature privileges are fine-tuned to grant access to Logs app. - ### Synthetics feature privileges are fine-tuned to grant access to Observability app. - uptime: - ### By default, this feature named as `Synthetics and Uptime`, but should be renamed to `Synthetics` since `Uptime` is not available. - name: "Synthetics" - privileges: - # Synthetics `All` feature privilege should implicitly grant `All` access to Observability app. - all.composedOf: - - feature: "observability" - privileges: [ "all" ] - # Synthetics `Read` feature privilege should implicitly grant `Read` access to Observability app. - read.composedOf: - - feature: "observability" - privileges: [ "read" ] - fleetv2: - privileges: - # Fleet `All` feature privilege should implicitly grant `All` access to Logs app. - all.composedOf: - - feature: "logs" - privileges: [ "all" ] - # Fleet `Read` feature privilege should implicitly grant `Read` access to Logs app. - read.composedOf: - - feature: "logs" - privileges: [ "read" ] - infrastructure: - ### By default, this feature named as `Metrics`, but should be renamed to `Infrastructure`. - name: "Infrastructure" - privileges: - # Infrastructure's `All` feature privilege should implicitly grant `All` access to Logs and Observability apps. - all.composedOf: - - feature: "logs" - privileges: [ "all" ] - - feature: "observability" - privileges: [ "all" ] - # Infrastructure's `Read` feature privilege should implicitly grant `Read` access to Logs and Observability apps. - read.composedOf: - - feature: "logs" - privileges: [ "read" ] - - feature: "observability" - privileges: [ "read" ] - ### Logs feature is hidden in Role management since it's automatically granted by either Infrastructure, or Applications features. - logs.hidden: true - slo: - privileges: - # SLOs `All` feature privilege should implicitly grant `All` access to Observability app. - all.composedOf: - - feature: "observability" - privileges: [ "all" ] - # SLOs `Read` feature privilege should implicitly grant `Read` access to Observability app. - read.composedOf: - - feature: "observability" - privileges: [ "read" ] - ### By default, this feature named as `Metrics`, but should be renamed to `Infrastructure`. infrastructure.name: 'Infrastructure' + ### By default, this feature named as `APM and User Experience`, but should be renamed to `Applications`. + apm.name: 'Applications' + ### Dashboards feature should be moved from Analytics category to the Observability one. + dashboard_v2.category: 'observability' + ### Discover feature should be moved from Analytics category to the Observability one and its privileges are + ### fine-tuned to grant access to Observability app. + discover_v2.category: 'observability' + ### Machine Learning feature should be moved from Analytics category to the Observability one and renamed to `AI Ops`. + ml: + category: 'observability' + order: 1200 + ### Stack alerts is hidden in Role management since it's not needed. + stackAlerts.hidden: true + ### By default, this feature named as `Synthetics and Uptime`, but should be renamed to `Synthetics` since `Uptime` is not available. + uptime.name: 'Synthetics' \ No newline at end of file diff --git a/config/serverless.oblt.yml b/config/serverless.oblt.yml index 9d80ea69453fa..c14c21ab2eb9b 100644 --- a/config/serverless.oblt.yml +++ b/config/serverless.oblt.yml @@ -13,22 +13,6 @@ plugins.allowlistPluginGroups: ['platform', 'observability'] xpack.ux.enabled: false xpack.legacy_uptime.enabled: false -xpack.features.overrides: - ### By default, this feature named as `APM and User Experience`, but should be renamed to `Applications`. - apm.name: 'Applications' - ### Dashboards feature should be moved from Analytics category to the Observability one. - dashboard_v2.category: 'observability' - ### Discover feature should be moved from Analytics category to the Observability one and its privileges are - ### fine-tuned to grant access to Observability app. - discover_v2.category: 'observability' - ### Machine Learning feature should be moved from Analytics category to the Observability one and renamed to `AI Ops`. - ml: - category: 'observability' - order: 1200 - ### Stack alerts is hidden in Role management since it's not needed. - stackAlerts.hidden: true - ### By default, this feature named as `Synthetics and Uptime`, but should be renamed to `Synthetics` since `Uptime` is not available. - uptime.name: 'Synthetics' ## Cloud settings xpack.cloud.serverless.project_type: observability From 8f85d656903ff8ed08518a31e554b8e8cba0185f Mon Sep 17 00:00:00 2001 From: Bryce Buchanan Date: Wed, 18 Jun 2025 09:27:57 -0700 Subject: [PATCH 13/19] changed navigation test to use discover, vs landing page --- .../functional/services/svl_oblt_navigation.ts | 6 ++++++ .../observability/logs_essentials_only/navigation.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/x-pack/test_serverless/functional/services/svl_oblt_navigation.ts b/x-pack/test_serverless/functional/services/svl_oblt_navigation.ts index a028626f8a11d..c16f5b380c607 100644 --- a/x-pack/test_serverless/functional/services/svl_oblt_navigation.ts +++ b/x-pack/test_serverless/functional/services/svl_oblt_navigation.ts @@ -22,5 +22,11 @@ export function SvlObltNavigationServiceProvider({ await testSubjects.existOrFail('obltOnboardingHomeTitle', { timeout: 2000 }); }); }, + async navigateToDiscoverPage() { + await retry.tryForTime(60 * 1000, async () => { + await PageObjects.common.navigateToApp('discover'); + await testSubjects.existOrFail('discoverPage', { timeout: 2000 }); + }); + }, }; } diff --git a/x-pack/test_serverless/functional/test_suites/observability/logs_essentials_only/navigation.ts b/x-pack/test_serverless/functional/test_suites/observability/logs_essentials_only/navigation.ts index 9f3bd4d7d42d0..6c112f3e84ab8 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/logs_essentials_only/navigation.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/logs_essentials_only/navigation.ts @@ -15,7 +15,7 @@ export default function ({ getPageObject, getService }: FtrProviderContext) { describe('navigation', function () { before(async () => { await svlCommonPage.loginWithPrivilegedRole(); - await svlObltNavigation.navigateToLandingPage(); + await svlObltNavigation.navigateToDiscoverPage(); }); it('does not show the SLO entry', async () => { From 34c92fed1962aa048412d2af3675a5d8d3b88b8c Mon Sep 17 00:00:00 2001 From: Bryce Buchanan Date: Wed, 18 Jun 2025 10:34:03 -0700 Subject: [PATCH 14/19] changed test navigation from removed landing page to discover --- .../functional/services/svl_oblt_navigation.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/test_serverless/functional/services/svl_oblt_navigation.ts b/x-pack/test_serverless/functional/services/svl_oblt_navigation.ts index c16f5b380c607..48754474fb58b 100644 --- a/x-pack/test_serverless/functional/services/svl_oblt_navigation.ts +++ b/x-pack/test_serverless/functional/services/svl_oblt_navigation.ts @@ -13,7 +13,7 @@ export function SvlObltNavigationServiceProvider({ }: FtrProviderContext) { const retry = getService('retry'); const testSubjects = getService('testSubjects'); - const PageObjects = getPageObjects(['common']); + const PageObjects = getPageObjects(['common', 'header']); return { async navigateToLandingPage() { @@ -25,7 +25,7 @@ export function SvlObltNavigationServiceProvider({ async navigateToDiscoverPage() { await retry.tryForTime(60 * 1000, async () => { await PageObjects.common.navigateToApp('discover'); - await testSubjects.existOrFail('discoverPage', { timeout: 2000 }); + await PageObjects.header.waitUntilLoadingHasFinished(); }); }, }; From d555b4cb24b20488b12bcc1ad9dc902673fd5347 Mon Sep 17 00:00:00 2001 From: Bryce Buchanan Date: Fri, 20 Jun 2025 09:03:44 -0700 Subject: [PATCH 15/19] replaced flaky spinner wait in test --- .../functional/services/svl_oblt_navigation.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/test_serverless/functional/services/svl_oblt_navigation.ts b/x-pack/test_serverless/functional/services/svl_oblt_navigation.ts index 48754474fb58b..8ca19c4712207 100644 --- a/x-pack/test_serverless/functional/services/svl_oblt_navigation.ts +++ b/x-pack/test_serverless/functional/services/svl_oblt_navigation.ts @@ -13,7 +13,7 @@ export function SvlObltNavigationServiceProvider({ }: FtrProviderContext) { const retry = getService('retry'); const testSubjects = getService('testSubjects'); - const PageObjects = getPageObjects(['common', 'header']); + const PageObjects = getPageObjects(['common', 'header', 'discover']); return { async navigateToLandingPage() { @@ -25,7 +25,7 @@ export function SvlObltNavigationServiceProvider({ async navigateToDiscoverPage() { await retry.tryForTime(60 * 1000, async () => { await PageObjects.common.navigateToApp('discover'); - await PageObjects.header.waitUntilLoadingHasFinished(); + await PageObjects.header.awaitKibanaChrome(); }); }, }; From 317d5acd27ed6f8803ccc731f8dbc2d618e2ca9e Mon Sep 17 00:00:00 2001 From: Bryce Buchanan Date: Fri, 20 Jun 2025 11:24:35 -0700 Subject: [PATCH 16/19] updated discover nav method with testSubject validation --- .../observability/plugins/observability/tsconfig.json | 4 ++-- .../functional/services/svl_oblt_navigation.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/x-pack/solutions/observability/plugins/observability/tsconfig.json b/x-pack/solutions/observability/plugins/observability/tsconfig.json index 9ffc1a914e028..baa1f1f88bd15 100644 --- a/x-pack/solutions/observability/plugins/observability/tsconfig.json +++ b/x-pack/solutions/observability/plugins/observability/tsconfig.json @@ -122,8 +122,8 @@ "@kbn/object-utils", "@kbn/task-manager-plugin", "@kbn/core-saved-objects-server", - "@kbn/core-pricing-browser-mocks" - "@kbn/esql" + "@kbn/core-pricing-browser-mocks", + "@kbn/esql", ], "exclude": ["target/**/*"] } diff --git a/x-pack/test_serverless/functional/services/svl_oblt_navigation.ts b/x-pack/test_serverless/functional/services/svl_oblt_navigation.ts index 8ca19c4712207..0acd4863b52aa 100644 --- a/x-pack/test_serverless/functional/services/svl_oblt_navigation.ts +++ b/x-pack/test_serverless/functional/services/svl_oblt_navigation.ts @@ -13,7 +13,7 @@ export function SvlObltNavigationServiceProvider({ }: FtrProviderContext) { const retry = getService('retry'); const testSubjects = getService('testSubjects'); - const PageObjects = getPageObjects(['common', 'header', 'discover']); + const PageObjects = getPageObjects(['common', 'header']); return { async navigateToLandingPage() { @@ -25,7 +25,7 @@ export function SvlObltNavigationServiceProvider({ async navigateToDiscoverPage() { await retry.tryForTime(60 * 1000, async () => { await PageObjects.common.navigateToApp('discover'); - await PageObjects.header.awaitKibanaChrome(); + await testSubjects.exists('discoverQueryTotalHits', { timeout: 20_000 }); }); }, }; From 4fcc6dcbc91ac34b038a1a179171f613ab981b98 Mon Sep 17 00:00:00 2001 From: Bryce Buchanan Date: Mon, 23 Jun 2025 08:34:58 -0700 Subject: [PATCH 17/19] removed default landing page from logs_essentials yml per feedback --- config/serverless.oblt.logs_essentials.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/config/serverless.oblt.logs_essentials.yml b/config/serverless.oblt.logs_essentials.yml index 5920abd2fd0a8..804195c0f89e2 100644 --- a/config/serverless.oblt.logs_essentials.yml +++ b/config/serverless.oblt.logs_essentials.yml @@ -5,7 +5,6 @@ xpack.infra.enabled: false xpack.slo.enabled: false xpack.observabilityAIAssistant.enabled: false xpack.apm.enabled: false -uiSettings.overrides.defaultRoute: /app/discover xpack.legacy_uptime.enabled: false xpack.ux.enabled: false From 0338e439397a77c3d3a866df1bfbcfe741001e91 Mon Sep 17 00:00:00 2001 From: Bryce Buchanan Date: Mon, 23 Jun 2025 08:45:37 -0700 Subject: [PATCH 18/19] removed duplicated listing --- config/serverless.oblt.logs_essentials.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/config/serverless.oblt.logs_essentials.yml b/config/serverless.oblt.logs_essentials.yml index 804195c0f89e2..27b41a0df3c4e 100644 --- a/config/serverless.oblt.logs_essentials.yml +++ b/config/serverless.oblt.logs_essentials.yml @@ -15,7 +15,6 @@ xpack.fleet.internal.registry.excludePackages: [ # Oblt integrations 'synthetics', 'uptime', - 'synthetics_dashboards', # Security integrations 'endpoint', 'beaconing', From 662e84f4b1776c13b2ca6f6949d759a8cbf376ca Mon Sep 17 00:00:00 2001 From: Bryce Buchanan Date: Mon, 23 Jun 2025 11:32:56 -0700 Subject: [PATCH 19/19] removed uptime from fleet package excludes --- config/serverless.oblt.logs_essentials.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/config/serverless.oblt.logs_essentials.yml b/config/serverless.oblt.logs_essentials.yml index 27b41a0df3c4e..d49753729e694 100644 --- a/config/serverless.oblt.logs_essentials.yml +++ b/config/serverless.oblt.logs_essentials.yml @@ -14,7 +14,6 @@ xpack.uptime.enabled: false xpack.fleet.internal.registry.excludePackages: [ # Oblt integrations 'synthetics', - 'uptime', # Security integrations 'endpoint', 'beaconing',