-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Disable log stream and settings pages #203996
Changes from 7 commits
028e168
335c198
a81667f
afeecef
a3ebe87
341f3d7
96b2a3a
81bf76d
adf2892
7e202e6
e7c2afb
ac4621e
9bf82b4
aef5208
8c5c37d
50a3971
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,24 +31,19 @@ import { | |
map, | ||
firstValueFrom, | ||
} from 'rxjs'; | ||
import type { EmbeddableApiContext } from '@kbn/presentation-publishing'; | ||
import { apiCanAddNewPanel } from '@kbn/presentation-containers'; | ||
import { IncompatibleActionError, ADD_PANEL_TRIGGER } from '@kbn/ui-actions-plugin/public'; | ||
import { COMMON_EMBEDDABLE_GROUPING } from '@kbn/embeddable-plugin/public'; | ||
import { | ||
ASSET_DETAILS_LOCATOR_ID, | ||
INVENTORY_LOCATOR_ID, | ||
type AssetDetailsLocatorParams, | ||
type InventoryLocatorParams, | ||
} from '@kbn/observability-shared-plugin/common'; | ||
import { OBSERVABILITY_ENABLE_LOGS_STREAM } from '@kbn/management-settings-ids'; | ||
import { NavigationEntry } from '@kbn/observability-shared-plugin/public'; | ||
import { OBSERVABILITY_LOGS_EXPLORER_APP_ID } from '@kbn/deeplinks-observability/constants'; | ||
import type { InfraPublicConfig } from '../common/plugin_config_types'; | ||
import { createInventoryMetricRuleType } from './alerting/inventory'; | ||
import { createLogThresholdRuleType } from './alerting/log_threshold'; | ||
import { createMetricThresholdRuleType } from './alerting/metric_threshold'; | ||
import { ADD_LOG_STREAM_ACTION_ID, LOG_STREAM_EMBEDDABLE } from './components/log_stream/constants'; | ||
import { LOG_STREAM_EMBEDDABLE } from './components/log_stream/constants'; | ||
import { createMetricsFetchData, createMetricsHasData } from './metrics_overview_fetchers'; | ||
import { registerFeatures } from './register_feature'; | ||
import { InventoryViewsService } from './services/inventory_views'; | ||
|
@@ -63,7 +58,6 @@ import type { | |
InfraClientStartExports, | ||
} from './types'; | ||
import { getLogsHasDataFetcher, getLogsOverviewDataFetcher } from './utils/logs_overview_fetchers'; | ||
import type { LogStreamSerializedState } from './components/log_stream/types'; | ||
import { | ||
hostsTitle, | ||
inventoryTitle, | ||
|
@@ -95,8 +89,6 @@ export class Plugin implements InfraClientPluginClass { | |
} | ||
|
||
setup(core: InfraClientCoreSetup, pluginsSetup: InfraClientSetupDeps) { | ||
const isLogsStreamEnabled = core.uiSettings.get(OBSERVABILITY_ENABLE_LOGS_STREAM, false); | ||
|
||
if (pluginsSetup.home) { | ||
registerFeatures(pluginsSetup.home); | ||
} | ||
|
@@ -146,7 +138,7 @@ export class Plugin implements InfraClientPluginClass { | |
) | ||
); | ||
|
||
const logRoutes = getLogsAppRoutes({ isLogsStreamEnabled }); | ||
const logRoutes = getLogsAppRoutes(); | ||
|
||
/** !! Need to be kept in sync with the deepLinks in x-pack/plugins/observability_solution/infra/public/plugin.ts */ | ||
pluginsSetup.observabilityShared.navigation.registerSections( | ||
|
@@ -340,48 +332,11 @@ export class Plugin implements InfraClientPluginClass { | |
} | ||
|
||
start(core: InfraClientCoreStart, plugins: InfraClientStartDeps) { | ||
const { http, uiSettings } = core; | ||
const isLogsStreamEnabled = uiSettings.get(OBSERVABILITY_ENABLE_LOGS_STREAM, false); | ||
const { http } = core; | ||
const inventoryViews = this.inventoryViews.start({ http }); | ||
const metricsExplorerViews = this.metricsExplorerViews?.start({ http }); | ||
const telemetry = this.telemetry.start(); | ||
|
||
if (isLogsStreamEnabled) { | ||
plugins.uiActions.registerAction<EmbeddableApiContext>({ | ||
id: ADD_LOG_STREAM_ACTION_ID, | ||
grouping: [COMMON_EMBEDDABLE_GROUPING.legacy], | ||
order: 30, | ||
getDisplayName: () => | ||
i18n.translate('xpack.infra.logStreamEmbeddable.displayName', { | ||
defaultMessage: 'Log stream (deprecated)', | ||
}), | ||
getDisplayNameTooltip: () => | ||
i18n.translate('xpack.infra.logStreamEmbeddable.description', { | ||
defaultMessage: | ||
'Add a table of live streaming logs. For a more efficient experience, we recommend using the Discover Page to create a saved search instead of using Log stream.', | ||
}), | ||
getIconType: () => 'logsApp', | ||
isCompatible: async ({ embeddable }) => { | ||
return apiCanAddNewPanel(embeddable); | ||
}, | ||
execute: async ({ embeddable }) => { | ||
if (!apiCanAddNewPanel(embeddable)) throw new IncompatibleActionError(); | ||
embeddable.addNewPanel<LogStreamSerializedState>( | ||
{ | ||
panelType: LOG_STREAM_EMBEDDABLE, | ||
initialState: { | ||
title: i18n.translate('xpack.infra.logStreamEmbeddable.title', { | ||
defaultMessage: 'Log stream', | ||
}), | ||
}, | ||
}, | ||
true | ||
); | ||
}, | ||
}); | ||
plugins.uiActions.attachAction(ADD_PANEL_TRIGGER, ADD_LOG_STREAM_ACTION_ID); | ||
} | ||
|
||
const startContract: InfraClientStartExports = { | ||
inventoryViews, | ||
metricsExplorerViews, | ||
|
@@ -417,12 +372,9 @@ const getLogsNavigationEntries = ({ | |
} | ||
|
||
// Display Stream nav entry when Logs Stream is enabled | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: please remove comment associated with deleted line There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch, removed in 8c5c37d |
||
if (routes.stream) entries.push(createNavEntryFromRoute(routes.stream)); | ||
// Display always Logs Anomalies and Logs Categories entries | ||
entries.push(createNavEntryFromRoute(routes.logsAnomalies)); | ||
entries.push(createNavEntryFromRoute(routes.logsCategories)); | ||
// Display Logs Settings entry when Logs Stream is not enabled | ||
if (!routes.stream) entries.push(createNavEntryFromRoute(routes.settings)); | ||
|
||
return entries; | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to test another panel as the log stream panel is removed