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

[Observability] Serverless navigation #157139

Closed
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
3 changes: 3 additions & 0 deletions config/serverless.oblt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ xpack.securitySolution.enabled: false
## Enable the Serverless Obsersability plugin
xpack.serverless.observability.enabled: true

# Onboarding
xpack.observability_onboarding.ui.enabled: true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ogupte @yngrdyn Any objections with enabling obs onboarding by default on serverless?


## Configure plugins
xpack.infra.logs.app_target: discover

Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ pageLoadAssetSize:
security: 65433
securitySolution: 66738
serverless: 16573
serverlessObservability: 16582
serverlessObservability: 30000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where did this limit come from?

serverlessSearch: 22555
serverlessSecurity: 41807
sessionView: 77750
Expand Down
11 changes: 2 additions & 9 deletions x-pack/plugins/serverless_observability/kibana.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,8 @@
"id": "serverlessObservability",
"server": true,
"browser": true,
"configPath": [
"xpack",
"serverless",
"observability"
],
"requiredPlugins": [
"serverless",
"observabilityShared"
],
"configPath": ["xpack", "serverless", "observability"],
"requiredPlugins": ["serverless", "observabilityShared", "kibanaReact"],
"optionalPlugins": [],
"requiredBundles": []
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import React from 'react';
import { CoreStart } from '@kbn/core/public';
import type {
SideNavComponent,
SideNavCompProps,
} from '@kbn/core-chrome-browser/src/project_navigation';
import { ServerlessObservabilityPluginStartDependencies } from '../../types';
import { ObservabilitySideNavigation } from './side_navigation';
import { KibanaServicesProvider } from '../../services';

export const getObservabilitySideNavComponent = (
core: CoreStart,
pluginsStart: ServerlessObservabilityPluginStartDependencies
): SideNavComponent => {
return (_props: SideNavCompProps) => (
<KibanaServicesProvider core={core} pluginsStart={pluginsStart}>
<ObservabilitySideNavigation />
</KibanaServicesProvider>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import React from 'react';
import { SolutionNav } from '@kbn/shared-ux-page-solution-nav';

export function ObservabilitySideNavigation() {
return (
<SolutionNav
items={[
{
id: 'services-infra',
name: undefined,
items: [
{
id: 'services',
name: 'Services',
},
{
id: 'infra',
name: 'Infrastructure',
},
],
},

{
id: 'alerts-cases-slos',
name: undefined,
items: [
{
id: 'alerts',
name: 'Alerts',
},
{
id: 'Cases',
name: 'Cases',
},
{
id: 'slos',
name: 'SLOs',
},
],
},

{
id: 'signals',
name: 'Signals',
items: [
{
id: 'traces',
name: 'Traces',
},
{
id: 'logs',
name: 'Logs',
},
],
},

{
id: 'toolbox',
name: 'Toolbox',
items: [
{
id: 'visualization',
name: 'Visualization',
},
{
id: 'dashboards',
name: 'Dashboards',
},
],
},
]}
canBeCollapsed={false}
name={'Observability'}
icon={'logoObservability'}
closeFlyoutButtonPosition={'inside'}
/>
);
}
5 changes: 4 additions & 1 deletion x-pack/plugins/serverless_observability/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

import { CoreSetup, CoreStart, Plugin } from '@kbn/core/public';
import { getObservabilitySideNavComponent } from './components/side_navigation';
import {
ServerlessObservabilityPluginSetup,
ServerlessObservabilityPluginStart,
Expand All @@ -25,8 +26,10 @@ export class ServerlessObservabilityPlugin

public start(
_core: CoreStart,
{ observabilityShared }: ServerlessObservabilityPluginStartDependencies
_setupDeps: ServerlessObservabilityPluginStartDependencies
): ServerlessObservabilityPluginStart {
const { serverless, observabilityShared } = _setupDeps;
serverless.setSideNavComponent(getObservabilitySideNavComponent(_core, _setupDeps));
observabilityShared.setIsSidebarEnabled(false);
return {};
}
Expand Down
26 changes: 26 additions & 0 deletions x-pack/plugins/serverless_observability/public/services.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { CoreStart } from '@kbn/core/public';
import React from 'react';
import {
KibanaContextProvider,
useKibana as useKibanaReact,
} from '@kbn/kibana-react-plugin/public';
import type { ServerlessObservabilityPluginStartDependencies } from './types';

export type Services = CoreStart & ServerlessObservabilityPluginStartDependencies;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the type doesn't seem to be used in another file


export const KibanaServicesProvider: React.FC<{
core: CoreStart;
pluginsStart: ServerlessObservabilityPluginStartDependencies;
}> = ({ core, pluginsStart, children }) => {
const services: Services = { ...core, ...pluginsStart };
return <KibanaContextProvider services={services}>{children}</KibanaContextProvider>;
};

export const useKibana = () => useKibanaReact<Services>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this being used anywhere?

3 changes: 3 additions & 0 deletions x-pack/plugins/serverless_observability/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@
"@kbn/config-schema",
"@kbn/serverless",
"@kbn/observability-shared-plugin",
"@kbn/core-chrome-browser",
"@kbn/shared-ux-page-solution-nav",
"@kbn/kibana-react-plugin",
]
}