Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,7 @@ module.exports = {
'x-pack/plugins/observability/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/exploratory_view/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/ux/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/observability_solution/slos/**/*.{js,mjs,ts,tsx}',
],
rules: {
'no-console': ['warn', { allow: ['error'] }],
Expand All @@ -897,6 +898,7 @@ module.exports = {
'x-pack/plugins/apm/**/*.stories.*',
'x-pack/plugins/observability/**/*.stories.*',
'x-pack/plugins/exploratory_view/**/*.stories.*',
'x-pack/plugins/observability_solution/slos/**/*.stories',
],
rules: {
'react/function-component-definition': [
Expand All @@ -918,6 +920,7 @@ module.exports = {
'x-pack/plugins/observability_ai_assistant/**/*.tsx',
'x-pack/plugins/observability_onboarding/**/*.tsx',
'x-pack/plugins/observability_shared/**/*.tsx',
'x-pack/plugins/observability_solution/slos/**/*.tsx',
'x-pack/plugins/profiling/**/*.tsx',
'x-pack/plugins/synthetics/**/*.tsx',
'x-pack/plugins/ux/**/*.tsx',
Expand All @@ -936,6 +939,7 @@ module.exports = {
'x-pack/plugins/observability_ai_assistant/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
'x-pack/plugins/observability_onboarding/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
'x-pack/plugins/observability_shared/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
'x-pack/plugins/observability_solution/slos/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
'x-pack/plugins/profiling/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
'x-pack/plugins/synthetics/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
'x-pack/plugins/ux/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
Expand Down
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,7 @@ x-pack/packages/observability/get_padded_alert_time_range_util @elastic/obs-ux-m
x-pack/plugins/observability_solution/observability_logs_explorer @elastic/obs-ux-logs-team
x-pack/plugins/observability_onboarding @elastic/obs-ux-logs-team
x-pack/plugins/observability @elastic/obs-ux-management-team
x-pack/plugins/observability_solution/slos @elastic/obs-ux-management-team
x-pack/plugins/observability_shared @elastic/observability-ui
x-pack/test/security_api_integration/plugins/oidc_provider @elastic/kibana-security
test/common/plugins/otel_metrics @elastic/obs-ux-infra_services-team
Expand Down
3 changes: 3 additions & 0 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,9 @@ It leverages universal configuration and other APIs in the serverless plugin to
|{kib-repo}blob/{branch}/x-pack/plugins/session_view/README.md[sessionView]
|Session View is meant to provide a visualization into what is going on in a particular Linux environment where the agent is running. It looks likes a terminal emulator; however, it is a tool for introspecting process activity and understanding user and service behaviour in your Linux servers and infrastructure. It is a time-ordered series of process executions displayed in a tree over time.

{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/slos/README.md[slos]
|This plugin contains the SLO components.


|{kib-repo}blob/{branch}/x-pack/plugins/snapshot_restore/README.md[snapshotRestore]
|or
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,7 @@
"@kbn/shared-ux-storybook-mock": "link:packages/shared-ux/storybook/mock",
"@kbn/shared-ux-utility": "link:packages/kbn-shared-ux-utility",
"@kbn/slo-schema": "link:x-pack/packages/kbn-slo-schema",
"@kbn/slos-plugin": "link:x-pack/plugins/observability_solution/slos",
"@kbn/snapshot-restore-plugin": "link:x-pack/plugins/snapshot_restore",
"@kbn/sort-predicates": "link:packages/kbn-sort-predicates",
"@kbn/spaces-plugin": "link:x-pack/plugins/spaces",
Expand Down
1 change: 1 addition & 0 deletions src/dev/storybook/aliases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export const storybookAliases = {
security_solution_packages: 'x-pack/packages/security-solution/storybook/config',
serverless: 'packages/serverless/storybook/config',
shared_ux: 'packages/shared-ux/storybook/config',
slos: 'x-pack/plugins/observability_solution/slos/.storybook',
threat_intelligence: 'x-pack/plugins/threat_intelligence/.storybook',
triggers_actions_ui: 'x-pack/plugins/triggers_actions_ui/.storybook',
ui_actions_enhanced: 'src/plugins/ui_actions_enhanced/.storybook',
Expand Down
2 changes: 2 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -1542,6 +1542,8 @@
"@kbn/shared-ux-utility/*": ["packages/kbn-shared-ux-utility/*"],
"@kbn/slo-schema": ["x-pack/packages/kbn-slo-schema"],
"@kbn/slo-schema/*": ["x-pack/packages/kbn-slo-schema/*"],
"@kbn/slos-plugin": ["x-pack/plugins/observability_solution/slos"],
"@kbn/slos-plugin/*": ["x-pack/plugins/observability_solution/slos/*"],
"@kbn/snapshot-restore-plugin": ["x-pack/plugins/snapshot_restore"],
"@kbn/snapshot-restore-plugin/*": ["x-pack/plugins/snapshot_restore/*"],
"@kbn/some-dev-log": ["packages/kbn-some-dev-log"],
Expand Down
1 change: 1 addition & 0 deletions x-pack/.i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
"xpack.securitySolutionEss": "plugins/security_solution_ess",
"xpack.securitySolutionServerless": "plugins/security_solution_serverless",
"xpack.sessionView": "plugins/session_view",
"xpack.slos": "plugins/observability_solution/slos",
"xpack.snapshotRestore": "plugins/snapshot_restore",
"xpack.spaces": "plugins/spaces",
"xpack.savedObjectsTagging": ["plugins/saved_objects_tagging"],
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/observability/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export const syntheticsSettingsLocatorID = 'SYNTHETICS_SETTINGS';
export const alertsLocatorID = 'ALERTS_LOCATOR';
export const ruleDetailsLocatorID = 'RULE_DETAILS_LOCATOR';
export const rulesLocatorID = 'RULES_LOCATOR';
// TODO remove stuff from here
export const sloDetailsLocatorID = 'SLO_DETAILS_LOCATOR';
export const sloEditLocatorID = 'SLO_EDIT_LOCATOR';
export const sloListLocatorID = 'SLO_LIST_LOCATOR';
Expand Down
2 changes: 2 additions & 0 deletions x-pack/plugins/observability/common/locators/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const EXPLORATORY_VIEW_PATH = '/exploratory-view' as const; // has been m
export const RULES_PATH = '/alerts/rules' as const;
export const RULES_LOGS_PATH = '/alerts/rules/logs' as const;
export const RULE_DETAIL_PATH = '/alerts/rules/:ruleId' as const;
// TODO delete SLO stuff from here
export const SLOS_PATH = '/slos' as const;
export const SLOS_WELCOME_PATH = '/slos/welcome' as const;
export const SLO_DETAIL_PATH = '/slos/:sloId' as const;
Expand All @@ -30,6 +31,7 @@ export const paths = {
`${OBSERVABILITY_BASE_PATH}${ALERTS_PATH}/${encodeURI(alertId)}`,
rules: `${OBSERVABILITY_BASE_PATH}${RULES_PATH}`,
ruleDetails: (ruleId: string) => `${OBSERVABILITY_BASE_PATH}${RULES_PATH}/${encodeURI(ruleId)}`,
// TODO: delete things from here
slos: `${OBSERVABILITY_BASE_PATH}${SLOS_PATH}`,
slosWelcome: `${OBSERVABILITY_BASE_PATH}${SLOS_WELCOME_PATH}`,
slosOutdatedDefinitions: `${OBSERVABILITY_BASE_PATH}${SLOS_OUTDATED_DEFINITIONS_PATH}`,
Expand Down
13 changes: 12 additions & 1 deletion x-pack/plugins/observability/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ export class Plugin
},
],
},
// TODO remove SLOs from here
{
id: 'slos',
title: i18n.translate('xpack.observability.slosLinkTitle', {
Expand Down Expand Up @@ -408,6 +409,16 @@ export class Plugin
]
: [];

const slosLink = [
{
label: i18n.translate('xpack.observability.slosNewLinkTitle', {
defaultMessage: 'SLOs new',
}),
app: 'slos',
path: '/',
},
];

const isAiAssistantEnabled =
pluginsStart.observabilityAIAssistant.service.isEnabled();

Expand Down Expand Up @@ -448,7 +459,7 @@ export class Plugin
{
label: '',
sortKey: 100,
entries: [...overviewLink, ...otherLinks, ...aiAssistantLink],
entries: [...overviewLink, ...slosLink, ...otherLinks, ...aiAssistantLink],
},
];
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function updateGlobalNavigation({
updater$.next(() => ({
deepLinks: updatedDeepLinks,
navLinkStatus:
someVisible || !!capabilities[sloFeatureId]?.read
someVisible || !!capabilities[sloFeatureId]?.read // TODO remove this, since now we have the new plugin
? AppNavLinkStatus.visible
: AppNavLinkStatus.hidden,
}));
Expand Down
22 changes: 22 additions & 0 deletions x-pack/plugins/observability_solution/slos/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# slos

A Kibana plugin

---

## Development

See the [kibana contributing guide](https://github.com/elastic/kibana/blob/main/CONTRIBUTING.md) for instructions setting up your development environment.

## Scripts

<dl>
<dt><code>yarn kbn bootstrap</code></dt>
<dd>Execute this to install node_modules and setup the dependencies in your plugin and in Kibana</dd>

<dt><code>yarn plugin-helpers build</code></dt>
<dd>Execute this to create a distributable version of this plugin that can be installed in Kibana</dd>

<dt><code>yarn plugin-helpers dev --watch</code></dt>
<dd>Execute this to build your plugin ui browser side so Kibana could pick up when started in development</dd>
</dl>
49 changes: 49 additions & 0 deletions x-pack/plugins/observability_solution/slos/common/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* 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.
*/

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export const SLO_MODEL_VERSION = 2;
export const SLO_RESOURCES_VERSION = 3;

export const SLO_COMPONENT_TEMPLATE_MAPPINGS_NAME = '.slo-observability.sli-mappings';
export const SLO_COMPONENT_TEMPLATE_SETTINGS_NAME = '.slo-observability.sli-settings';

export const SLO_INDEX_TEMPLATE_NAME = '.slo-observability.sli';
export const SLO_INDEX_TEMPLATE_PATTERN = `.slo-observability.sli-*`;

export const SLO_DESTINATION_INDEX_NAME = `.slo-observability.sli-v${SLO_RESOURCES_VERSION}`;
export const SLO_DESTINATION_INDEX_PATTERN = `.slo-observability.sli-v${SLO_RESOURCES_VERSION}*`;

export const SLO_INGEST_PIPELINE_NAME = `.slo-observability.sli.pipeline-v${SLO_RESOURCES_VERSION}`;
export const SLO_INGEST_PIPELINE_INDEX_NAME_PREFIX = `.slo-observability.sli-v${SLO_RESOURCES_VERSION}.`;

export const SLO_SUMMARY_COMPONENT_TEMPLATE_MAPPINGS_NAME = '.slo-observability.summary-mappings';
export const SLO_SUMMARY_COMPONENT_TEMPLATE_SETTINGS_NAME = '.slo-observability.summary-settings';
export const SLO_SUMMARY_INDEX_TEMPLATE_NAME = '.slo-observability.summary';
export const SLO_SUMMARY_INDEX_TEMPLATE_PATTERN = `.slo-observability.summary-*`;

export const SLO_SUMMARY_DESTINATION_INDEX_NAME = `.slo-observability.summary-v${SLO_RESOURCES_VERSION}`; // store the temporary summary document generated by transform
export const SLO_SUMMARY_TEMP_INDEX_NAME = `.slo-observability.summary-v${SLO_RESOURCES_VERSION}.temp`; // store the temporary summary document
export const SLO_SUMMARY_DESTINATION_INDEX_PATTERN = `.slo-observability.summary-v${SLO_RESOURCES_VERSION}*`; // include temp and non-temp summary indices

export const getSLOTransformId = (sloId: string, sloRevision: number) =>
`slo-${sloId}-${sloRevision}`;

export const DEFAULT_SLO_PAGE_SIZE = 25;
export const DEFAULT_SLO_GROUPS_PAGE_SIZE = 25;

export const getSLOSummaryTransformId = (sloId: string, sloRevision: number) =>
`slo-summary-${sloId}-${sloRevision}`;

export const getSLOSummaryPipelineId = (sloId: string, sloRevision: number) =>
`.slo-observability.summary.pipeline-${sloId}-${sloRevision}`;
12 changes: 12 additions & 0 deletions x-pack/plugins/observability_solution/slos/common/i18n.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { i18n } from '@kbn/i18n';

export const NOT_AVAILABLE_LABEL = i18n.translate('xpack.slos.notAvailable', {
defaultMessage: 'N/A',
});
18 changes: 18 additions & 0 deletions x-pack/plugins/observability_solution/slos/common/index.ts
Original file line number Diff line number Diff line change
@@ -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.
*/

// TODO rename to slo
export const PLUGIN_ID = 'slos';
export const PLUGIN_NAME = 'SLOs NEW';
export const sloFeatureId = 'slo';

export const sloListLocatorID = 'SLO_LIST_LOCATOR';
export const sloDetailsLocatorID = 'SLO_DETAILS_LOCATOR';
export const sloEditLocatorID = 'SLO_EDIT_LOCATOR';

import { paths } from './locators/paths';
export const sloPaths = paths;
Original file line number Diff line number Diff line change
@@ -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.
*/
export const ROOT_PATH = '/' as const;
export const SLOS_PATH = '/slos' as const;
export const SLOS_WELCOME_PATH = '/slos/welcome' as const;
export const SLO_DETAIL_PATH = '/slos/:sloId' as const;
export const SLO_CREATE_PATH = '/slos/create' as const;
export const SLO_EDIT_PATH = '/slos/edit/:sloId' as const;
export const SLOS_OUTDATED_DEFINITIONS_PATH = '/slos/outdated-definitions' as const;

// TODO export a paths const
export const paths = {
slos: SLOS_PATH,
};
34 changes: 34 additions & 0 deletions x-pack/plugins/observability_solution/slos/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"type": "plugin",
"id": "@kbn/slos-plugin",
"owner": "@elastic/obs-ux-management-team",
"plugin": {
"id": "slos",
"server": true,
"browser": true,
"configPath": [
"xpack",
"slos"
],
"requiredPlugins": [
"observability",
"observabilityShared",
"ruleRegistry",
"triggersActionsUi",
"unifiedSearch",
"uiActions",
"lens",
"embeddable",
"data",
"dataViews",
"dataViewEditor",
"controls",
"presentationUtil",
"licensing"
],
"requiredBundles": [
"kibanaReact",
"kibanaUtils",
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*
* 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 ReactDOM from 'react-dom';
import { EuiErrorBoundary } from '@elastic/eui';
import { KibanaThemeProvider } from '@kbn/react-kibana-context-theme';
import { Router, Routes, Route } from '@kbn/shared-ux-router';
import { AppMountParameters, APP_WRAPPER_CLASS, CoreStart } from '@kbn/core/public';
// import { PluginContext } from '@kbn/exploratory-view-plugin/public/context/plugin_context';
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
import { RedirectAppLinks } from '@kbn/shared-ux-link-redirect-app';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { PluginContext } from '../context/plugin_context';

import { SlosPluginStartDeps } from './types';
import { routes } from '../routes/routes';

// import { ConfigSchema, ObservabilityPublicPluginsStart } from '../plugin';

function App() {
return (
<>
<Routes>
{Object.keys(routes).map((key) => {
const path = key as keyof typeof routes;
const { handler, exact } = routes[path];
const Wrapper = () => {
console.log('!!wrapper');
return handler();
};
return <Route key={path} path={path} exact={exact} component={Wrapper} />;
})}
</Routes>
</>
);
}

export const renderApp = ({ core, plugins, appMountParameters, ObservabilityPageTemplate }) => {
const { element, history, theme$ } = appMountParameters;
const i18nCore = core.i18n;
// ensure all divs are .kbnAppWrappers
element.classList.add(APP_WRAPPER_CLASS);

const CloudProvider = plugins.cloud?.CloudContextProvider ?? React.Fragment;

const queryClient = new QueryClient();

console.log('!!renderApp');
ReactDOM.render(
<EuiErrorBoundary>
<KibanaThemeProvider {...{ theme: { theme$ } }}>
<CloudProvider>
<KibanaContextProvider
services={{
...core,
...plugins,
}}
>
<PluginContext.Provider value={{ appMountParameters, ObservabilityPageTemplate }}>
<Router history={history}>
<i18nCore.Context>
<RedirectAppLinks coreStart={core} data-test-subj="observabilityMainContainer">
<QueryClientProvider client={queryClient}>
<App />
</QueryClientProvider>
</RedirectAppLinks>
</i18nCore.Context>
</Router>
</PluginContext.Provider>
</KibanaContextProvider>
</CloudProvider>
</KibanaThemeProvider>
</EuiErrorBoundary>,
element
);

return () => ReactDOM.unmountComponentAtNode(element);
};
Loading