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

[Logs] Deprecation warning for Logs Explorer and Logs Stream #199652

Merged
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ export const uiSettings: Record<string, UiSettingsParams> = {
description: i18n.translate('xpack.infra.enableLogsStreamDescription', {
defaultMessage: 'Enables the legacy Logs Stream application and dashboard panel. ',
}),
deprecation: {
message: i18n.translate('xpack.infra.enableLogsStreamDeprecationWarning', {
defaultMessage:
'Logs Stream is deprecated and this setting is and will be removed in Kibana 9.0.',
tonyghiani marked this conversation as resolved.
Show resolved Hide resolved
tonyghiani marked this conversation as resolved.
Show resolved Hide resolved
}),
docLinksKey: 'generalSettings',
},
type: 'boolean',
schema: schema.boolean(),
requiresPageReload: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,28 @@ import { EuiCallOut } from '@elastic/eui';
import React from 'react';
import { i18n } from '@kbn/i18n';
import { EuiButton } from '@elastic/eui';
import {
AllDatasetsLocatorParams,
ALL_DATASETS_LOCATOR_ID,
DatasetLocatorParams,
} from '@kbn/deeplinks-observability';
import { getRouterLinkProps } from '@kbn/router-utils';
import useLocalStorage from 'react-use/lib/useLocalStorage';

import { euiThemeVars } from '@kbn/ui-theme';
import { css } from '@emotion/css';
import { LocatorPublic } from '@kbn/share-plugin/common';
import { DISCOVER_APP_LOCATOR, DiscoverAppLocatorParams } from '@kbn/discover-plugin/common';
import { useKibanaContextForPlugin } from '../hooks/use_kibana';

const pageConfigurations = {
stream: {
dismissalStorageKey: 'log_stream_deprecation_callout_dismissed',
message: i18n.translate('xpack.infra.logsDeprecationCallout.p.theNewLogsExplorerLabel', {
message: i18n.translate('xpack.infra.logsDeprecationCallout.stream.exploreWithDiscover', {
defaultMessage:
'The new Logs Explorer makes viewing and inspecting your logs easier with more features, better performance, and more intuitive navigation. We recommend switching to Logs Explorer, as it will replace Logs Stream in a future version.',
'Discover now brings together the functionality of both Logs Stream and Logs Explorer, which are set to be deprecated. It makes viewing and inspecting your logs easier with more features, better performance, and more intuitive navigation. We recommend switching to Discover, as it will replace Logs Stream in a future version.',
tonyghiani marked this conversation as resolved.
Show resolved Hide resolved
tonyghiani marked this conversation as resolved.
Show resolved Hide resolved
}),
},
settings: {
dismissalStorageKey: 'log_settings_deprecation_callout_dismissed',
message: i18n.translate(
'xpack.infra.logsSettingsDeprecationCallout.p.theNewLogsExplorerLabel',
{
defaultMessage:
'These settings only apply to the legacy Logs Stream app, and we do not recommend configuring them. Instead, use Logs Explorer which makes viewing and inspecting your logs easier with more features, better performance, and more intuitive navigation.',
}
),
message: i18n.translate('xpack.infra.logsDeprecationCallout.settings.exploreWithDiscover', {
defaultMessage:
'These settings only apply to the legacy Logs Stream app, and we do not recommend configuring them. Instead, use Discover which makes viewing and inspecting your logs easier with more features, better performance, and more intuitive navigation.',
tonyghiani marked this conversation as resolved.
Show resolved Hide resolved
tonyghiani marked this conversation as resolved.
Show resolved Hide resolved
}),
},
};

Expand All @@ -60,10 +52,9 @@ export const LogsDeprecationCallout = ({ page }: LogsDeprecationCalloutProps) =>

const [isDismissed, setDismissed] = useLocalStorage(dismissalStorageKey, false);

const allDatasetLocator =
share.url.locators.get<AllDatasetsLocatorParams>(ALL_DATASETS_LOCATOR_ID);
const discoverLocator = share.url.locators.get<DiscoverAppLocatorParams>(DISCOVER_APP_LOCATOR);

if (isDismissed || !(allDatasetLocator && discover?.show && fleet?.read)) {
if (isDismissed || !(discoverLocator && discover?.show && fleet?.read)) {
return null;
}

Expand All @@ -81,19 +72,19 @@ export const LogsDeprecationCallout = ({ page }: LogsDeprecationCalloutProps) =>
<p>{message}</p>
<EuiButton
fill
data-test-subj="infraLogsDeprecationCalloutTryLogsExplorerButton"
data-test-subj="infraLogsDeprecationCalloutGoToDiscoverButton"
color="warning"
{...getLogsExplorerLinkProps(allDatasetLocator)}
{...getDiscoverLinkProps(discoverLocator)}
>
{i18n.translate('xpack.infra.logsDeprecationCallout.tryLogsExplorerButtonLabel', {
defaultMessage: 'Try Logs Explorer',
{i18n.translate('xpack.infra.logsDeprecationCallout.goToDiscoverButtonLabel', {
defaultMessage: 'Go to Discover',
})}
</EuiButton>
</EuiCallOut>
);
};

const getLogsExplorerLinkProps = (locator: LocatorPublic<DatasetLocatorParams>) => {
const getDiscoverLinkProps = (locator: LocatorPublic<DiscoverAppLocatorParams>) => {
return getRouterLinkProps({
href: locator.getRedirectUrl({}),
onClick: () => locator.navigate({}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,26 @@ export const observabilityAppTitle = i18n.translate(
}
);

export const betaBadgeTitle = i18n.translate('xpack.observabilityLogsExplorer.betaBadgeTitle', {
defaultMessage: 'Beta',
});
export const deprecationBadgeTitle = i18n.translate(
'xpack.observabilityLogsExplorer.deprecationBadgeTitle',
{
defaultMessage: 'Deprecation notice',
}
);

export const deprecationBadgeDescription = i18n.translate(
'xpack.observabilityLogsExplorer.deprecationBadgeDescription',
{
defaultMessage:
'Discover now brings together the functionality of both Logs Stream and Logs Explorer, which are set to be deprecated.',
tonyghiani marked this conversation as resolved.
Show resolved Hide resolved
}
);

export const betaBadgeDescription = i18n.translate(
'xpack.observabilityLogsExplorer.betaBadgeDescription',
export const deprecationBadgeGuideline = i18n.translate(
'xpack.observabilityLogsExplorer.deprecationBadgeGuideline',
{
defaultMessage: 'This application is in beta and therefore subject to change.',
defaultMessage:
'If you still need access to Logs Stream, you can temporarily re-enable it in Advanced Settings.',
tonyghiani marked this conversation as resolved.
Show resolved Hide resolved
}
);
tonyghiani marked this conversation as resolved.
Show resolved Hide resolved

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ import { LogsExplorerTabs } from '@kbn/discover-plugin/public';
import React, { useEffect, useState } from 'react';
import useObservable from 'react-use/lib/useObservable';
import { filter, take } from 'rxjs';
import { betaBadgeDescription, betaBadgeTitle } from '../../common/translations';
import {
deprecationBadgeDescription,
deprecationBadgeGuideline,
deprecationBadgeTitle,
} from '../../common/translations';
import { useKibanaContextForPlugin } from '../utils/use_kibana';
import { ConnectedDiscoverLink } from './discover_link';
import { FeedbackLink } from './feedback_link';
Expand Down Expand Up @@ -59,13 +63,7 @@ const ProjectTopNav = () => {
`}
>
<EuiHeaderSectionItem>
<EuiBetaBadge
size="s"
iconType="beta"
label={betaBadgeTitle}
tooltipContent={betaBadgeDescription}
alignment="middle"
/>
<DeprecationNoticeBadge />
</EuiHeaderSectionItem>
<EuiHeaderSectionItem>
<EuiHeaderLinks gutterSize="xs">
Expand Down Expand Up @@ -115,15 +113,6 @@ const ClassicTopNav = () => {
margin-left: ${euiThemeVars.euiSizeM};
`}
>
<EuiHeaderSectionItem>
<EuiBetaBadge
size="s"
iconType="beta"
label={betaBadgeTitle}
tooltipContent={betaBadgeDescription}
alignment="middle"
/>
</EuiHeaderSectionItem>
<EuiHeaderSectionItem>
<FeedbackLink />
</EuiHeaderSectionItem>
Expand All @@ -145,6 +134,9 @@ const ClassicTopNav = () => {
<EuiHeaderSection data-test-subj="logsExplorerHeaderMenu">
<EuiHeaderSectionItem>
<EuiHeaderLinks gutterSize="xs">
<EuiHeaderSectionItem>
<DeprecationNoticeBadge />
</EuiHeaderSectionItem>
<ConnectedDiscoverLink />
<ConditionalVerticalRule Component={ConnectedDatasetQualityLink()} />
<VerticalRule />
Expand All @@ -171,3 +163,19 @@ const ConditionalVerticalRule = ({ Component }: { Component: JSX.Element | null
{Component}
</>
);

const DeprecationNoticeBadge = () => (
<EuiBetaBadge
label={deprecationBadgeTitle}
color="subdued"
tooltipContent={
<>
{deprecationBadgeDescription}
<br />
<br />
{deprecationBadgeGuideline}
</>
}
alignment="middle"
/>
);
2 changes: 0 additions & 2 deletions x-pack/plugins/translations/translations/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -34666,8 +34666,6 @@
"xpack.observabilityLogsExplorer.alertsPopover.createSLOMenuItem": "Créer un SLO",
"xpack.observabilityLogsExplorer.alertsPopover.manageRulesMenuItem": "{canCreateRule, select, true{Gérer} other{Afficher}} les règles",
"xpack.observabilityLogsExplorer.appTitle": "Explorateur de logs",
"xpack.observabilityLogsExplorer.betaBadgeDescription": "Il s'agit du stade bêta de l'application, qui est donc susceptible d'évoluer.",
"xpack.observabilityLogsExplorer.betaBadgeTitle": "Bêta",
"xpack.observabilityLogsExplorer.createSlo": "Créer un SLO",
"xpack.observabilityLogsExplorer.datasetQualityLinkTitle": "Ensembles de données",
"xpack.observabilityLogsExplorer.discoverLinkTitle": "Ouvrir dans Discover",
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -34636,8 +34636,6 @@
"xpack.observabilityLogsExplorer.alertsPopover.createSLOMenuItem": "SLOの作成",
"xpack.observabilityLogsExplorer.alertsPopover.manageRulesMenuItem": "ルールを{canCreateRule, select, true{管理} other{表示}}",
"xpack.observabilityLogsExplorer.appTitle": "ログエクスプローラー",
"xpack.observabilityLogsExplorer.betaBadgeDescription": "このアプリケーションはベータ版であるため、変更される場合があります。",
"xpack.observabilityLogsExplorer.betaBadgeTitle": "ベータ",
"xpack.observabilityLogsExplorer.createSlo": "SLOの作成",
"xpack.observabilityLogsExplorer.datasetQualityLinkTitle": "データセット",
"xpack.observabilityLogsExplorer.discoverLinkTitle": "Discoverで開く",
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -34115,8 +34115,6 @@
"xpack.observabilityLogsExplorer.alertsPopover.createSLOMenuItem": "创建 SLO",
"xpack.observabilityLogsExplorer.alertsPopover.manageRulesMenuItem": "{canCreateRule, select, true{管理} other{查看}}规则",
"xpack.observabilityLogsExplorer.appTitle": "日志浏览器",
"xpack.observabilityLogsExplorer.betaBadgeDescription": "此应用程序为公测版,因此可能会进行更改。",
"xpack.observabilityLogsExplorer.betaBadgeTitle": "公测版",
"xpack.observabilityLogsExplorer.createSlo": "创建 SLO",
"xpack.observabilityLogsExplorer.datasetQualityLinkTitle": "数据集",
"xpack.observabilityLogsExplorer.discoverLinkTitle": "在 Discover 中打开",
Expand Down