Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Inventory] Use observability:entitycentricexperience to enable + side nav adjustments #193533

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
d74c52a
[Inventory] Remove inventory dependencies
kpatticha Sep 17, 2024
9acb105
Use deep links to show the inventory nav
kpatticha Sep 18, 2024
cfcbf71
Merge branch 'main' of github.com:elastic/kibana into remove-inventor…
kpatticha Sep 18, 2024
ff54d98
Address PR comments
kpatticha Sep 18, 2024
660929c
Merge branch 'main' into remove-inventory-dependency-from-observabili…
kpatticha Sep 18, 2024
3a0b5d7
Remove config in InventoryPlugin
iblancof Sep 18, 2024
c5a1975
Show inventory if EntityCentricExperience in stateful generic navigation
iblancof Sep 18, 2024
5993963
Show inventory if EntityCentricExperience in stateful obs navigation
iblancof Sep 18, 2024
fe3534c
Add isTechnicalPreview flag to obs navigation
iblancof Sep 18, 2024
1d98a57
Enable inventory deeplink only if EntityCentricExperience
iblancof Sep 18, 2024
38e3c2b
Add inventory if EntityCentricExperience for serverless nav
iblancof Sep 18, 2024
4fa6393
Merge branch 'main' into 192323-inventory-use-observabilityentitycent…
iblancof Sep 18, 2024
73afa81
Merge branch 'main' into 192323-inventory-use-observabilityentitycent…
iblancof Sep 19, 2024
2cd411f
Remove duplicate plugin register on merge
iblancof Sep 19, 2024
c516aea
Use const for entityCentricExperience
iblancof Sep 19, 2024
7b4d66e
Revert "Remove duplicate plugin register on merge"
iblancof Sep 19, 2024
a49e313
Remove usage of const for entityCentricExperience
iblancof Sep 19, 2024
593ee7d
Handle app status during plugin start based on isEntityCentricExperie…
iblancof Sep 19, 2024
e8f11e1
Manage inventory plugin register status
iblancof Sep 19, 2024
18d9b7e
Revert serverless obs nav tree changes
iblancof Sep 19, 2024
eb5373b
Add tech preview badge to inventory page title
iblancof Sep 19, 2024
1c1b83b
Remove unused attr from serverless nav tree
iblancof Sep 19, 2024
9c6e85b
Rename Services to Service Inventory
iblancof Sep 19, 2024
b82e086
Add missing path match to inventory plugin
iblancof Sep 19, 2024
8dc8c24
Merge branch 'main' into 192323-inventory-use-observabilityentitycent…
iblancof Sep 20, 2024
028a41a
Remove deeplinks from inventory register
iblancof Sep 20, 2024
acc2fe2
[CI] Auto-commit changed files from 'node scripts/yarn_deduplicate'
kibanamachine Sep 20, 2024
0f6dbfa
Fix translation keys in InventoryPageTemplate
iblancof Sep 20, 2024
695c4eb
Merge branch '192323-inventory-use-observabilityentitycentricexperien…
iblancof Sep 20, 2024
624921c
Merge branch 'main' into 192323-inventory-use-observabilityentitycent…
iblancof Sep 20, 2024
d9138cd
Merge branch 'main' into 192323-inventory-use-observabilityentitycent…
iblancof Sep 23, 2024
5130207
Create default INVENTORY_SERVER_FEATURE
iblancof Sep 23, 2024
fa10132
registerKibanaFeature for INVENTORY_SERVER_FEATURE
iblancof Sep 23, 2024
07b5fea
Merge branch 'main' into 192323-inventory-use-observabilityentitycent…
iblancof Sep 23, 2024
b68e2ba
Merge branch 'main' into 192323-inventory-use-observabilityentitycent…
iblancof Sep 23, 2024
fdd825e
Merge branch '192323-inventory-use-observabilityentitycentricexperien…
iblancof Sep 23, 2024
be63a67
[CI] Auto-commit changed files from 'node scripts/yarn_deduplicate'
kibanamachine Sep 23, 2024
0ec129c
Merge branch 'main' into 192323-inventory-use-observabilityentitycent…
iblancof Sep 23, 2024
567a552
Merge branch 'main' into 192323-inventory-use-observabilityentitycent…
iblancof Sep 25, 2024
05c7a9a
Merge branch 192323-inventory-use-observabilityentitycentricexperienc…
iblancof Sep 25, 2024
ec7d088
Remove duplicated import
iblancof Sep 25, 2024
ce2fb41
Change Inventory order in stateful menu
iblancof Sep 25, 2024
04cca5e
Change Inventory order in stateful new
iblancof Sep 25, 2024
f1cd6bd
Change Inventory order in serverless
iblancof Sep 25, 2024
98f6b12
Fixed test for telemetry
iblancof Sep 25, 2024
7b16664
Fixed test for app usage
iblancof Sep 25, 2024
800b0f5
Fix security test
iblancof Sep 25, 2024
9861bea
Fix test for features
iblancof Sep 25, 2024
feb3b37
Fix security test
iblancof Sep 25, 2024
571d154
Fix APM navigation test
iblancof Sep 25, 2024
9f72e8a
Merge branch 'main' into 192323-inventory-use-observabilityentitycent…
iblancof Sep 25, 2024
246d91b
Merge branch '192323-inventory-use-observabilityentitycentricexperien…
iblancof Sep 25, 2024
b1844c9
Merge branch 'main' into 192323-inventory-use-observabilityentitycent…
iblancof Sep 25, 2024
a715f24
Run telemetry_check
iblancof Sep 25, 2024
cedc559
Merge branch 'main' into 192323-inventory-use-observabilityentitycent…
iblancof Sep 25, 2024
d40ea41
Merge branch 'main' into 192323-inventory-use-observabilityentitycent…
iblancof Sep 26, 2024
9370ff8
Merge branch 'main' into 192323-inventory-use-observabilityentitycent…
iblancof Sep 26, 2024
48a5958
Use TechnicalPreviewBadge in InventoryPageTemplate
iblancof Sep 26, 2024
24a59e9
Merge branch 'main' into 192323-inventory-use-observabilityentitycent…
iblancof Sep 26, 2024
11886c0
Revert "Remove config in InventoryPlugin"
iblancof Sep 27, 2024
f6fa6a0
Set default enabled value to true
iblancof Sep 27, 2024
ef0ab30
[CI] Auto-commit changed files from 'node scripts/yarn_deduplicate'
kibanamachine Sep 27, 2024
79b4b54
Merge branch 'main' into 192323-inventory-use-observabilityentitycent…
iblancof Sep 27, 2024
fb24df2
Merge branch 'main' into 192323-inventory-use-observabilityentitycent…
iblancof Sep 27, 2024
1becc9a
Remove empty import
iblancof Sep 27, 2024
8857206
Merge branch 'main' into 192323-inventory-use-observabilityentitycent…
iblancof Sep 27, 2024
1110502
Merge branch 'main' into 192323-inventory-use-observabilityentitycent…
iblancof Sep 27, 2024
b61c54e
Merge branch 'main' into 192323-inventory-use-observabilityentitycent…
iblancof Sep 27, 2024
dbe9bc9
Merge branch 'main' into 192323-inventory-use-observabilityentitycent…
iblancof Sep 30, 2024
1ba7b09
Merge branch 'main' into 192323-inventory-use-observabilityentitycent…
iblancof Sep 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ export const applicationUsageSchema = {
fleet: commonSchema,
integrations: commonSchema,
ingestManager: commonSchema,
inventory: commonSchema,
lens: commonSchema,
maps: commonSchema,
ml: commonSchema,
Expand Down
131 changes: 131 additions & 0 deletions src/plugins/telemetry/schema/oss_plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
"entityManager",
"inference",
"dataViews",
"share",
"features",
"unifiedSearch",
"data",
"share"
],
"requiredBundles": [
"kibanaReact"
],
"requiredBundles": ["kibanaReact"],
"optionalPlugins": [],
"extraPublicDirs": []
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
* 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 { EuiEmptyPrompt, EuiLoadingLogo } from '@elastic/eui';
import { EuiFlexGroup, EuiFlexItem, EuiEmptyPrompt, EuiLoadingLogo } 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';
Expand All @@ -16,11 +16,18 @@ import { Welcome } from '../entity_enablement/welcome_modal';
import { useInventoryAbortableAsync } from '../../hooks/use_inventory_abortable_async';
import { EmptyState } from '../empty_states/empty_state';

const pageTitle = {
pageTitle: i18n.translate('xpack.inventory.inventoryPageHeaderLabel', {
defaultMessage: 'Inventory',
}),
};
const pageTitle = (
<EuiFlexGroup gutterSize="s">
<EuiFlexItem grow={false}>
{i18n.translate('xpack.inventory.inventoryPageHeaderLabel', {
defaultMessage: 'Inventory',
})}
</EuiFlexItem>
<EuiFlexItem grow={false}>
<TechnicalPreviewBadge />
</EuiFlexItem>
</EuiFlexGroup>
);

export function InventoryPageTemplate({ children }: { children: React.ReactNode }) {
const {
Expand Down Expand Up @@ -52,20 +59,26 @@ export function InventoryPageTemplate({ children }: { children: React.ReactNode

if (isEnablementLoading || hasDataLoading) {
return (
<ObservabilityPageTemplate pageHeader={pageTitle}>
<ObservabilityPageTemplate
pageHeader={{
pageTitle,
}}
>
<EuiEmptyPrompt icon={<EuiLoadingLogo logo="logoObservability" size="xl" />} />
</ObservabilityPageTemplate>
);
}

return (
<ObservabilityPageTemplate
pageHeader={{
pageTitle,
}}
noDataConfig={getEntityManagerEnablement({
enabled: isEntityManagerEnabled,
loading: isEnablementLoading,
onSuccess: handleSuccess,
})}
pageHeader={pageTitle}
>
{value.hasData ? (
<EuiFlexGroup direction="column">
Expand Down
73 changes: 37 additions & 36 deletions x-pack/plugins/observability_solution/inventory/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
DEFAULT_APP_CATEGORIES,
Plugin,
PluginInitializerContext,
AppStatus,
} from '@kbn/core/public';
import { INVENTORY_APP_ID } from '@kbn/deeplinks-observability/constants';
import { i18n } from '@kbn/i18n';
Expand Down Expand Up @@ -49,33 +50,39 @@ export class InventoryPlugin
pluginsSetup: InventorySetupDependencies
): InventoryPublicSetup {
const inventoryAPIClient = createCallInventoryAPI(coreSetup);
this.telemetry.setup({ analytics: coreSetup.analytics });

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));
},
},
],
},
];
})
)
const isEntityCentricExperienceSettingEnabled = coreSetup.uiSettings.get<boolean>(
'observability:entityCentricExperience',
true
);

if (isEntityCentricExperienceSettingEnabled) {
pluginsSetup.observabilityShared.navigation.registerSections(
from(coreSetup.getStartServices()).pipe(
map(([coreStart, pluginsStart]) => {
return [
{
label: '',
sortKey: 300,
entries: [
{
label: i18n.translate('xpack.inventory.inventoryLinkTitle', {
defaultMessage: 'Inventory',
}),
app: INVENTORY_APP_ID,
path: '/',
matchPath(currentPath: string) {
return ['/', ''].some((testPath) => currentPath.startsWith(testPath));
},
isTechnicalPreview: true,
},
],
},
];
})
)
);
}
this.telemetry.setup({ analytics: coreSetup.analytics });
const telemetry = this.telemetry.start();

coreSetup.application.register({
Expand All @@ -86,17 +93,11 @@ export class InventoryPlugin
euiIconType: 'logoObservability',
appRoute: '/app/observability/inventory',
category: DEFAULT_APP_CATEGORIES.observability,
visibleIn: ['sideNav'],
order: 8001,
deepLinks: [
{
id: 'inventory',
title: i18n.translate('xpack.inventory.inventoryDeepLinkTitle', {
defaultMessage: 'Inventory',
}),
path: '/',
},
],
visibleIn: ['sideNav', 'globalSearch'],
order: 8200,
status: isEntityCentricExperienceSettingEnabled
? AppStatus.accessible
: AppStatus.inaccessible,
mount: async (appMountParameters: AppMountParameters<unknown>) => {
// Load application bundle and Get start services
const [{ renderApp }, [coreStart, pluginsStart]] = await Promise.all([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { schema, type TypeOf } from '@kbn/config-schema';

export const config = schema.object({
iblancof marked this conversation as resolved.
Show resolved Hide resolved
enabled: schema.boolean({ defaultValue: false }),
enabled: schema.boolean({ defaultValue: true }),
});

export type InventoryConfig = TypeOf<typeof config>;
Loading