mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 02:09:32 -04:00
[SLO] Fix slo manifest (#187139)
## Summary
Fix slo manifest !!
`node scripts/plugin_check --dependencies slo
`
<img width="1007" alt="image"
src="9e710897
-6e65-4818-9c51-a23ea18b2a5c">
This commit is contained in:
parent
dd42834209
commit
d9c651f20a
10 changed files with 36 additions and 62 deletions
|
@ -15,8 +15,6 @@
|
|||
"alerting",
|
||||
"cases",
|
||||
"charts",
|
||||
"contentManagement",
|
||||
"controls",
|
||||
"dashboard",
|
||||
"data",
|
||||
"dataViews",
|
||||
|
@ -27,7 +25,6 @@
|
|||
"observability",
|
||||
"observabilityShared",
|
||||
"ruleRegistry",
|
||||
"security",
|
||||
"taskManager",
|
||||
"triggersActionsUi",
|
||||
"share",
|
||||
|
@ -37,7 +34,7 @@
|
|||
"presentationUtil",
|
||||
"features",
|
||||
"licensing",
|
||||
"usageCollection",
|
||||
"usageCollection"
|
||||
],
|
||||
"optionalPlugins": [
|
||||
"cloud",
|
||||
|
@ -47,6 +44,7 @@
|
|||
"observabilityAIAssistant"
|
||||
],
|
||||
"requiredBundles": [
|
||||
"controls",
|
||||
"kibanaReact",
|
||||
"kibanaUtils",
|
||||
"unifiedSearch",
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
import { DefaultEmbeddableApi, EmbeddableInput } from '@kbn/embeddable-plugin/public';
|
||||
import { DefaultEmbeddableApi } from '@kbn/embeddable-plugin/public';
|
||||
import {
|
||||
type CoreStart,
|
||||
IUiSettingsClient,
|
||||
|
@ -15,7 +15,6 @@ import { TriggersAndActionsUIPublicPluginStart } from '@kbn/triggers-actions-ui-
|
|||
import type { DataPublicPluginStart } from '@kbn/data-plugin/public';
|
||||
import { CasesPublicStart } from '@kbn/cases-plugin/public';
|
||||
import { SettingsStart } from '@kbn/core-ui-settings-browser';
|
||||
import { SecurityPluginStart } from '@kbn/security-plugin/public';
|
||||
import type { ChartsPluginStart } from '@kbn/charts-plugin/public';
|
||||
import type { UiActionsStart } from '@kbn/ui-actions-plugin/public';
|
||||
import { ServerlessPluginStart } from '@kbn/serverless/public';
|
||||
|
@ -23,7 +22,6 @@ import {
|
|||
SerializedTitles,
|
||||
PublishesWritablePanelTitle,
|
||||
PublishesPanelTitle,
|
||||
EmbeddableApiContext,
|
||||
HasEditCapabilities,
|
||||
} from '@kbn/presentation-publishing';
|
||||
import { ObservabilityPublicStart } from '@kbn/observability-plugin/public';
|
||||
|
@ -40,8 +38,6 @@ export interface EmbeddableSloProps {
|
|||
showAllGroupByInstances?: boolean;
|
||||
}
|
||||
|
||||
export type SloAlertsEmbeddableInput = EmbeddableInput & EmbeddableSloProps;
|
||||
|
||||
export type SloAlertsEmbeddableState = SerializedTitles & EmbeddableSloProps;
|
||||
|
||||
export type SloAlertsApi = DefaultEmbeddableApi<SloAlertsEmbeddableState> &
|
||||
|
@ -55,18 +51,6 @@ export interface HasSloAlertsConfig {
|
|||
updateSloAlertsConfig: (next: EmbeddableSloProps) => void;
|
||||
}
|
||||
|
||||
export const apiHasSloAlertsConfig = (api: unknown | null): api is HasSloAlertsConfig => {
|
||||
return Boolean(
|
||||
api &&
|
||||
typeof (api as HasSloAlertsConfig).getSloAlertsConfig === 'function' &&
|
||||
typeof (api as HasSloAlertsConfig).updateSloAlertsConfig === 'function'
|
||||
);
|
||||
};
|
||||
|
||||
export type SloAlertsEmbeddableActionContext = EmbeddableApiContext & {
|
||||
embeddable: SloAlertsApi;
|
||||
};
|
||||
|
||||
export interface SloEmbeddableDeps {
|
||||
uiSettings: IUiSettingsClient;
|
||||
http: CoreStart['http'];
|
||||
|
@ -78,7 +62,6 @@ export interface SloEmbeddableDeps {
|
|||
notifications: NotificationsStart;
|
||||
cases: CasesPublicStart;
|
||||
settings: SettingsStart;
|
||||
security: SecurityPluginStart;
|
||||
charts: ChartsPluginStart;
|
||||
uiActions: UiActionsStart;
|
||||
serverless?: ServerlessPluginStart;
|
||||
|
|
|
@ -104,11 +104,15 @@ export function EventsChartPanel({ slo, range, selectedTabId, onBrushed }: Props
|
|||
<EuiFlexItem grow={0}>
|
||||
<EuiLink
|
||||
color="text"
|
||||
href={getDiscoverLink(discover, slo, {
|
||||
href={getDiscoverLink(
|
||||
slo,
|
||||
{
|
||||
from: 'now-24h',
|
||||
to: 'now',
|
||||
mode: 'relative',
|
||||
})}
|
||||
},
|
||||
discover
|
||||
)}
|
||||
data-test-subj="sloDetailDiscoverLink"
|
||||
>
|
||||
<EuiIcon type="sortRight" style={{ marginRight: '4px' }} />
|
||||
|
|
|
@ -16,12 +16,12 @@ import { EuiResizableContainer, EuiProgress, EuiCallOut, EuiSpacer } from '@elas
|
|||
import { buildFilter, FILTERS, TimeRange } from '@kbn/es-query';
|
||||
import { FieldPath, useFormContext } from 'react-hook-form';
|
||||
import { Serializable } from '@kbn/utility-types';
|
||||
import { useFieldSidebar } from './use_field_sidebar';
|
||||
import { useTableDocs } from './use_table_docs';
|
||||
import { SearchBarProps } from './query_builder';
|
||||
import { QuerySearchBar } from './query_search_bar';
|
||||
import { CreateSLOForm } from '../../types';
|
||||
import { useKibana } from '../../../../utils/kibana_react';
|
||||
import { CreateSLOForm } from '../../types';
|
||||
import { QuerySearchBar } from './query_search_bar';
|
||||
import { SearchBarProps } from './query_builder';
|
||||
import { useTableDocs } from './use_table_docs';
|
||||
import { useFieldSidebar } from './use_field_sidebar';
|
||||
|
||||
export function DocumentsTable({
|
||||
dataView,
|
||||
|
@ -131,7 +131,15 @@ export function DocumentsTable({
|
|||
}
|
||||
}
|
||||
}}
|
||||
services={services}
|
||||
services={{
|
||||
theme: services.theme,
|
||||
fieldFormats: services.fieldFormats,
|
||||
uiSettings: services.uiSettings,
|
||||
dataViewFieldEditor: services.dataViewFieldEditor,
|
||||
toastNotifications: services.notifications.toasts,
|
||||
storage: services.storage,
|
||||
data: services.data,
|
||||
}}
|
||||
ariaLabelledBy={i18n.translate('xpack.slo.edit.documentsTableAriaLabel', {
|
||||
defaultMessage: 'Documents table',
|
||||
})}
|
||||
|
|
|
@ -89,7 +89,7 @@ export function GoodBadEventsChart({
|
|||
to: moment(datum.x).add(intervalInMilliseconds, 'ms').toISOString(),
|
||||
mode: 'absolute' as const,
|
||||
};
|
||||
openInDiscover(discover, slo, isBad, !isBad, timeRange);
|
||||
openInDiscover(slo, isBad, !isBad, timeRange, discover);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -56,7 +56,6 @@ export class SloPlugin
|
|||
const mount = async (params: AppMountParameters<unknown>) => {
|
||||
const { renderApp } = await import('./application');
|
||||
const [coreStart, pluginsStart] = await coreSetup.getStartServices();
|
||||
const { ruleTypeRegistry, actionTypeRegistry } = pluginsStart.triggersActionsUi;
|
||||
const { observabilityRuleTypeRegistry } = pluginsStart.observability;
|
||||
|
||||
return renderApp({
|
||||
|
@ -67,7 +66,7 @@ export class SloPlugin
|
|||
kibanaVersion,
|
||||
usageCollection: pluginsSetup.usageCollection,
|
||||
ObservabilityPageTemplate: pluginsStart.observabilityShared.navigation.PageTemplate,
|
||||
plugins: { ...pluginsStart, ruleTypeRegistry, actionTypeRegistry },
|
||||
plugins: pluginsStart,
|
||||
isServerless: !!pluginsStart.serverless,
|
||||
experimentalFeatures: this.experimentalFeatures,
|
||||
});
|
||||
|
@ -156,8 +155,6 @@ export class SloPlugin
|
|||
|
||||
public start(coreStart: CoreStart, pluginsStart: SloPublicPluginsStart) {
|
||||
const kibanaVersion = this.initContext.env.packageInfo.version;
|
||||
const { ruleTypeRegistry, actionTypeRegistry } = pluginsStart.triggersActionsUi;
|
||||
|
||||
return {
|
||||
getCreateSLOFlyout: getCreateSLOFlyoutLazy({
|
||||
core: coreStart,
|
||||
|
@ -165,7 +162,7 @@ export class SloPlugin
|
|||
kibanaVersion,
|
||||
observabilityRuleTypeRegistry: pluginsStart.observability.observabilityRuleTypeRegistry,
|
||||
ObservabilityPageTemplate: pluginsStart.observabilityShared.navigation.PageTemplate,
|
||||
plugins: { ...pluginsStart, ruleTypeRegistry, actionTypeRegistry },
|
||||
plugins: pluginsStart,
|
||||
isServerless: !!pluginsStart.serverless,
|
||||
experimentalFeatures: this.experimentalFeatures,
|
||||
}),
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
import { ToastsStart } from '@kbn/core/public';
|
||||
import {
|
||||
ObservabilityPublicSetup,
|
||||
ObservabilityPublicStart,
|
||||
|
@ -22,7 +21,6 @@ import type {
|
|||
TriggersAndActionsUIPublicPluginSetup,
|
||||
TriggersAndActionsUIPublicPluginStart,
|
||||
} from '@kbn/triggers-actions-ui-plugin/public';
|
||||
import type { NavigationPublicPluginStart } from '@kbn/navigation-plugin/public';
|
||||
import type { LicensingPluginSetup } from '@kbn/licensing-plugin/public';
|
||||
import { SharePluginSetup, SharePluginStart } from '@kbn/share-plugin/public';
|
||||
import { LicensingPluginStart } from '@kbn/licensing-plugin/public';
|
||||
|
@ -31,10 +29,6 @@ import type { PresentationUtilPluginStart } from '@kbn/presentation-util-plugin/
|
|||
import { ServerlessPluginSetup, ServerlessPluginStart } from '@kbn/serverless/public';
|
||||
import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public';
|
||||
import type { DataPublicPluginSetup, DataPublicPluginStart } from '@kbn/data-plugin/public';
|
||||
import {
|
||||
ActionTypeRegistryContract,
|
||||
RuleTypeRegistryContract,
|
||||
} from '@kbn/triggers-actions-ui-plugin/public';
|
||||
import type { CloudStart } from '@kbn/cloud-plugin/public';
|
||||
import type {
|
||||
UsageCollectionSetup,
|
||||
|
@ -44,12 +38,10 @@ import {
|
|||
ObservabilityAIAssistantPublicSetup,
|
||||
ObservabilityAIAssistantPublicStart,
|
||||
} from '@kbn/observability-ai-assistant-plugin/public';
|
||||
import { SecurityPluginStart } from '@kbn/security-plugin/public';
|
||||
import { SpacesPluginStart } from '@kbn/spaces-plugin/public';
|
||||
import type { LensPublicStart } from '@kbn/lens-plugin/public';
|
||||
import { DataViewEditorStart } from '@kbn/data-view-editor-plugin/public';
|
||||
import { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public';
|
||||
import type { IUiSettingsClient } from '@kbn/core/public';
|
||||
import { CasesPublicStart } from '@kbn/cases-plugin/public';
|
||||
import type { DiscoverStart } from '@kbn/discover-plugin/public';
|
||||
import { DataViewFieldEditorStart } from '@kbn/data-view-field-editor-plugin/public';
|
||||
|
@ -67,13 +59,12 @@ export interface SloPublicPluginsSetup {
|
|||
embeddable: EmbeddableSetup;
|
||||
uiActions: UiActionsSetup;
|
||||
serverless?: ServerlessPluginSetup;
|
||||
presentationUtil?: PresentationUtilPluginStart;
|
||||
presentationUtil: PresentationUtilPluginStart;
|
||||
observabilityAIAssistant?: ObservabilityAIAssistantPublicSetup;
|
||||
usageCollection: UsageCollectionSetup;
|
||||
}
|
||||
|
||||
export interface SloPublicPluginsStart {
|
||||
actionTypeRegistry: ActionTypeRegistryContract;
|
||||
aiops: AiopsPluginStart;
|
||||
cases: CasesPublicStart;
|
||||
cloud?: CloudStart;
|
||||
|
@ -83,8 +74,6 @@ export interface SloPublicPluginsStart {
|
|||
observability: ObservabilityPublicStart;
|
||||
observabilityShared: ObservabilitySharedPluginStart;
|
||||
triggersActionsUi: TriggersAndActionsUIPublicPluginStart;
|
||||
navigation: NavigationPublicPluginStart;
|
||||
security: SecurityPluginStart;
|
||||
spaces?: SpacesPluginStart;
|
||||
share: SharePluginStart;
|
||||
licensing: LicensingPluginStart;
|
||||
|
@ -94,16 +83,13 @@ export interface SloPublicPluginsStart {
|
|||
serverless?: ServerlessPluginStart;
|
||||
data: DataPublicPluginStart;
|
||||
dataViews: DataViewsPublicPluginStart;
|
||||
ruleTypeRegistry: RuleTypeRegistryContract;
|
||||
observabilityAIAssistant?: ObservabilityAIAssistantPublicStart;
|
||||
lens: LensPublicStart;
|
||||
charts: ChartsPluginStart;
|
||||
unifiedSearch: UnifiedSearchPublicPluginStart;
|
||||
uiSettings: IUiSettingsClient;
|
||||
usageCollection: UsageCollectionStart;
|
||||
discover: DiscoverStart;
|
||||
discover?: DiscoverStart;
|
||||
dataViewFieldEditor: DataViewFieldEditorStart;
|
||||
toastNotifications: ToastsStart;
|
||||
}
|
||||
|
||||
export type SloPublicSetup = ReturnType<SloPlugin['setup']>;
|
||||
|
|
|
@ -145,20 +145,20 @@ function createDiscoverLocator(
|
|||
}
|
||||
|
||||
export function getDiscoverLink(
|
||||
discover: DiscoverStart,
|
||||
slo: SLOWithSummaryResponse,
|
||||
timeRange: TimeRange
|
||||
timeRange: TimeRange,
|
||||
discover?: DiscoverStart
|
||||
) {
|
||||
const config = createDiscoverLocator(slo, false, false, timeRange);
|
||||
return discover?.locator?.getRedirectUrl(config);
|
||||
}
|
||||
|
||||
export function openInDiscover(
|
||||
discover: DiscoverStart,
|
||||
slo: SLOWithSummaryResponse,
|
||||
showBad = false,
|
||||
showGood = false,
|
||||
timeRange?: TimeRange
|
||||
timeRange?: TimeRange,
|
||||
discover?: DiscoverStart
|
||||
) {
|
||||
const config = createDiscoverLocator(slo, showBad, showGood, timeRange);
|
||||
discover?.locator?.navigate(config);
|
||||
|
|
|
@ -53,7 +53,7 @@ export interface PluginSetup {
|
|||
taskManager: TaskManagerSetupContract;
|
||||
spaces?: SpacesPluginSetup;
|
||||
cloud?: CloudSetup;
|
||||
usageCollection?: UsageCollectionSetup;
|
||||
usageCollection: UsageCollectionSetup;
|
||||
}
|
||||
|
||||
export interface PluginStart {
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
"@kbn/i18n-react",
|
||||
"@kbn/shared-ux-router",
|
||||
"@kbn/core",
|
||||
"@kbn/navigation-plugin",
|
||||
"@kbn/translations-plugin",
|
||||
"@kbn/rule-data-utils",
|
||||
"@kbn/triggers-actions-ui-plugin",
|
||||
|
@ -38,7 +37,6 @@
|
|||
"@kbn/cases-plugin",
|
||||
"@kbn/data-plugin",
|
||||
"@kbn/core-ui-settings-browser",
|
||||
"@kbn/security-plugin",
|
||||
"@kbn/charts-plugin",
|
||||
"@kbn/ui-actions-plugin",
|
||||
"@kbn/serverless",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue