From bc664253765b343b37f2c2ef1f3f5150d4c36ce7 Mon Sep 17 00:00:00 2001 From: chrisronline Date: Tue, 6 Aug 2019 16:28:41 -0400 Subject: [PATCH 01/43] Enable setup mode UI toggles --- .../public/directives/main/index.js | 5 +- .../monitoring/public/lib/setup_mode.js | 64 ++++++++++--------- .../public/services/breadcrumbs_provider.js | 16 +++-- .../monitoring/public/views/loading/index.js | 5 +- 4 files changed, 49 insertions(+), 41 deletions(-) diff --git a/x-pack/legacy/plugins/monitoring/public/directives/main/index.js b/x-pack/legacy/plugins/monitoring/public/directives/main/index.js index 9f7debb73de9b..4d56cc28c241e 100644 --- a/x-pack/legacy/plugins/monitoring/public/directives/main/index.js +++ b/x-pack/legacy/plugins/monitoring/public/directives/main/index.js @@ -18,7 +18,7 @@ import template from './index.html'; import { timefilter } from 'ui/timefilter'; import { shortenPipelineHash } from '../../../common/formatting'; import 'ui/directives/kbn_href'; -import { getSetupModeState } from '../../lib/setup_mode'; +import { getSetupModeState, initSetupModeState } from '../../lib/setup_mode'; const setOptions = (controller) => { if (!controller.pipelineVersions || !controller.pipelineVersions.length || !controller.pipelineDropdownElement) { @@ -169,6 +169,9 @@ uiModule.directive('monitoringMain', (breadcrumbs, license, kbnUrl, $injector) = controllerAs: 'monitoringMain', bindToController: true, link(scope, _element, attributes, controller) { + initSetupModeState(scope, $injector, () => { + controller.setup(getSetupObj()); + }); if (!scope.cluster) { const $route = $injector.get('$route'); const globalState = $injector.get('globalState'); diff --git a/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.js b/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.js index dbfbdb324f7aa..99b9b5bfc0df5 100644 --- a/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.js +++ b/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.js @@ -134,37 +134,39 @@ export const toggleSetupMode = inSetupMode => { }; const setSetupModeMenuItem = () => { - // Disabling this for this initial release. This will be added back in - // in a subsequent PR - // checkAngularState(); - - // const globalState = angularState.injector.get('globalState'); - // const navItems = globalState.inSetupMode - // ? [ - // { - // key: 'exit', - // label: 'Exit Setup Mode', - // description: 'Exit setup mode', - // run: () => toggleSetupMode(false), - // testId: 'exitSetupMode' - // }, - // { - // key: 'refresh', - // label: 'Refresh Setup Data', - // description: 'Refresh data used for setup mode', - // run: () => updateSetupModeData(), - // testId: 'refreshSetupModeData' - // } - // ] - // : [{ - // key: 'enter', - // label: 'Enter Setup Mode', - // description: 'Enter setup mode', - // run: () => toggleSetupMode(true), - // testId: 'enterSetupMode' - // }]; - - // angularState.scope.topNavMenu = [...navItems]; + checkAngularState(); + + const globalState = angularState.injector.get('globalState'); + const navItems = globalState.inSetupMode + ? [ + { + id: 'exit', + label: 'Exit Setup Mode', + description: 'Exit setup mode', + run: () => toggleSetupMode(false), + testId: 'exitSetupMode' + }, + { + id: 'refresh', + label: 'Refresh Setup Data', + description: 'Refresh data used for setup mode', + run: () => updateSetupModeData(), + testId: 'refreshSetupModeData' + } + ] + : [{ + id: 'enter', + label: 'Enter Setup Mode', + description: 'Enter setup mode', + run: () => toggleSetupMode(true), + testId: 'enterSetupMode' + }]; + + angularState.scope.topNavMenu = [...navItems]; + // LOL angular + if (!angularState.scope.$$phase) { + angularState.scope.$apply(); + } }; export const initSetupModeState = ($scope, $injector, callback) => { diff --git a/x-pack/legacy/plugins/monitoring/public/services/breadcrumbs_provider.js b/x-pack/legacy/plugins/monitoring/public/services/breadcrumbs_provider.js index 4bc7d31b0a92c..1648507161ae9 100644 --- a/x-pack/legacy/plugins/monitoring/public/services/breadcrumbs_provider.js +++ b/x-pack/legacy/plugins/monitoring/public/services/breadcrumbs_provider.js @@ -6,6 +6,7 @@ import chrome from 'ui/chrome'; import { i18n } from '@kbn/i18n'; +import { getSetupModeState } from '../lib/setup_mode'; // Helper for making objects to use in a link element const createCrumb = (url, label, testSubj) => { @@ -120,12 +121,17 @@ function getApmBreadcrumbs(mainInstance) { export function breadcrumbsProvider() { return function createBreadcrumbs(clusterName, mainInstance) { - let breadcrumbs = [ createCrumb('#/home', - i18n.translate( + const setupMode = getSetupModeState(); + // This mimics how the edit mode works for dashboards + const homeCrumb = setupMode.enabled + ? i18n.translate( + 'xpack.monitoring.breadcrumbs.clustersInSetupModeLabel', { defaultMessage: 'Clusters (Setup Mode)' } + ) + : i18n.translate( 'xpack.monitoring.breadcrumbs.clustersLabel', { defaultMessage: 'Clusters' } - ), - 'breadcrumbClusters') - ]; + ); + + let breadcrumbs = [ createCrumb('#/home', homeCrumb, 'breadcrumbClusters')]; if (!mainInstance.inOverview && clusterName) { breadcrumbs.push(createCrumb('#/overview', clusterName)); diff --git a/x-pack/legacy/plugins/monitoring/public/views/loading/index.js b/x-pack/legacy/plugins/monitoring/public/views/loading/index.js index 683a1e1ac5264..79b1f3ef46c56 100644 --- a/x-pack/legacy/plugins/monitoring/public/views/loading/index.js +++ b/x-pack/legacy/plugins/monitoring/public/views/loading/index.js @@ -10,8 +10,8 @@ import { PageLoading } from 'plugins/monitoring/components'; import uiRoutes from 'ui/routes'; import { I18nContext } from 'ui/i18n'; import template from './index.html'; -import { toggleSetupMode, getSetupModeState, initSetupModeState } from '../../lib/setup_mode'; import { CODE_PATH_LICENSE } from '../../../common/constants'; +import { toggleSetupMode, getSetupModeState } from '../../lib/setup_mode'; const REACT_DOM_ID = 'monitoringLoadingReactApp'; @@ -23,8 +23,6 @@ uiRoutes const monitoringClusters = $injector.get('monitoringClusters'); const kbnUrl = $injector.get('kbnUrl'); - initSetupModeState($scope, $injector); - const setupMode = getSetupModeState(); // For phase 3, this is not an valid route unless // setup mode is currently enabled. For phase 4, @@ -48,7 +46,6 @@ uiRoutes kbnUrl.changePath('/home'); return; } - initSetupModeState($scope, $injector); return toggleSetupMode(true) .then(() => { kbnUrl.changePath('/elasticsearch/nodes'); From 3f0c65aac4a3be3a5231ea3fcc9295953b0a91da Mon Sep 17 00:00:00 2001 From: chrisronline Date: Mon, 19 Aug 2019 15:02:19 -0400 Subject: [PATCH 02/43] We want to keep the no data page but update the copy --- .../public/components/no_data/no_data.js | 84 ++++++++++++++----- .../monitoring/public/views/loading/index.js | 17 +--- .../monitoring/public/views/no_data/index.js | 22 ++++- 3 files changed, 86 insertions(+), 37 deletions(-) diff --git a/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js b/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js index 4671850ceed7c..8edf072c08b01 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js +++ b/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import React from 'react'; +import React, { useState } from 'react'; import PropTypes from 'prop-types'; import { EuiSpacer, @@ -12,26 +12,37 @@ import { EuiPage, EuiPageBody, EuiPageContent, + EuiHorizontalRule, + EuiFlexGroup, + EuiFlexItem, + EuiButton, + EuiText } from '@elastic/eui'; -import { CheckingSettings } from './checking_settings'; -import { ReasonFound, WeTried } from './reasons'; -import { CheckerErrors } from './checker_errors'; +import { WhatIs } from './blurbs'; +import { FormattedMessage } from '@kbn/i18n/react'; +import { toggleSetupMode } from '../../lib/setup_mode'; -function NoDataMessage(props) { - const { isLoading, reason, checkMessage } = props; +// function NoDataMessage(props) { +// const { isLoading, reason, checkMessage } = props; - if (isLoading && checkMessage !== null) { - return ; - } +// if (isLoading && checkMessage !== null) { +// return ; +// } - if (reason) { - return ; - } +// if (reason) { +// return ; +// } - return ; -} +// return ; +// } -export function NoData(props) { +export function NoData({ changePath }) { + const [isLoading, setIsLoading] = useState(false); + async function startSetup() { + setIsLoading(true); + await toggleSetupMode(true); + changePath('/elasticsearch/nodes'); + } return ( @@ -43,8 +54,43 @@ export function NoData(props) { > - - + + + +

+ +

+

+ +

+
+ + + + + + + +
@@ -52,7 +98,5 @@ export function NoData(props) { } NoData.propTypes = { - isLoading: PropTypes.bool.isRequired, - reason: PropTypes.object, - checkMessage: PropTypes.string + changePath: PropTypes.func.isRequired, }; diff --git a/x-pack/legacy/plugins/monitoring/public/views/loading/index.js b/x-pack/legacy/plugins/monitoring/public/views/loading/index.js index 79b1f3ef46c56..2b79e047177a6 100644 --- a/x-pack/legacy/plugins/monitoring/public/views/loading/index.js +++ b/x-pack/legacy/plugins/monitoring/public/views/loading/index.js @@ -11,7 +11,6 @@ import uiRoutes from 'ui/routes'; import { I18nContext } from 'ui/i18n'; import template from './index.html'; import { CODE_PATH_LICENSE } from '../../../common/constants'; -import { toggleSetupMode, getSetupModeState } from '../../lib/setup_mode'; const REACT_DOM_ID = 'monitoringLoadingReactApp'; @@ -23,15 +22,6 @@ uiRoutes const monitoringClusters = $injector.get('monitoringClusters'); const kbnUrl = $injector.get('kbnUrl'); - const setupMode = getSetupModeState(); - // For phase 3, this is not an valid route unless - // setup mode is currently enabled. For phase 4, - // we will remove this check. - if (!setupMode.enabled) { - kbnUrl.changePath('/no-data'); - return; - } - $scope.$on('$destroy', () => { unmountComponentAtNode(document.getElementById(REACT_DOM_ID)); }); @@ -46,11 +36,8 @@ uiRoutes kbnUrl.changePath('/home'); return; } - return toggleSetupMode(true) - .then(() => { - kbnUrl.changePath('/elasticsearch/nodes'); - $scope.$apply(); - }); + kbnUrl.changePath('/no-data'); + return; }); } diff --git a/x-pack/legacy/plugins/monitoring/public/views/no_data/index.js b/x-pack/legacy/plugins/monitoring/public/views/no_data/index.js index bd0cee74225c6..9aa5b985da6f7 100644 --- a/x-pack/legacy/plugins/monitoring/public/views/no_data/index.js +++ b/x-pack/legacy/plugins/monitoring/public/views/no_data/index.js @@ -4,10 +4,16 @@ * you may not use this file except in compliance with the Elastic License. */ +import React from 'react'; import uiRoutes from 'ui/routes'; import template from './index.html'; -import { NoDataController } from './controller'; import { CODE_PATH_LICENSE } from '../../../common/constants'; +import { I18nContext } from 'ui/i18n'; +import { render } from 'react-dom'; +import { NoData } from '../../components/no_data/no_data'; + +const REACT_NODE_ID_NO_DATA = 'noDataReact'; + uiRoutes .when('/no-data', { template, @@ -25,6 +31,18 @@ uiRoutes }); } }, - controller: NoDataController + controller: class { + constructor($injector, $scope) { + $scope.$$postDigest(() => { + render( + + $scope.$apply(() => $injector.get('kbnUrl').changePath(path))} /> + , + document.getElementById(REACT_NODE_ID_NO_DATA) + ); + }); + + } + } }) .otherwise({ redirectTo: '/home' }); From 8c7e679de1449fb74ef4dc36b7c1b8ac97f64c54 Mon Sep 17 00:00:00 2001 From: chrisronline Date: Mon, 19 Aug 2019 15:02:53 -0400 Subject: [PATCH 03/43] More updated copy --- .../public/components/no_data/no_data.js | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js b/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js index 8edf072c08b01..fb4e36825caee 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js +++ b/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js @@ -16,9 +16,10 @@ import { EuiFlexGroup, EuiFlexItem, EuiButton, - EuiText + EuiText, + EuiTitle, + EuiTextColor, } from '@elastic/eui'; -import { WhatIs } from './blurbs'; import { FormattedMessage } from '@kbn/i18n/react'; import { toggleSetupMode } from '../../lib/setup_mode'; @@ -54,7 +55,24 @@ export function NoData({ changePath }) { > - + +

+ +

+
+ + +

+ +

+
+

From 10aeb2b53c61f17b1ad995d188c89a65d26a6536 Mon Sep 17 00:00:00 2001 From: chrisronline Date: Mon, 19 Aug 2019 15:28:01 -0400 Subject: [PATCH 04/43] Remove manual checks for logstash, beats, apm and kibana --- ...isable_internal_collection_instructions.js | 137 +++++------------- ...isable_internal_collection_instructions.js | 137 +++++------------- ...isable_internal_collection_instructions.js | 137 +++++------------- ...isable_internal_collection_instructions.js | 137 +++++------------- 4 files changed, 160 insertions(+), 388 deletions(-) diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/disable_internal_collection_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/disable_internal_collection_instructions.js index 827e535a57262..023f29fc6c28e 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/disable_internal_collection_instructions.js +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/disable_internal_collection_instructions.js @@ -8,9 +8,6 @@ import React, { Fragment } from 'react'; import { EuiSpacer, EuiCodeBlock, - EuiFlexGroup, - EuiFlexItem, - EuiButton, EuiCallOut, EuiText } from '@elastic/eui'; @@ -20,12 +17,7 @@ import { Monospace } from '../components/monospace'; import { FormattedMessage } from '@kbn/i18n/react'; import { statusTitle } from './common_apm_instructions'; -export function getApmInstructionsForDisablingInternalCollection(product, meta, { - checkForMigrationStatus, - checkingMigrationStatus, - hasCheckedStatus, - autoCheckIntervalInMs, -}) { +export function getApmInstructionsForDisablingInternalCollection(product, meta) { const disableInternalCollectionStep = { title: i18n.translate('xpack.monitoring.metricbeatMigration.apmInstructions.disableInternalCollection.title', { defaultMessage: 'Disable internal collection of the APM server\'s monitoring metrics' @@ -67,100 +59,51 @@ export function getApmInstructionsForDisablingInternalCollection(product, meta, let migrationStatusStep = null; if (!product || !product.isFullyMigrated) { - let status = null; - if (hasCheckedStatus) { - let lastInternallyCollectedMessage = ''; - // It is possible that, during the migration steps, products are not reporting - // monitoring data for a period of time outside the window of our server-side check - // and this is most likely temporary so we want to be defensive and not error out - // and hopefully wait for the next check and this state will be self-corrected. - if (product) { - const lastInternallyCollectedTimestamp = product.lastInternallyCollectedTimestamp || product.lastTimestamp; - const secondsSinceLastInternalCollectionLabel = - formatTimestampToDuration(lastInternallyCollectedTimestamp, CALCULATE_DURATION_SINCE); - lastInternallyCollectedMessage = (); - } - - status = ( - - - -

- -

-

- {lastInternallyCollectedMessage} -

- - - ); - } - - let buttonLabel; - if (checkingMigrationStatus) { - buttonLabel = i18n.translate( - 'xpack.monitoring.metricbeatMigration.apmInstructions.disableInternalCollection.checkingStatusButtonLabel', - { - defaultMessage: 'Checking...' - } - ); - } else { - buttonLabel = i18n.translate( - 'xpack.monitoring.metricbeatMigration.apmInstructions.disableInternalCollection.checkStatusButtonLabel', - { - defaultMessage: 'Check' - } - ); + let lastInternallyCollectedMessage = ''; + // It is possible that, during the migration steps, products are not reporting + // monitoring data for a period of time outside the window of our server-side check + // and this is most likely temporary so we want to be defensive and not error out + // and hopefully wait for the next check and this state will be self-corrected. + if (product) { + const lastInternallyCollectedTimestamp = product.lastInternallyCollectedTimestamp || product.lastTimestamp; + const secondsSinceLastInternalCollectionLabel = + formatTimestampToDuration(lastInternallyCollectedTimestamp, CALCULATE_DURATION_SINCE); + lastInternallyCollectedMessage = (); } migrationStatusStep = { title: statusTitle, status: 'incomplete', children: ( - - - - -

- {i18n.translate( - 'xpack.monitoring.metricbeatMigration.apmInstructions.disableInternalCollection.statusDescription', - { - defaultMessage: 'Check that no documents are coming from internal collection.' - } - )} -

-
-
- - - {buttonLabel} - - -
- {status} -
+ +

+ +

+

+ {lastInternallyCollectedMessage} +

+
) }; } diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/disable_internal_collection_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/disable_internal_collection_instructions.js index 4a843ff286598..e597de68e30fb 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/disable_internal_collection_instructions.js +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/disable_internal_collection_instructions.js @@ -8,9 +8,6 @@ import React, { Fragment } from 'react'; import { EuiSpacer, EuiCodeBlock, - EuiFlexGroup, - EuiFlexItem, - EuiButton, EuiCallOut, EuiText } from '@elastic/eui'; @@ -20,12 +17,7 @@ import { Monospace } from '../components/monospace'; import { FormattedMessage } from '@kbn/i18n/react'; import { statusTitle, UNDETECTED_BEAT_TYPE } from './common_beats_instructions'; -export function getBeatsInstructionsForDisablingInternalCollection(product, meta, { - checkForMigrationStatus, - checkingMigrationStatus, - hasCheckedStatus, - autoCheckIntervalInMs, -}) { +export function getBeatsInstructionsForDisablingInternalCollection(product, meta) { const beatType = product.beatType; const disableInternalCollectionStep = { title: i18n.translate('xpack.monitoring.metricbeatMigration.beatsInstructions.disableInternalCollection.title', { @@ -75,100 +67,51 @@ export function getBeatsInstructionsForDisablingInternalCollection(product, meta let migrationStatusStep = null; if (!product || !product.isFullyMigrated) { - let status = null; - if (hasCheckedStatus) { - let lastInternallyCollectedMessage = ''; - // It is possible that, during the migration steps, products are not reporting - // monitoring data for a period of time outside the window of our server-side check - // and this is most likely temporary so we want to be defensive and not error out - // and hopefully wait for the next check and this state will be self-corrected. - if (product) { - const lastInternallyCollectedTimestamp = product.lastInternallyCollectedTimestamp || product.lastTimestamp; - const secondsSinceLastInternalCollectionLabel = - formatTimestampToDuration(lastInternallyCollectedTimestamp, CALCULATE_DURATION_SINCE); - lastInternallyCollectedMessage = (); - } - - status = ( - - - -

- -

-

- {lastInternallyCollectedMessage} -

-
-
- ); - } - - let buttonLabel; - if (checkingMigrationStatus) { - buttonLabel = i18n.translate( - 'xpack.monitoring.metricbeatMigration.beatsInstructions.disableInternalCollection.checkingStatusButtonLabel', - { - defaultMessage: 'Checking...' - } - ); - } else { - buttonLabel = i18n.translate( - 'xpack.monitoring.metricbeatMigration.beatsInstructions.disableInternalCollection.checkStatusButtonLabel', - { - defaultMessage: 'Check' - } - ); + let lastInternallyCollectedMessage = ''; + // It is possible that, during the migration steps, products are not reporting + // monitoring data for a period of time outside the window of our server-side check + // and this is most likely temporary so we want to be defensive and not error out + // and hopefully wait for the next check and this state will be self-corrected. + if (product) { + const lastInternallyCollectedTimestamp = product.lastInternallyCollectedTimestamp || product.lastTimestamp; + const secondsSinceLastInternalCollectionLabel = + formatTimestampToDuration(lastInternallyCollectedTimestamp, CALCULATE_DURATION_SINCE); + lastInternallyCollectedMessage = (); } migrationStatusStep = { title: statusTitle, status: 'incomplete', children: ( - - - - -

- {i18n.translate( - 'xpack.monitoring.metricbeatMigration.beatsInstructions.disableInternalCollection.statusDescription', - { - defaultMessage: 'Check that no documents are coming from internal collection.' - } - )} -

-
-
- - - {buttonLabel} - - -
- {status} -
+ +

+ +

+

+ {lastInternallyCollectedMessage} +

+
) }; } diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/disable_internal_collection_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/disable_internal_collection_instructions.js index e4219fe47c3c2..b0618d36d2d4f 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/disable_internal_collection_instructions.js +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/disable_internal_collection_instructions.js @@ -8,9 +8,6 @@ import React, { Fragment } from 'react'; import { EuiSpacer, EuiCodeBlock, - EuiFlexGroup, - EuiFlexItem, - EuiButton, EuiCallOut, EuiText } from '@elastic/eui'; @@ -20,12 +17,7 @@ import { Monospace } from '../components/monospace'; import { FormattedMessage } from '@kbn/i18n/react'; import { statusTitle } from './common_kibana_instructions'; -export function getKibanaInstructionsForDisablingInternalCollection(product, meta, { - checkForMigrationStatus, - checkingMigrationStatus, - hasCheckedStatus, - autoCheckIntervalInMs, -}) { +export function getKibanaInstructionsForDisablingInternalCollection(product, meta) { let restartWarning = null; if (product.isPrimary) { restartWarning = ( @@ -105,100 +97,51 @@ export function getKibanaInstructionsForDisablingInternalCollection(product, met let migrationStatusStep = null; if (!product || !product.isFullyMigrated) { - let status = null; - if (hasCheckedStatus) { - let lastInternallyCollectedMessage = ''; - // It is possible that, during the migration steps, products are not reporting - // monitoring data for a period of time outside the window of our server-side check - // and this is most likely temporary so we want to be defensive and not error out - // and hopefully wait for the next check and this state will be self-corrected. - if (product) { - const lastInternallyCollectedTimestamp = product.lastInternallyCollectedTimestamp || product.lastTimestamp; - const secondsSinceLastInternalCollectionLabel = - formatTimestampToDuration(lastInternallyCollectedTimestamp, CALCULATE_DURATION_SINCE); - lastInternallyCollectedMessage = (); - } - - status = ( - - - -

- -

-

- {lastInternallyCollectedMessage} -

-
-
- ); - } - - let buttonLabel; - if (checkingMigrationStatus) { - buttonLabel = i18n.translate( - 'xpack.monitoring.metricbeatMigration.kibanaInstructions.disableInternalCollection.checkingStatusButtonLabel', - { - defaultMessage: 'Checking...' - } - ); - } else { - buttonLabel = i18n.translate( - 'xpack.monitoring.metricbeatMigration.kibanaInstructions.disableInternalCollection.checkStatusButtonLabel', - { - defaultMessage: 'Check' - } - ); + let lastInternallyCollectedMessage = ''; + // It is possible that, during the migration steps, products are not reporting + // monitoring data for a period of time outside the window of our server-side check + // and this is most likely temporary so we want to be defensive and not error out + // and hopefully wait for the next check and this state will be self-corrected. + if (product) { + const lastInternallyCollectedTimestamp = product.lastInternallyCollectedTimestamp || product.lastTimestamp; + const secondsSinceLastInternalCollectionLabel = + formatTimestampToDuration(lastInternallyCollectedTimestamp, CALCULATE_DURATION_SINCE); + lastInternallyCollectedMessage = (); } migrationStatusStep = { title: statusTitle, status: 'incomplete', children: ( - - - - -

- {i18n.translate( - 'xpack.monitoring.metricbeatMigration.kibanaInstructions.disableInternalCollection.statusDescription', - { - defaultMessage: 'Check that no documents are coming from internal collection.' - } - )} -

-
-
- - - {buttonLabel} - - -
- {status} -
+ +

+ +

+

+ {lastInternallyCollectedMessage} +

+
) }; } diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/disable_internal_collection_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/disable_internal_collection_instructions.js index 9efc5a26ef822..7c7a91eb7e536 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/disable_internal_collection_instructions.js +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/disable_internal_collection_instructions.js @@ -8,9 +8,6 @@ import React, { Fragment } from 'react'; import { EuiSpacer, EuiCodeBlock, - EuiFlexGroup, - EuiFlexItem, - EuiButton, EuiCallOut, EuiText } from '@elastic/eui'; @@ -20,12 +17,7 @@ import { Monospace } from '../components/monospace'; import { FormattedMessage } from '@kbn/i18n/react'; import { statusTitle } from './common_logstash_instructions'; -export function getLogstashInstructionsForDisablingInternalCollection(product, meta, { - checkForMigrationStatus, - checkingMigrationStatus, - hasCheckedStatus, - autoCheckIntervalInMs, -}) { +export function getLogstashInstructionsForDisablingInternalCollection(product, meta) { const disableInternalCollectionStep = { title: i18n.translate('xpack.monitoring.metricbeatMigration.logstashInstructions.disableInternalCollection.title', { defaultMessage: 'Disable internal collection of Logstash monitoring metrics' @@ -67,100 +59,51 @@ export function getLogstashInstructionsForDisablingInternalCollection(product, m let migrationStatusStep = null; if (!product || !product.isFullyMigrated) { - let status = null; - if (hasCheckedStatus) { - let lastInternallyCollectedMessage = ''; - // It is possible that, during the migration steps, products are not reporting - // monitoring data for a period of time outside the window of our server-side check - // and this is most likely temporary so we want to be defensive and not error out - // and hopefully wait for the next check and this state will be self-corrected. - if (product) { - const lastInternallyCollectedTimestamp = product.lastInternallyCollectedTimestamp || product.lastTimestamp; - const secondsSinceLastInternalCollectionLabel = - formatTimestampToDuration(lastInternallyCollectedTimestamp, CALCULATE_DURATION_SINCE); - lastInternallyCollectedMessage = (); - } - - status = ( - - - -

- -

-

- {lastInternallyCollectedMessage} -

-
-
- ); - } - - let buttonLabel; - if (checkingMigrationStatus) { - buttonLabel = i18n.translate( - 'xpack.monitoring.metricbeatMigration.logstashInstructions.disableInternalCollection.checkingStatusButtonLabel', - { - defaultMessage: 'Checking...' - } - ); - } else { - buttonLabel = i18n.translate( - 'xpack.monitoring.metricbeatMigration.logstashInstructions.disableInternalCollection.checkStatusButtonLabel', - { - defaultMessage: 'Check' - } - ); + let lastInternallyCollectedMessage = ''; + // It is possible that, during the migration steps, products are not reporting + // monitoring data for a period of time outside the window of our server-side check + // and this is most likely temporary so we want to be defensive and not error out + // and hopefully wait for the next check and this state will be self-corrected. + if (product) { + const lastInternallyCollectedTimestamp = product.lastInternallyCollectedTimestamp || product.lastTimestamp; + const secondsSinceLastInternalCollectionLabel = + formatTimestampToDuration(lastInternallyCollectedTimestamp, CALCULATE_DURATION_SINCE); + lastInternallyCollectedMessage = (); } migrationStatusStep = { title: statusTitle, status: 'incomplete', children: ( - - - - -

- {i18n.translate( - 'xpack.monitoring.metricbeatMigration.logstashInstructions.disableInternalCollection.statusDescription', - { - defaultMessage: 'Check that no documents are coming from internal collection.' - } - )} -

-
-
- - - {buttonLabel} - - -
- {status} -
+ +

+ +

+

+ {lastInternallyCollectedMessage} +

+
) }; } From 3b3363700f2bd60aea12053dc01d2ecdf3365339 Mon Sep 17 00:00:00 2001 From: chrisronline Date: Wed, 21 Aug 2019 13:01:56 -0400 Subject: [PATCH 05/43] Hide the setup mode controls on the no data page. There is nothing different in setup mode --- .../legacy/plugins/monitoring/public/lib/setup_mode.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.js b/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.js index 99b9b5bfc0df5..18ec506dea965 100644 --- a/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.js +++ b/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.js @@ -5,7 +5,11 @@ */ import { ajaxErrorHandlersProvider } from './ajax_error_handler'; -import { get } from 'lodash'; +import { get, contains } from 'lodash'; + +function isOnPage(hash) { + return contains(window.location.hash, hash); +} const angularState = { injector: null, @@ -136,6 +140,10 @@ export const toggleSetupMode = inSetupMode => { const setSetupModeMenuItem = () => { checkAngularState(); + if (isOnPage('no-data')) { + return; + } + const globalState = angularState.injector.get('globalState'); const navItems = globalState.inSetupMode ? [ From 100da8b056e452acfff4fae6ab2e0ec3cc8d89ab Mon Sep 17 00:00:00 2001 From: chrisronline Date: Wed, 21 Aug 2019 15:27:32 -0400 Subject: [PATCH 06/43] Setup mode test --- .../monitoring/public/lib/setup_mode.test.js | 163 ++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 x-pack/legacy/plugins/monitoring/public/lib/setup_mode.test.js diff --git a/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.test.js b/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.test.js new file mode 100644 index 0000000000000..0321c5d978667 --- /dev/null +++ b/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.test.js @@ -0,0 +1,163 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { toggleSetupMode, initSetupModeState, getSetupModeState, updateSetupModeData } from './setup_mode'; + +jest.mock('./ajax_error_handler', () => ({ + ajaxErrorHandlersProvider: err => { + throw err; + } +})); + +let data = {}; + +const injectorModulesMock = { + globalState: { + save: jest.fn() + }, + Private: module => module, + $http: { + post: jest.fn().mockImplementation(() => { + return { data }; + }) + }, + $executor: { + run: jest.fn() + } +}; + +const angularStateMock = { + injector: { + get: module => { + return injectorModulesMock[module] || {}; + } + }, + scope: { + $apply: fn => fn && fn() + } +}; + +describe('setup_mode', () => { + describe('setup', () => { + afterEach(async () => { + toggleSetupMode(false); + }); + + it('should require angular state', async () => { + expect(toggleSetupMode(true)).rejects.toEqual('Unable to interact with setup ' + + 'mode because the angular injector was not previously set. This needs to be ' + + 'set by calling `initSetupModeState`.'); + }); + + it('should enable toggle mode', async () => { + initSetupModeState(angularStateMock.scope, angularStateMock.injector); + await toggleSetupMode(true); + expect(injectorModulesMock.globalState.inSetupMode).toBe(true); + }); + + it('should disable toggle mode', async () => { + initSetupModeState(angularStateMock.scope, angularStateMock.injector); + await toggleSetupMode(false); + expect(injectorModulesMock.globalState.inSetupMode).toBe(false); + }); + + it('should set top nav config', async () => { + initSetupModeState(angularStateMock.scope, angularStateMock.injector); + expect(angularStateMock.scope.topNavMenu.length).toBe(1); + await toggleSetupMode(true); + expect(angularStateMock.scope.topNavMenu.length).toBe(2); + }); + }); + + describe('in setup mode', () => { + afterEach(async () => { + data = {}; + toggleSetupMode(false); + }); + + it('should enable it through clicking top nav item', async () => { + initSetupModeState(angularStateMock.scope, angularStateMock.injector); + await angularStateMock.scope.topNavMenu[0].run(); + expect(injectorModulesMock.globalState.inSetupMode).toBe(true); + }); + + it('should not fetch data if on cloud', async () => { + data = { + _meta: { + isOnCloud: true + } + }; + initSetupModeState(angularStateMock.scope, angularStateMock.injector); + await toggleSetupMode(true); + const state = getSetupModeState(); + expect(state.enabled).toBe(false); + }); + + it('should set the newly discovered cluster uuid', async () => { + const clusterUuid = '1ajy'; + data = { + _meta: { + liveClusterUuid: clusterUuid + }, + elasticsearch: { + byUuid: { + 123: { + isPartiallyMigrated: true + } + } + } + }; + initSetupModeState(angularStateMock.scope, angularStateMock.injector); + await toggleSetupMode(true); + expect(injectorModulesMock.globalState.cluster_uuid).toBe(clusterUuid); + }); + + it('should fetch data for a given cluster', async () => { + const clusterUuid = '1ajy'; + data = { + _meta: { + liveClusterUuid: clusterUuid + }, + elasticsearch: { + byUuid: { + 123: { + isPartiallyMigrated: true + } + } + } + }; + + initSetupModeState(angularStateMock.scope, angularStateMock.injector); + await toggleSetupMode(true); + expect(injectorModulesMock.$http.post).toHaveBeenCalledWith( + `../api/monitoring/v1/setup/collection/cluster/${clusterUuid}`, + { ccs: undefined } + ); + }); + + it('should fetch data for a single node', async () => { + initSetupModeState(angularStateMock.scope, angularStateMock.injector); + await toggleSetupMode(true); + injectorModulesMock.$http.post.mockClear(); + await updateSetupModeData('45asd'); + expect(injectorModulesMock.$http.post).toHaveBeenCalledWith( + '../api/monitoring/v1/setup/collection/node/45asd', + { ccs: undefined } + ); + }); + + it('should fetch data without a cluster uuid', async () => { + initSetupModeState(angularStateMock.scope, angularStateMock.injector); + await toggleSetupMode(true); + injectorModulesMock.$http.post.mockClear(); + await updateSetupModeData(undefined, true); + expect(injectorModulesMock.$http.post).toHaveBeenCalledWith( + '../api/monitoring/v1/setup/collection/cluster', + { ccs: undefined } + ); + }); + }); +}); From 236b08bcec99e71d63bca5c96429910f4b80d500 Mon Sep 17 00:00:00 2001 From: chrisronline Date: Wed, 4 Sep 2019 11:31:23 -0400 Subject: [PATCH 07/43] Fix bug with disabling internal collection for ES --- .../server/lib/setup/collection/get_collection_status.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/legacy/plugins/monitoring/server/lib/setup/collection/get_collection_status.js b/x-pack/legacy/plugins/monitoring/server/lib/setup/collection/get_collection_status.js index 85e0745436463..f67c0db5bd3df 100644 --- a/x-pack/legacy/plugins/monitoring/server/lib/setup/collection/get_collection_status.js +++ b/x-pack/legacy/plugins/monitoring/server/lib/setup/collection/get_collection_status.js @@ -271,7 +271,7 @@ async function getLiveElasticsearchCollectionEnabled(req) { }); const sources = ['persistent', 'transient', 'defaults']; for (const source of sources) { - const collectionSettings = get(response[source], 'xpack.monitoring.collection'); + const collectionSettings = get(response[source], 'xpack.monitoring.elasticsearch.collection'); if (collectionSettings && collectionSettings.enabled === 'true') { return true; } From fa80d10fff772b04861a53947467f0df05eac391 Mon Sep 17 00:00:00 2001 From: chrisronline Date: Fri, 6 Sep 2019 08:22:11 -0400 Subject: [PATCH 08/43] First steps towards the redesign of setup mode --- .../plugins/monitoring/common/constants.js | 23 ++ .../components/apm/instances/instances.js | 2 +- .../components/beats/listing/listing.js | 44 +-- .../components/cluster/overview/apm_panel.js | 59 +--- .../cluster/overview/beats_panel.js | 59 +--- .../cluster/overview/elasticsearch_panel.js | 65 +--- .../cluster/overview/kibana_panel.js | 58 +--- .../cluster/overview/logstash_panel.js | 61 +--- .../elasticsearch/cluster_status/index.js | 4 +- .../index_detail_status/index.js | 4 +- .../components/elasticsearch/nodes/nodes.js | 133 ++++---- .../components/kibana/instances/instances.js | 95 +++--- .../components/logstash/listing/listing.js | 101 +++--- .../metricbeat_migration/flyout/flyout.js | 16 +- .../enable_metricbeat_instructions.js | 30 +- ...isable_internal_collection_instructions.js | 18 +- .../public/components/no_data/no_data.js | 88 +++-- .../public/components/renderers/setup_mode.js | 67 +++- .../public/components/setup_mode/badge.js | 109 +++++++ .../components/setup_mode/common_text.js | 19 ++ .../components/setup_mode/listing_callout.js | 157 +++++++++ .../public/components/setup_mode/tooltip.js | 145 +++++++++ .../public/components/table/eui_table.js | 301 +++++++++--------- .../public/directives/main/index.js | 3 +- .../monitoring/public/lib/route_init.js | 6 +- .../monitoring/public/lib/setup_mode.js | 36 +-- .../public/services/breadcrumbs_provider.js | 13 +- .../public/views/apm/instances/index.js | 3 +- .../public/views/beats/listing/index.js | 3 +- .../public/views/cluster/overview/index.js | 3 +- .../public/views/elasticsearch/nodes/index.js | 3 +- .../public/views/kibana/instances/index.js | 3 +- .../public/views/logstash/nodes/index.js | 3 +- .../monitoring/public/views/no_data/index.js | 21 +- 34 files changed, 1071 insertions(+), 684 deletions(-) create mode 100644 x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.js create mode 100644 x-pack/legacy/plugins/monitoring/public/components/setup_mode/common_text.js create mode 100644 x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js create mode 100644 x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js diff --git a/x-pack/legacy/plugins/monitoring/common/constants.js b/x-pack/legacy/plugins/monitoring/common/constants.js index 9824614113094..60560d6f0fa76 100644 --- a/x-pack/legacy/plugins/monitoring/common/constants.js +++ b/x-pack/legacy/plugins/monitoring/common/constants.js @@ -156,6 +156,29 @@ export const METRICBEAT_INDEX_NAME_UNIQUE_TOKEN = '-mb-'; // We use this for metricbeat migration to identify specific products that we do not have constants for export const ELASTICSEARCH_CUSTOM_ID = 'elasticsearch'; export const APM_CUSTOM_ID = 'apm'; +/** + * The name of the Kibana System ID used to publish and look up Kibana stats through the Monitoring system. + * @type {string} + */ +export const KIBANA_SYSTEM_ID = 'kibana'; + +/** + * The name of the Beats System ID used to publish and look up Beats stats through the Monitoring system. + * @type {string} + */ +export const BEATS_SYSTEM_ID = 'beats'; + +/** + * The name of the Apm System ID used to publish and look up Apm stats through the Monitoring system. + * @type {string} + */ +export const APM_SYSTEM_ID = 'beats'; + +/** + * The name of the Kibana System ID used to look up Logstash stats through the Monitoring system. + * @type {string} + */ +export const LOGSTASH_SYSTEM_ID = 'logstash'; /** * The id of the infra source owned by the monitoring plugin. */ diff --git a/x-pack/legacy/plugins/monitoring/public/components/apm/instances/instances.js b/x-pack/legacy/plugins/monitoring/public/components/apm/instances/instances.js index 04b6652c6ce0a..86de231baeccc 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/apm/instances/instances.js +++ b/x-pack/legacy/plugins/monitoring/public/components/apm/instances/instances.js @@ -135,7 +135,7 @@ export function ApmServerInstances({ apms, setupMode }) { uuidField="uuid" nameField="name" setupNewButtonLabel={i18n.translate('xpack.monitoring.apm.metricbeatMigration.setupNewButtonLabel', { - defaultMessage: 'Setup monitoring for new APM server' + defaultMessage: 'Set up monitoring for new server' })} search={{ box: { diff --git a/x-pack/legacy/plugins/monitoring/public/components/beats/listing/listing.js b/x-pack/legacy/plugins/monitoring/public/components/beats/listing/listing.js index d11797dc090eb..75cb08ec09cbe 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/beats/listing/listing.js +++ b/x-pack/legacy/plugins/monitoring/public/components/beats/listing/listing.js @@ -4,13 +4,15 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { PureComponent, Fragment } from 'react'; -import { uniq, get } from 'lodash'; -import { EuiPage, EuiPageBody, EuiPageContent, EuiSpacer, EuiLink, EuiCallOut } from '@elastic/eui'; +import React, { PureComponent } from 'react'; +import { uniq } from 'lodash'; +import { EuiPage, EuiPageBody, EuiPageContent, EuiSpacer, EuiLink } from '@elastic/eui'; import { Stats } from 'plugins/monitoring/components/beats'; import { formatMetric } from 'plugins/monitoring/lib/format_number'; import { EuiMonitoringTable } from 'plugins/monitoring/components/table'; import { i18n } from '@kbn/i18n'; +import { BEATS_SYSTEM_ID } from '../../../../common/constants'; +import { ListingCallOut } from '../../setup_mode/listing_callout'; export class Listing extends PureComponent { getColumns() { @@ -78,26 +80,14 @@ export class Listing extends PureComponent { setupMode } = this.props; - let detectedInstanceMessage = null; - if (setupMode.enabled && setupMode.data && get(setupMode.data, 'detected.mightExist')) { - detectedInstanceMessage = ( - - -

- {i18n.translate('xpack.monitoring.beats.instances.metricbeatMigration.detectedInstanceDescription', { - defaultMessage: `Based on your indices, we think you might have a beats instance. Click the 'Setup monitoring' - button below to start monitoring this instance.` - })} -

-
- -
+ let setupModeCallOut = null; + if (setupMode.enabled && setupMode.data) { + setupModeCallOut = ( + ); } @@ -115,16 +105,12 @@ export class Listing extends PureComponent { - {detectedInstanceMessage} + {setupModeCallOut} props.changeUrl('apm'); const goToInstances = () => props.changeUrl('apm/instances'); - const setupModeAPMData = get(setupMode.data, 'apm'); - let setupModeInstancesData = null; - if (setupMode.enabled && setupMode.data) { - const { - totalUniqueInstanceCount, - totalUniqueFullyMigratedCount, - totalUniquePartiallyMigratedCount - } = setupModeAPMData; - const hasInstances = totalUniqueInstanceCount > 0 || get(setupModeAPMData, 'detected.mightExist', false); - const allMonitoredByMetricbeat = totalUniqueInstanceCount > 0 && - (totalUniqueFullyMigratedCount === totalUniqueInstanceCount || totalUniquePartiallyMigratedCount === totalUniqueInstanceCount); - const internalCollectionOn = totalUniquePartiallyMigratedCount > 0; - if (hasInstances && (!allMonitoredByMetricbeat || internalCollectionOn)) { - let tooltipText = null; - - if (!allMonitoredByMetricbeat) { - tooltipText = i18n.translate('xpack.monitoring.cluster.overview.apmPanel.setupModeNodesTooltip.oneInternal', { - defaultMessage: `There's at least one server that isn't being monitored using Metricbeat. Click the flag - icon to visit the servers listing page and find out more information about the status of each server.` - }); - } - else if (internalCollectionOn) { - tooltipText = i18n.translate('xpack.monitoring.cluster.overview.apmPanel.setupModeNodesTooltip.disableInternal', { - defaultMessage: `All servers are being monitored using Metricbeat but internal collection still needs to be turned - off. Click the flag icon to visit the servers listing page and disable internal collection.` - }); - } - - setupModeInstancesData = ( - - - - - - - - ); - } - } + const setupModeData = get(setupMode.data, 'apm'); + const setupModeTooltip = setupMode && setupMode.enabled + ? ( + + ) + : null; return ( - {setupModeInstancesData} + {setupModeTooltip} diff --git a/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/beats_panel.js b/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/beats_panel.js index 8ea987d0a6762..9b13570eb656f 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/beats_panel.js +++ b/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/beats_panel.js @@ -18,12 +18,11 @@ import { EuiDescriptionListDescription, EuiHorizontalRule, EuiFlexGroup, - EuiToolTip, - EuiIcon } from '@elastic/eui'; import { ClusterItemContainer, DisabledIfNoDataAndInSetupModeLink } from './helpers'; import { FormattedMessage } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; +import { SetupModeTooltip } from '../../setup_mode/tooltip'; export function BeatsPanel(props) { const { setupMode } = props; @@ -36,48 +35,16 @@ export function BeatsPanel(props) { const goToBeats = () => props.changeUrl('beats'); const goToInstances = () => props.changeUrl('beats/beats'); - const setupModeBeatsData = get(setupMode.data, 'beats'); - let setupModeInstancesData = null; - if (setupMode.enabled && setupMode.data) { - const { - totalUniqueInstanceCount, - totalUniqueFullyMigratedCount, - totalUniquePartiallyMigratedCount - } = setupModeBeatsData; - const hasInstances = totalUniqueInstanceCount > 0 || get(setupModeBeatsData, 'detected.mightExist', false); - const allMonitoredByMetricbeat = totalUniqueInstanceCount > 0 && - (totalUniqueFullyMigratedCount === totalUniqueInstanceCount || totalUniquePartiallyMigratedCount === totalUniqueInstanceCount); - const internalCollectionOn = totalUniquePartiallyMigratedCount > 0; - if (hasInstances && (!allMonitoredByMetricbeat || internalCollectionOn)) { - let tooltipText = null; - - if (!allMonitoredByMetricbeat) { - tooltipText = i18n.translate('xpack.monitoring.cluster.overview.beatsPanel.setupModeNodesTooltip.oneInternal', { - defaultMessage: `There's at least one instance that isn't being monitored using Metricbeat. Click the flag - icon to visit the instances listing page and find out more information about the status of each instance.` - }); - } - else if (internalCollectionOn) { - tooltipText = i18n.translate('xpack.monitoring.cluster.overview.beatsPanel.setupModeNodesTooltip.disableInternal', { - defaultMessage: `All instances are being monitored using Metricbeat but internal collection still needs to be turned - off. Click the flag icon to visit the instances listing page and disable internal collection.` - }); - } - - setupModeInstancesData = ( - - - - - - - - ); - } - } + const setupModeData = get(setupMode.data, 'beats'); + const setupModeTooltip = setupMode && setupMode.enabled + ? ( + + ) + : null; const beatTypes = props.beats.types.map((beat, index) => { return [ @@ -111,7 +78,7 @@ export function BeatsPanel(props) {

- {setupModeInstancesData} + {setupModeTooltip} diff --git a/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/elasticsearch_panel.js b/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/elasticsearch_panel.js index 3f45d6e07297c..4e81e335a8f5b 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/elasticsearch_panel.js +++ b/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/elasticsearch_panel.js @@ -27,12 +27,12 @@ import { EuiBadge, EuiToolTip, EuiFlexGroup, - EuiIcon } from '@elastic/eui'; import { LicenseText } from './license_text'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; import { Reason } from '../../logs/reason'; +import { SetupModeTooltip } from '../../setup_mode/tooltip'; const calculateShards = shards => { const total = get(shards, 'total', 0); @@ -160,47 +160,16 @@ export function ElasticsearchPanel(props) { const licenseText = ; - const setupModeElasticsearchData = get(setupMode.data, 'elasticsearch'); - let setupModeNodesData = null; - if (setupMode.enabled && setupModeElasticsearchData) { - const { - totalUniqueInstanceCount, - totalUniqueFullyMigratedCount, - totalUniquePartiallyMigratedCount - } = setupModeElasticsearchData; - const allMonitoredByMetricbeat = totalUniqueInstanceCount > 0 && - (totalUniqueFullyMigratedCount === totalUniqueInstanceCount || totalUniquePartiallyMigratedCount === totalUniqueInstanceCount); - const internalCollectionOn = totalUniquePartiallyMigratedCount > 0; - if (!allMonitoredByMetricbeat || internalCollectionOn) { - let tooltipText = null; - - if (!allMonitoredByMetricbeat) { - tooltipText = i18n.translate('xpack.monitoring.cluster.overview.elasticsearchPanel.setupModeNodesTooltip.oneInternal', { - defaultMessage: `There's at least one node that isn't being monitored using Metricbeat. Click the flag icon to visit the nodes - listing page and find out more information about the status of each node.` - }); - } - else if (internalCollectionOn) { - tooltipText = i18n.translate('xpack.monitoring.cluster.overview.elasticsearchPanel.setupModeNodesTooltip.disableInternal', { - defaultMessage: `All nodes are being monitored using Metricbeat but internal collection still needs to be turned off. Click the - flag icon to visit the nodes listing page and disable internal collection.` - }); - } - - setupModeNodesData = ( - - - - - - - - ); - } - } + const setupModeData = get(setupMode.data, 'elasticsearch'); + const setupModeTooltip = setupMode && setupMode.enabled + ? ( + + ) + : null; const showMlJobs = () => { // if license doesn't support ML, then `ml === null` @@ -211,7 +180,7 @@ export function ElasticsearchPanel(props) { {props.ml.jobs} @@ -251,7 +220,7 @@ export function ElasticsearchPanel(props) {

- {setupModeNodesData} + {setupModeTooltip} @@ -353,7 +322,7 @@ export function ElasticsearchPanel(props) {

props.changeUrl('kibana'); const goToInstances = () => props.changeUrl('kibana/instances'); - const setupModeKibanaData = get(setupMode.data, 'kibana'); - let setupModeInstancesData = null; - if (setupMode.enabled && setupMode.data) { - const { - totalUniqueInstanceCount, - totalUniqueFullyMigratedCount, - totalUniquePartiallyMigratedCount - } = setupModeKibanaData; - const allMonitoredByMetricbeat = totalUniqueInstanceCount > 0 && - (totalUniqueFullyMigratedCount === totalUniqueInstanceCount || totalUniquePartiallyMigratedCount === totalUniqueInstanceCount); - const internalCollectionOn = totalUniquePartiallyMigratedCount > 0; - if (!allMonitoredByMetricbeat || internalCollectionOn) { - let tooltipText = null; - - if (!allMonitoredByMetricbeat) { - tooltipText = i18n.translate('xpack.monitoring.cluster.overview.kibanaPanel.setupModeNodesTooltip.oneInternal', { - defaultMessage: `There's at least one instance that isn't being monitored using Metricbeat. Click the flag - icon to visit the instances listing page and find out more information about the status of each instance.` - }); - } - else if (internalCollectionOn) { - tooltipText = i18n.translate('xpack.monitoring.cluster.overview.kibanaPanel.setupModeNodesTooltip.disableInternal', { - defaultMessage: `All instances are being monitored using Metricbeat but internal collection still needs to be turned - off. Click the flag icon to visit the instances listing page and disable internal collection.` - }); - } - - setupModeInstancesData = ( - - - - - - - - ); - } - } + const setupModeData = get(setupMode.data, 'kibana'); + const setupModeTooltip = setupMode && setupMode.enabled + ? ( + + ) + : null; return ( - {setupModeInstancesData} + {setupModeTooltip} diff --git a/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/logstash_panel.js b/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/logstash_panel.js index ff647c1c219aa..89cafa09327cf 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/logstash_panel.js +++ b/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/logstash_panel.js @@ -21,12 +21,11 @@ import { EuiDescriptionListDescription, EuiHorizontalRule, EuiIconTip, - EuiToolTip, - EuiIcon } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; import { get } from 'lodash'; +import { SetupModeTooltip } from '../../setup_mode/tooltip'; export function LogstashPanel(props) { const { setupMode } = props; @@ -42,48 +41,16 @@ export function LogstashPanel(props) { const goToNodes = () => props.changeUrl('logstash/nodes'); const goToPipelines = () => props.changeUrl('logstash/pipelines'); - const setupModeLogstashData = get(setupMode.data, 'logstash'); - let setupModeInstancesData = null; - if (setupMode.enabled && setupMode.data) { - const { - totalUniqueInstanceCount, - totalUniqueFullyMigratedCount, - totalUniquePartiallyMigratedCount - } = setupModeLogstashData; - const hasInstances = totalUniqueInstanceCount > 0 || get(setupModeLogstashData, 'detected.mightExist', false); - const allMonitoredByMetricbeat = totalUniqueInstanceCount > 0 && - (totalUniqueFullyMigratedCount === totalUniqueInstanceCount || totalUniquePartiallyMigratedCount === totalUniqueInstanceCount); - const internalCollectionOn = totalUniquePartiallyMigratedCount > 0; - if (hasInstances && (!allMonitoredByMetricbeat || internalCollectionOn)) { - let tooltipText = null; - - if (!allMonitoredByMetricbeat) { - tooltipText = i18n.translate('xpack.monitoring.cluster.overview.logstashPanel.setupModeNodesTooltip.oneInternal', { - defaultMessage: `There's at least one node that isn't being monitored using Metricbeat. Click the flag - icon to visit the nodes listing page and find out more information about the status of each node.` - }); - } - else if (internalCollectionOn) { - tooltipText = i18n.translate('xpack.monitoring.cluster.overview.logstashPanel.setupModeNodesTooltip.disableInternal', { - defaultMessage: `All nodes are being monitored using Metricbeat but internal collection still needs to be turned - off. Click the flag icon to visit the nodes listing page and disable internal collection.` - }); - } - - setupModeInstancesData = ( - - - - - - - - ); - } - } + const setupModeData = get(setupMode.data, 'logstash'); + const setupModeTooltip = setupMode && setupMode.enabled + ? ( + + ) + : null; return ( - {setupModeInstancesData} + {setupModeTooltip} @@ -198,7 +165,7 @@ export function LogstashPanel(props) {

(item) => _.get(item, [type, 'summary', 'lastVal']); const getColumns = (showCgroupMetricsElasticsearch, setupMode) => { @@ -50,9 +53,25 @@ const getColumns = (showCgroupMetricsElasticsearch, setupMode) => { ); + let setupModeStatus = null; if (setupMode && setupMode.enabled) { const list = _.get(setupMode, 'data.byUuid', {}); const status = list[node.resolver] || {}; + const instance = { + uuid: node.resolver, + name: node.name + }; + + setupModeStatus = ( +
+ +
+ ); if (status.isNetNewUser) { nameLink = value; } @@ -77,6 +96,7 @@ const getColumns = (showCgroupMetricsElasticsearch, setupMode) => {
{extractIp(node.transport_address)}
+ {setupModeStatus} ); } @@ -245,63 +265,57 @@ export function ElasticsearchNodes({ clusterStatus, showCgroupMetricsElasticsear }, [])); } - let netNewUserMessage = null; - let disableInternalCollectionForMigrationMessage = null; + let setupModeCallout = null; if (setupMode.data) { - // Think net new user scenario - const hasInstances = setupMode.data.totalUniqueInstanceCount > 0; - if (hasInstances && setupMode.data.totalUniquePartiallyMigratedCount === setupMode.data.totalUniqueInstanceCount) { - const finishMigrationAction = _.get(setupMode.meta, 'liveClusterUuid') === clusterUuid - ? setupMode.shortcutToFinishMigration - : setupMode.openFlyout; + setupModeCallout = ( + { + const customRenderResponse = { + shouldRender: false, + componentToRender: null + }; - disableInternalCollectionForMigrationMessage = ( - - -

- {i18n.translate('xpack.monitoring.elasticsearch.nodes.metribeatMigration.disableInternalCollectionDescription', { - defaultMessage: `All of your Elasticsearch servers are monitored using Metricbeat, - but you need to disable internal collection to finish the migration.` - })} -

- - {i18n.translate('xpack.monitoring.elasticsearch.nodes.metribeatMigration.disableInternalCollectionMigrationButtonLabel', { - defaultMessage: 'Disable and finish migration' - })} - -
- -
- ); - } - else if (!hasInstances) { - netNewUserMessage = ( - - -

- {i18n.translate('xpack.monitoring.elasticsearch.nodes.metribeatMigration.netNewUserDescription', { - defaultMessage: `We did not detect any monitoring data, but we did detect the following Elasticsearch nodes. - Each detected node is listed below along with a Setup button. Clicking this button will guide you through - the process of enabling monitoring for each node.` - })} -

-
- -
- ); - } + if (setupMode.data.totalUniquePartiallyMigratedCount === setupMode.data.totalUniqueInstanceCount) { + const finishMigrationAction = _.get(setupMode.meta, 'liveClusterUuid') === clusterUuid + ? setupMode.shortcutToFinishMigration + : setupMode.openFlyout; + + customRenderResponse.shouldRender = true; + customRenderResponse.componentToRender = ( + + +

+ {i18n.translate('xpack.monitoring.elasticsearch.nodes.metricbeatMigration.disableInternalCollectionDescription', { + defaultMessage: `Metricbeat is now monitoring your Elasticsearch servers. + Disable internal collection to finish the migration.` + })} +

+ + {i18n.translate( + 'xpack.monitoring.elasticsearch.nodes.metricbeatMigration.disableInternalCollectionMigrationButtonLabel', { + defaultMessage: 'Disable and finish migration' + } + )} + +
+ +
+ ); + } + + return customRenderResponse; + }} + /> + ); } function renderClusterStatus() { @@ -322,8 +336,7 @@ export function ElasticsearchNodes({ clusterStatus, showCgroupMetricsElasticsear {renderClusterStatus()} - {disableInternalCollectionForMigrationMessage} - {netNewUserMessage} + {setupModeCallout} { const columns = [ @@ -31,25 +33,50 @@ const getColumns = (kbnUrl, scope, setupMode) => { }), field: 'name', render: (name, kibana) => { + let setupModeStatus = null; if (setupMode && setupMode.enabled) { const list = get(setupMode, 'data.byUuid', {}); - const status = list[get(kibana, 'kibana.uuid')] || {}; + const uuid = get(kibana, 'kibana.uuid'); + const status = list[uuid] || {}; + const instance = { + uuid, + name: kibana.name + }; + + setupModeStatus = ( +
+ +
+ ); if (status.isNetNewUser) { - return name; + return ( +
+ {name} + {setupModeStatus} +
+ ); } } return ( - { - scope.$evalAsync(() => { - kbnUrl.changePath(`/kibana/instances/${kibana.kibana.uuid}`); - }); - }} - data-test-subj={`kibanaLink-${name}`} - > - { name } - +
+ { + scope.$evalAsync(() => { + kbnUrl.changePath(`/kibana/instances/${kibana.kibana.uuid}`); + }); + }} + data-test-subj={`kibanaLink-${name}`} + > + { name } + + {setupModeStatus} +
); } }, @@ -152,7 +179,7 @@ export class KibanaInstances extends PureComponent { onTableChange } = this.props; - let netNewUserMessage = null; + let setupModeCallOut = null; // Merge the instances data with the setup data if enabled const instances = this.props.instances || []; if (setupMode.enabled && setupMode.data) { @@ -177,29 +204,13 @@ export class KibanaInstances extends PureComponent { return instances; }, [])); - const hasInstances = setupMode.data.totalUniqueInstanceCount > 0; - if (!hasInstances) { - netNewUserMessage = ( - - -

- {i18n.translate('xpack.monitoring.kibana.nodes.metribeatMigration.netNewUserDescription', { - defaultMessage: `We did not detect any monitoring data, but we did detect the following Kibana instance. - This detected instance is listed below along with a Setup button. Clicking this button will guide you through - the process of enabling monitoring for this instance.` - })} -

-
- -
- ); - } + setupModeCallOut = ( + + ); } const dataFlattened = instances.map(item => ({ @@ -216,7 +227,7 @@ export class KibanaInstances extends PureComponent { - {netNewUserMessage} + {setupModeCallOut} ( -
-
- { - scope.$evalAsync(() => { - kbnUrl.changePath(`/logstash/node/${node.logstash.uuid}`); - }); - }} - > - {name} - -
+ render: (name, node) => { + let setupModeStatus = null; + if (setupMode && setupMode.enabled) { + const list = get(setupMode, 'data.byUuid', {}); + const uuid = get(node, 'logstash.uuid'); + const status = list[uuid] || {}; + const instance = { + uuid, + name: node.name + }; + + setupModeStatus = ( +
+ +
+ ); + } + + return (
- {node.logstash.http_address} +
+ { + scope.$evalAsync(() => { + kbnUrl.changePath(`/logstash/node/${node.logstash.uuid}`); + }); + }} + > + {name} + +
+
+ {node.logstash.http_address} +
+ {setupModeStatus}
-
- ) + ); + } }, { name: i18n.translate('xpack.monitoring.logstash.nodes.cpuUsageTitle', { @@ -124,26 +153,14 @@ export class Listing extends PureComponent { version: get(item, 'logstash.version', 'N/A'), })); - let netNewUserMessage = null; - if (setupMode.enabled && setupMode.data && get(setupMode.data, 'detected.mightExist')) { - netNewUserMessage = ( - - -

- {i18n.translate('xpack.monitoring.logstash.nodes.metribeatMigration.netNewUserDescription', { - defaultMessage: `Based on your indices, we think you might have a Logstash node. Click the 'Setup monitoring' - button below to start monitoring this node.` - })} -

-
- -
+ let setupModeCallOut = null; + if (setupMode.enabled && setupMode.data) { + setupModeCallOut = ( + ); } @@ -154,17 +171,13 @@ export class Listing extends PureComponent { - {netNewUserMessage} + {setupModeCallOut} - Read more about this migration. + {i18n.translate('xpack.monitoring.metricbeatMigration.flyout.learnMore', { + defaultMessage: 'Learn about this migration.' + })} ); @@ -264,7 +266,7 @@ export class Flyout extends Component { } let title = i18n.translate('xpack.monitoring.metricbeatMigration.flyout.flyoutTitle', { - defaultMessage: 'Migrate {instanceName} {instanceType} to Metricbeat', + defaultMessage: 'Migrate {instanceType} `{instanceName}` with Metricbeat', values: { instanceName, instanceType @@ -273,7 +275,7 @@ export class Flyout extends Component { if (product.isNetNewUser) { title = i18n.translate('xpack.monitoring.metricbeatMigration.flyout.flyoutTitleNewUser', { - defaultMessage: 'Monitor {instanceName} {instanceType} with Metricbeat', + defaultMessage: 'Monitor {instanceType} `{instanceName}` with Metricbeat', values: { instanceName, instanceType @@ -363,7 +365,7 @@ export class Flyout extends Component { {this.renderActiveStep()} {noClusterUuidPrompt} - + @@ -41,7 +41,7 @@ export function getElasticsearchInstructionsForEnablingMetricbeat(product, _meta > @@ -67,7 +67,7 @@ export function getElasticsearchInstructionsForEnablingMetricbeat(product, _meta >

@@ -82,6 +82,14 @@ export function getElasticsearchInstructionsForEnablingMetricbeat(product, _meta }), children: ( + +

+ {i18n.translate('xpack.monitoring.metricbeatMigration.elasticsearchInstructions.enableMetricbeatModuleInstallDirectory', { + defaultMessage: 'From the installation directory, run:' + })} +

+
+ modules.d/elasticsearch-xpack.yml @@ -114,14 +121,14 @@ export function getElasticsearchInstructionsForEnablingMetricbeat(product, _meta const configureMetricbeatStep = { title: i18n.translate('xpack.monitoring.metricbeatMigration.elasticsearchInstructions.configureMetricbeatTitle', { - defaultMessage: 'Configure Metricbeat to send to the monitoring cluster' + defaultMessage: 'Configure Metricbeat to send data to the monitoring cluster' }), children: ( metricbeat.yml @@ -161,7 +168,7 @@ export function getElasticsearchInstructionsForEnablingMetricbeat(product, _meta >

@@ -179,8 +186,7 @@ export function getElasticsearchInstructionsForEnablingMetricbeat(product, _meta size="s" color="warning" title={i18n.translate('xpack.monitoring.metricbeatMigration.elasticsearchInstructions.isInternalCollectorStatusTitle', { - defaultMessage: `We have not detected any monitoring data coming from Metricbeat for this Elasticsearch node. - We will continuously check in the background.`, + defaultMessage: `No monitoring data detected, but we’ll continue checking.`, })} /> ) @@ -204,7 +210,7 @@ export function getElasticsearchInstructionsForEnablingMetricbeat(product, _meta

diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/disable_internal_collection_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/disable_internal_collection_instructions.js index b0618d36d2d4f..f0a0c1de51653 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/disable_internal_collection_instructions.js +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/disable_internal_collection_instructions.js @@ -27,7 +27,7 @@ export function getKibanaInstructionsForDisablingInternalCollection(product, met title={i18n.translate( 'xpack.monitoring.metricbeatMigration.kibanaInstructions.disableInternalCollection.restartWarningTitle', { - defaultMessage: 'Warning' + defaultMessage: 'This step requires you to restart the Kibana server' } )} color="warning" @@ -37,8 +37,7 @@ export function getKibanaInstructionsForDisablingInternalCollection(product, met

@@ -57,7 +56,7 @@ export function getKibanaInstructionsForDisablingInternalCollection(product, met

kibana.yml @@ -78,7 +77,7 @@ export function getKibanaInstructionsForDisablingInternalCollection(product, met

xpack.monitoring.enabled @@ -108,7 +107,7 @@ export function getKibanaInstructionsForDisablingInternalCollection(product, met formatTimestampToDuration(lastInternallyCollectedTimestamp, CALCULATE_DURATION_SINCE); lastInternallyCollectedMessage = (

diff --git a/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js b/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js index fb4e36825caee..732b14fe6cd55 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js +++ b/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js @@ -19,30 +19,64 @@ import { EuiText, EuiTitle, EuiTextColor, + EuiButtonEmpty } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { toggleSetupMode } from '../../lib/setup_mode'; +import { CheckingSettings } from './checking_settings'; +import { ReasonFound, WeTried } from './reasons'; +import { CheckerErrors } from './checker_errors'; -// function NoDataMessage(props) { -// const { isLoading, reason, checkMessage } = props; +function NoDataMessage(props) { + const { isLoading, reason, checkMessage } = props; -// if (isLoading && checkMessage !== null) { -// return ; -// } + if (isLoading && checkMessage !== null) { + return ; + } -// if (reason) { -// return ; -// } + if (reason) { + return ; + } -// return ; -// } + return ; +} -export function NoData({ changePath }) { +export function NoData(props) { const [isLoading, setIsLoading] = useState(false); + const [useInternalCollection, setUseInternalCollection] = useState(false); + async function startSetup() { setIsLoading(true); await toggleSetupMode(true); - changePath('/elasticsearch/nodes'); + props.changePath('/elasticsearch/nodes'); + } + + if (useInternalCollection) { + return ( + + + + + + + + + + setUseInternalCollection(false)}> + + + + + + + ); } return ( @@ -63,28 +97,13 @@ export function NoData({ changePath }) { />

- - -

- -

-
-

-

-

-

@@ -104,11 +123,20 @@ export function NoData({ changePath }) { > + + + setUseInternalCollection(true)}> + + + diff --git a/x-pack/legacy/plugins/monitoring/public/components/renderers/setup_mode.js b/x-pack/legacy/plugins/monitoring/public/components/renderers/setup_mode.js index f1bfebe7851ca..12a2163a33c37 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/renderers/setup_mode.js +++ b/x-pack/legacy/plugins/monitoring/public/components/renderers/setup_mode.js @@ -3,10 +3,27 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import React from 'react'; -import { getSetupModeState, initSetupModeState, updateSetupModeData, disableElasticsearchInternalCollection } from '../../lib/setup_mode'; +import React, { Fragment } from 'react'; +import { + getSetupModeState, + initSetupModeState, + updateSetupModeData, + disableElasticsearchInternalCollection, + toggleSetupMode +} from '../../lib/setup_mode'; import { Flyout } from '../metricbeat_migration/flyout'; +import { + EuiBottomBar, + EuiButton, + EuiFlexGroup, + EuiFlexItem, + EuiTextColor, + EuiIcon, + EuiSpacer +} from '@elastic/eui'; import { findNewUuid } from './lib/find_new_uuid'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n/react'; export class SetupModeRenderer extends React.Component { state = { @@ -97,6 +114,51 @@ export class SetupModeRenderer extends React.Component { ); } + getBottomBar(setupModeState) { + if (!setupModeState.enabled) { + return null; + } + + return ( + + + + + + + + + + ) + }} + /> + + + + + + + + toggleSetupMode(false)}> + {i18n.translate('xpack.monitoring.setupMode.exit', { + defaultMessage: `Exit set up mode` + })} + + + + + + + + ); + } + async shortcutToFinishMigration() { await disableElasticsearchInternalCollection(); await updateSetupModeData(); @@ -130,6 +192,7 @@ export class SetupModeRenderer extends React.Component { closeFlyout: () => this.setState({ isFlyoutOpen: false }), }, flyoutComponent: this.getFlyout(data, meta), + bottomBarComponent: this.getBottomBar(setupModeState) }); } } diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.js new file mode 100644 index 0000000000000..d9449b0678df9 --- /dev/null +++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.js @@ -0,0 +1,109 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import React, { Fragment } from 'react'; +import { + EuiLink, + EuiTextColor, + EuiIcon +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { ELASTICSEARCH_CUSTOM_ID } from '../../../common/constants'; + +const clickToMonitorWithMetricbeat = i18n.translate('xpack.monitoring.setupMode.clickToMonitorWithMetricbeat', { + defaultMessage: 'Click to monitor with Metricbeat' +}); + +export function SetupModeBadge({ setupMode, productName, status, instance }) { + let useLink = false; + + // Migrating from partially to fully for Elasticsearch involves changing a cluster + // setting which impacts all nodes in the cluster, which we have a separate callout + // for. Since it does not make sense to do this on a per node basis, show nothing here + const explicitlyAvoidLink = status.isPartiallyMigrated && productName === ELASTICSEARCH_CUSTOM_ID; + if (!explicitlyAvoidLink && (status.isInternalCollector || status.isPartiallyMigrated || status.isNetNewUser)) { + useLink = true; + } + + let statusText = null; + if (status.isInternalCollector) { + statusText = ( + + +   + + {clickToMonitorWithMetricbeat} + + + ); + } + else if (status.isPartiallyMigrated) { + const text = explicitlyAvoidLink + ? i18n.translate('xpack.monitoring.setupMode.monitorAllNodes', { + defaultMessage: 'Monitor all nodes with Metricbeat' + }) + : i18n.translate('xpack.monitoring.setupMode.clickToDisableInternalCollection', { + defaultMessage: 'Click to disable internal collection' + }); + + statusText = ( + + +   + + {text} + + + ); + } + else if (status.isFullyMigrated) { + statusText = ( + + +   + + {i18n.translate('xpack.monitoring.setupMode.usingMetricbeatCollection', { + defaultMessage: 'Monitored with Metricbeat' + })} + + + ); + } + else if (status.isNetNewUser) { + statusText = ( + + +   + + {clickToMonitorWithMetricbeat} + + + ); + } + else { + statusText = ( + + +   + + {i18n.translate('xpack.monitoring.setupMode.unknown', { + defaultMessage: 'N/A' + })} + + + ); + } + + if (useLink) { + return ( + setupMode.openFlyout(instance)}> + {statusText} + + ); + } + + return statusText; +} diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/common_text.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/common_text.js new file mode 100644 index 0000000000000..88926ab67c49a --- /dev/null +++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/common_text.js @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +import { i18n } from '@kbn/i18n'; + +export const NODE_IDENTIFIER_SINGULAR = i18n.translate('xpack.monitoring.setupMode.node', { + defaultMessage: `node`, +}); +export const NODE_IDENTIFIER_PLURAL = i18n.translate('xpack.monitoring.setupMode.nodes', { + defaultMessage: `nodes`, +}); +export const INSTANCE_IDENTIFIER_SINGULAR = i18n.translate('xpack.monitoring.setupMode.instance', { + defaultMessage: `instance`, +}); +export const INSTANCE_IDENTIFIER_PLURAL = i18n.translate('xpack.monitoring.setupMode.instances', { + defaultMessage: `instances`, +}); diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js new file mode 100644 index 0000000000000..060885d4102dc --- /dev/null +++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js @@ -0,0 +1,157 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import React, { Fragment } from 'react'; +import { capitalize, get } from 'lodash'; +import { + EuiCallOut, + EuiSpacer, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { + NODE_IDENTIFIER_PLURAL, + INSTANCE_IDENTIFIER_PLURAL, + NODE_IDENTIFIER_SINGULAR, + INSTANCE_IDENTIFIER_SINGULAR +} from './common_text'; + +export function ListingCallOut({ setupModeData, productName, useNodeIdentifier = false, customRenderer = null }) { + if (customRenderer) { + const { shouldRender, componentToRender } = customRenderer(); + if (shouldRender) { + return componentToRender; + } + } + + const mightExist = get(setupModeData, 'detected.mightExist'); + + const hasInstances = setupModeData.totalUniqueInstanceCount > 0; + if (!hasInstances) { + if (mightExist) { + return ( + + +

+ {i18n.translate('xpack.monitoring.setupMode.detectedNodeDescription', { + defaultMessage: `Based on your indices, we think you might have a {product} {identifier}. Click 'Set up monitoring' + below to start monitoring this {identifier}.`, + values: { + product: capitalize(productName), + identifier: useNodeIdentifier ? NODE_IDENTIFIER_SINGULAR : INSTANCE_IDENTIFIER_SINGULAR + } + })} +

+
+ +
+ ); + } + return ( + + +

+ {i18n.translate('xpack.monitoring.setupMode.netNewUserDescription', { + defaultMessage: `But we did find the following {product} {identifier} that require monitoring setup.`, + values: { + product: capitalize(productName), + identifier: useNodeIdentifier ? NODE_IDENTIFIER_PLURAL : INSTANCE_IDENTIFIER_PLURAL + } + })} +

+
+ +
+ ); + } + + if (setupModeData.totalUniqueFullyMigratedCount === setupModeData.totalUniqueInstanceCount) { + return ( + + + + + ); + } + + if (setupModeData.totalUniquePartiallyMigratedCount === setupModeData.totalUniqueInstanceCount) { + return ( + + +

+ {i18n.translate('xpack.monitoring.setupMode.disableInternalCollectionDescription', { + defaultMessage: `Metricbeat is now monitoring your {product} {identifier}. + Disable internal collection to finish the migration.`, + values: { + product: capitalize(productName), + identifier: useNodeIdentifier ? NODE_IDENTIFIER_PLURAL : INSTANCE_IDENTIFIER_PLURAL + } + })} +

+
+ +
+ ); + } + + if (setupModeData.totalUniqueInstanceCount > 0 && + setupModeData.totalUniqueFullyMigratedCount === 0 && setupModeData.totalUniquePartiallyMigratedCount === 0) { + return ( + + +

+ {i18n.translate('xpack.monitoring.setupMode.disableInternalCollectionDescription', { + defaultMessage: `These {product} {identifier} are monitored through internal collection. Migrate to monitor with Metricbeat.`, + values: { + product: capitalize(productName), + identifier: useNodeIdentifier ? NODE_IDENTIFIER_PLURAL : INSTANCE_IDENTIFIER_PLURAL + } + })} +

+
+ +
+ ); + } + + return null; +} diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js new file mode 100644 index 0000000000000..c32dbfdef95c7 --- /dev/null +++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js @@ -0,0 +1,145 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import React from 'react'; +import { get } from 'lodash'; +import { + EuiBadge, + EuiFlexItem, + EuiToolTip, + EuiLink +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { NODE_IDENTIFIER_SINGULAR, INSTANCE_IDENTIFIER_SINGULAR, NODE_IDENTIFIER_PLURAL, INSTANCE_IDENTIFIER_PLURAL } from './common_text'; + +export function SetupModeTooltip({ setupModeData, badgeClickAction, useNodeIdentifier = false }) { + if (!setupModeData) { + return null; + } + + const { + totalUniqueInstanceCount, + totalUniqueFullyMigratedCount, + totalUniquePartiallyMigratedCount + } = setupModeData; + const allMonitoredByMetricbeat = totalUniqueInstanceCount > 0 && + (totalUniqueFullyMigratedCount === totalUniqueInstanceCount || totalUniquePartiallyMigratedCount === totalUniqueInstanceCount); + const internalCollectionOn = totalUniquePartiallyMigratedCount > 0; + const mightExist = get(setupModeData, 'detected.mightExist'); + + let tooltip = null; + + if (totalUniqueInstanceCount === 0) { + if (mightExist) { + tooltip = ( + + + + {i18n.translate('xpack.monitoring.setupMode.tooltip.detected', { + defaultMessage: 'Detected' + })} + + + + ); + } + else { + tooltip = ( + + + + {i18n.translate('xpack.monitoring.setupMode.tooltip.noMonitoring', { + defaultMessage: 'No monitoring' + })} + + + + ); + } + } + + else if (!allMonitoredByMetricbeat) { + tooltip = ( + + + + {i18n.translate('xpack.monitoring.euiTable.isInternalCollectorLabel', { + defaultMessage: 'Internal collection' + })} + + + + ); + } + else if (internalCollectionOn) { + tooltip = ( + + + + {i18n.translate('xpack.monitoring.euiTable.isPartiallyMigratedLabel', { + defaultMessage: 'Internal collection and Metricbeat collection' + })} + + + + ); + } + else { + tooltip = ( + + + + {i18n.translate('xpack.monitoring.euiTable.isFullyMigratedLabel', { + defaultMessage: 'Metricbeat collection' + })} + + + + ); + } + + return ( + + {tooltip} + + ); +} diff --git a/x-pack/legacy/plugins/monitoring/public/components/table/eui_table.js b/x-pack/legacy/plugins/monitoring/public/components/table/eui_table.js index 9bd04e89c8512..ef87f259d8378 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/table/eui_table.js +++ b/x-pack/legacy/plugins/monitoring/public/components/table/eui_table.js @@ -5,17 +5,13 @@ */ import React, { Fragment } from 'react'; -import { get } from 'lodash'; import { EuiInMemoryTable, - EuiBadge, - EuiButtonEmpty, - EuiHealth, EuiButton, EuiSpacer } from '@elastic/eui'; -import { ELASTICSEARCH_CUSTOM_ID } from '../../../common/constants'; import { i18n } from '@kbn/i18n'; +import { NODE_IDENTIFIER_SINGULAR, INSTANCE_IDENTIFIER_SINGULAR } from '../setup_mode/common_text'; export class EuiMonitoringTable extends React.PureComponent { render() { @@ -24,9 +20,7 @@ export class EuiMonitoringTable extends React.PureComponent { search = {}, columns: _columns, setupMode, - uuidField, - nameField, - setupNewButtonLabel, + useNodeIdentifier, ...props } = this.props; @@ -51,150 +45,161 @@ export class EuiMonitoringTable extends React.PureComponent { let footerContent = null; if (setupMode && setupMode.enabled) { - columns.push({ - name: i18n.translate('xpack.monitoring.euiTable.setupStatusTitle', { - defaultMessage: 'Setup Status' - }), - sortable: product => { - const list = get(setupMode, 'data.byUuid', {}); - const status = list[get(product, uuidField)] || {}; - - if (status.isInternalCollector) { - return 4; - } - - if (status.isPartiallyMigrated) { - return 3; - } - - if (status.isFullyMigrated) { - return 2; - } - - if (status.isNetNewUser) { - return 1; - } - - return 0; - }, - render: (product) => { - const list = get(setupMode, 'data.byUuid', {}); - const status = list[get(product, uuidField)] || {}; - - let statusBadge = null; - if (status.isInternalCollector) { - statusBadge = ( - - {i18n.translate('xpack.monitoring.euiTable.isInternalCollectorLabel', { - defaultMessage: 'Internal collection' - })} - - ); - } - else if (status.isPartiallyMigrated) { - statusBadge = ( - - {i18n.translate('xpack.monitoring.euiTable.isPartiallyMigratedLabel', { - defaultMessage: 'Internal collection and Metricbeat collection' - })} - - ); - } - else if (status.isFullyMigrated) { - statusBadge = ( - - {i18n.translate('xpack.monitoring.euiTable.isFullyMigratedLabel', { - defaultMessage: 'Metricbeat collection' - })} - - ); - } - else if (status.isNetNewUser) { - statusBadge = ( - - {i18n.translate('xpack.monitoring.euiTable.isNetNewUserLabel', { - defaultMessage: 'No monitoring detected' - })} - - ); - } - else { - statusBadge = i18n.translate('xpack.monitoring.euiTable.migrationStatusUnknown', { - defaultMessage: 'N/A' - }); - } - - return statusBadge; - } - }); - - columns.push({ - name: i18n.translate('xpack.monitoring.euiTable.setupActionTitle', { - defaultMessage: 'Setup Action' - }), - sortable: product => { - const list = get(setupMode, 'data.byUuid', {}); - const status = list[get(product, uuidField)] || {}; - - if (status.isInternalCollector || status.isNetNewUser) { - return 1; - } - - if (status.isPartiallyMigrated) { - if (setupMode.productName === ELASTICSEARCH_CUSTOM_ID) { - // See comment for same conditional in render function - return 0; - } - return 1; - } - - return 0; - }, - render: (product) => { - const uuid = get(product, uuidField); - const list = get(setupMode, 'data.byUuid', {}); - const status = list[uuid] || {}; - const instance = { - uuid: get(product, uuidField), - name: get(product, nameField), - }; - - // Migrating from partially to fully for Elasticsearch involves changing a cluster - // setting which impacts all nodes in the cluster, which we have a separate callout - // for. Since it does not make sense to do this on a per node basis, show nothing here - if (status.isPartiallyMigrated && setupMode.productName === ELASTICSEARCH_CUSTOM_ID) { - return null; - } - - if (status.isInternalCollector || status.isPartiallyMigrated) { - return ( - setupMode.openFlyout(instance)}> - {i18n.translate('xpack.monitoring.euiTable.migrateButtonLabel', { - defaultMessage: 'Migrate' - })} - - ); - } - - if (status.isNetNewUser) { - return ( - setupMode.openFlyout(instance)}> - {i18n.translate('xpack.monitoring.euiTable.setupButtonLabel', { - defaultMessage: 'Setup' - })} - - ); - } - - return null; - } - }); + // columns.push({ + // name: i18n.translate('xpack.monitoring.euiTable.setupStatusTitle', { + // defaultMessage: 'Set up Status' + // }), + // sortable: product => { + // const list = get(setupMode, 'data.byUuid', {}); + // const status = list[get(product, uuidField)] || {}; + + // if (status.isInternalCollector) { + // return 4; + // } + + // if (status.isPartiallyMigrated) { + // return 3; + // } + + // if (status.isFullyMigrated) { + // return 2; + // } + + // if (status.isNetNewUser) { + // return 1; + // } + + // return 0; + // }, + // render: (product) => { + // const list = get(setupMode, 'data.byUuid', {}); + // const status = list[get(product, uuidField)] || {}; + + // let statusBadge = null; + // if (status.isInternalCollector) { + // statusBadge = ( + // + // {i18n.translate('xpack.monitoring.euiTable.isInternalCollectorLabel', { + // defaultMessage: 'Internal collection' + // })} + // + // ); + // } + // else if (status.isPartiallyMigrated) { + // statusBadge = ( + // + // {i18n.translate('xpack.monitoring.euiTable.isPartiallyMigratedLabel', { + // defaultMessage: 'Internal collection and Metricbeat collection' + // })} + // + // ); + // } + // else if (status.isFullyMigrated) { + // statusBadge = ( + // + // {i18n.translate('xpack.monitoring.euiTable.isFullyMigratedLabel', { + // defaultMessage: 'Metricbeat collection' + // })} + // + // ); + // } + // else if (status.isNetNewUser) { + // statusBadge = ( + // + // {i18n.translate('xpack.monitoring.euiTable.isNetNewUserLabel', { + // defaultMessage: 'No monitoring detected' + // })} + // + // ); + // } + // else { + // statusBadge = i18n.translate('xpack.monitoring.euiTable.migrationStatusUnknown', { + // defaultMessage: 'N/A' + // }); + // } + + // return statusBadge; + // } + // }); + + // columns.push({ + // name: i18n.translate('xpack.monitoring.euiTable.setupActionTitle', { + // defaultMessage: 'Set up' + // }), + // sortable: product => { + // const list = get(setupMode, 'data.byUuid', {}); + // const status = list[get(product, uuidField)] || {}; + + // if (status.isInternalCollector || status.isNetNewUser) { + // return 1; + // } + + // if (status.isPartiallyMigrated) { + // if (setupMode.productName === ELASTICSEARCH_CUSTOM_ID) { + // // See comment for same conditional in render function + // return 0; + // } + // return 1; + // } + + // return 0; + // }, + // render: (product) => { + // const uuid = get(product, uuidField); + // const list = get(setupMode, 'data.byUuid', {}); + // const status = list[uuid] || {}; + // const instance = { + // uuid: get(product, uuidField), + // name: get(product, nameField), + // }; + + // // Migrating from partially to fully for Elasticsearch involves changing a cluster + // // setting which impacts all nodes in the cluster, which we have a separate callout + // // for. Since it does not make sense to do this on a per node basis, show nothing here + // if (status.isPartiallyMigrated && setupMode.productName === ELASTICSEARCH_CUSTOM_ID) { + // return null; + // } + + // if (status.isInternalCollector || status.isPartiallyMigrated) { + // return ( + // setupMode.openFlyout(instance)}> + // {i18n.translate('xpack.monitoring.euiTable.migrateButtonLabel', { + // defaultMessage: 'Migrate `{name}` to use Metricbeat', + // values: { + // name: product.name + // } + // })} + // + // ); + // } + + // if (status.isNetNewUser) { + // return ( + // setupMode.openFlyout(instance)}> + // {i18n.translate('xpack.monitoring.euiTable.setupButtonLabel', { + // defaultMessage: 'Set up `{name}` to use Metricbeat', + // values: { + // name: product.name + // } + // })} + // + // ); + // } + + // return null; + // } + // }); footerContent = ( - setupMode.openFlyout({}, true)}> - {setupNewButtonLabel} + setupMode.openFlyout({}, true)}> + {i18n.translate('xpack.monitoring.euiTable.setupNewButtonLabel', { + defaultMessage: 'Set up monitoring for new {identifier}', + values: { + identifier: useNodeIdentifier ? NODE_IDENTIFIER_SINGULAR : INSTANCE_IDENTIFIER_SINGULAR + } + })} ); diff --git a/x-pack/legacy/plugins/monitoring/public/directives/main/index.js b/x-pack/legacy/plugins/monitoring/public/directives/main/index.js index 4d56cc28c241e..3a1e146331372 100644 --- a/x-pack/legacy/plugins/monitoring/public/directives/main/index.js +++ b/x-pack/legacy/plugins/monitoring/public/directives/main/index.js @@ -56,6 +56,7 @@ const setOptions = (controller) => { , controller.pipelineDropdownElement); }; + /* * Manage data and provide helper methods for the "main" directive's template */ @@ -97,7 +98,7 @@ export class MonitoringMainController { } else { this.inOverview = this.name === 'overview'; this.inAlerts = this.name === 'alerts'; - this.inListing = this.name === 'listing' || this.name === 'no-data'; + this.inListing = this.name === 'listing';// || this.name === 'no-data'; } if (!this.inListing) { diff --git a/x-pack/legacy/plugins/monitoring/public/lib/route_init.js b/x-pack/legacy/plugins/monitoring/public/lib/route_init.js index 2f1eef85be725..1cd8e688854eb 100644 --- a/x-pack/legacy/plugins/monitoring/public/lib/route_init.js +++ b/x-pack/legacy/plugins/monitoring/public/lib/route_init.js @@ -6,7 +6,7 @@ import _ from 'lodash'; import { ajaxErrorHandlersProvider } from 'plugins/monitoring/lib/ajax_error_handler'; -import { getSetupModeState } from './setup_mode'; +import { isInSetupMode } from './setup_mode'; import { getClusterFromClusters } from './get_cluster_from_clusters'; export function routeInitProvider(Private, monitoringClusters, globalState, license, kbnUrl) { @@ -26,8 +26,8 @@ export function routeInitProvider(Private, monitoringClusters, globalState, lice const clusterUuid = fetchAllClusters ? null : globalState.cluster_uuid; return monitoringClusters(clusterUuid, undefined, codePaths) // Set the clusters collection and current cluster in globalState - .then((clusters) => { - const inSetupMode = getSetupModeState().enabled; + .then(async (clusters) => { + const inSetupMode = await isInSetupMode(); const cluster = getClusterFromClusters(clusters, globalState); if (!cluster && !inSetupMode) { return kbnUrl.redirect('/no-data'); diff --git a/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.js b/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.js index 18ec506dea965..34688a0e21eb9 100644 --- a/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.js +++ b/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.js @@ -6,6 +6,7 @@ import { ajaxErrorHandlersProvider } from './ajax_error_handler'; import { get, contains } from 'lodash'; +import chrome from 'ui/chrome'; function isOnPage(hash) { return contains(window.location.hash, hash); @@ -146,26 +147,11 @@ const setSetupModeMenuItem = () => { const globalState = angularState.injector.get('globalState'); const navItems = globalState.inSetupMode - ? [ - { - id: 'exit', - label: 'Exit Setup Mode', - description: 'Exit setup mode', - run: () => toggleSetupMode(false), - testId: 'exitSetupMode' - }, - { - id: 'refresh', - label: 'Refresh Setup Data', - description: 'Refresh data used for setup mode', - run: () => updateSetupModeData(), - testId: 'refreshSetupModeData' - } - ] + ? [] : [{ id: 'enter', label: 'Enter Setup Mode', - description: 'Enter setup mode', + description: 'Enter setup', run: () => toggleSetupMode(true), testId: 'enterSetupMode' }]; @@ -177,14 +163,24 @@ const setSetupModeMenuItem = () => { } }; -export const initSetupModeState = ($scope, $injector, callback) => { +export const initSetupModeState = async ($scope, $injector, callback) => { angularState.scope = $scope; angularState.injector = $injector; setSetupModeMenuItem(); callback && setupModeState.callbacks.push(callback); - const globalState = angularState.injector.get('globalState'); + const globalState = $injector.get('globalState'); if (globalState.inSetupMode) { - toggleSetupMode(true); + await toggleSetupMode(true); } }; + +export const isInSetupMode = async () => { + if (setupModeState.enabled) { + return true; + } + + const $injector = angularState.injector || await chrome.dangerouslyGetActiveInjector(); + const globalState = $injector.get('globalState'); + return globalState.inSetupMode; +}; diff --git a/x-pack/legacy/plugins/monitoring/public/services/breadcrumbs_provider.js b/x-pack/legacy/plugins/monitoring/public/services/breadcrumbs_provider.js index 1648507161ae9..aa91d0ff6e6ed 100644 --- a/x-pack/legacy/plugins/monitoring/public/services/breadcrumbs_provider.js +++ b/x-pack/legacy/plugins/monitoring/public/services/breadcrumbs_provider.js @@ -6,7 +6,6 @@ import chrome from 'ui/chrome'; import { i18n } from '@kbn/i18n'; -import { getSetupModeState } from '../lib/setup_mode'; // Helper for making objects to use in a link element const createCrumb = (url, label, testSubj) => { @@ -121,15 +120,9 @@ function getApmBreadcrumbs(mainInstance) { export function breadcrumbsProvider() { return function createBreadcrumbs(clusterName, mainInstance) { - const setupMode = getSetupModeState(); - // This mimics how the edit mode works for dashboards - const homeCrumb = setupMode.enabled - ? i18n.translate( - 'xpack.monitoring.breadcrumbs.clustersInSetupModeLabel', { defaultMessage: 'Clusters (Setup Mode)' } - ) - : i18n.translate( - 'xpack.monitoring.breadcrumbs.clustersLabel', { defaultMessage: 'Clusters' } - ); + const homeCrumb = i18n.translate( + 'xpack.monitoring.breadcrumbs.clustersLabel', { defaultMessage: 'Clusters' } + ); let breadcrumbs = [ createCrumb('#/home', homeCrumb, 'breadcrumbClusters')]; diff --git a/x-pack/legacy/plugins/monitoring/public/views/apm/instances/index.js b/x-pack/legacy/plugins/monitoring/public/views/apm/instances/index.js index 367c9f78a44d8..03a69a008e096 100644 --- a/x-pack/legacy/plugins/monitoring/public/views/apm/instances/index.js +++ b/x-pack/legacy/plugins/monitoring/public/views/apm/instances/index.js @@ -68,7 +68,7 @@ uiRoutes.when('/apm/instances', { scope={this.scope} injector={this.injector} productName={APM_CUSTOM_ID} - render={({ setupMode, flyoutComponent }) => ( + render={({ setupMode, flyoutComponent, bottomBarComponent }) => ( {flyoutComponent} + {bottomBarComponent} )} /> diff --git a/x-pack/legacy/plugins/monitoring/public/views/beats/listing/index.js b/x-pack/legacy/plugins/monitoring/public/views/beats/listing/index.js index 2878874e1a4a9..e5a95c279a1bd 100644 --- a/x-pack/legacy/plugins/monitoring/public/views/beats/listing/index.js +++ b/x-pack/legacy/plugins/monitoring/public/views/beats/listing/index.js @@ -63,7 +63,7 @@ uiRoutes.when('/beats/beats', { scope={this.scope} injector={this.injector} productName={BEATS_SYSTEM_ID} - render={({ setupMode, flyoutComponent }) => ( + render={({ setupMode, flyoutComponent, bottomBarComponent }) => ( {flyoutComponent} + {bottomBarComponent} )} /> diff --git a/x-pack/legacy/plugins/monitoring/public/views/cluster/overview/index.js b/x-pack/legacy/plugins/monitoring/public/views/cluster/overview/index.js index b9ecc92d79ccd..670ef82513640 100644 --- a/x-pack/legacy/plugins/monitoring/public/views/cluster/overview/index.js +++ b/x-pack/legacy/plugins/monitoring/public/views/cluster/overview/index.js @@ -57,7 +57,7 @@ uiRoutes.when('/overview', { ( + render={({ setupMode, flyoutComponent, bottomBarComponent }) => ( {flyoutComponent} + {bottomBarComponent} )} /> diff --git a/x-pack/legacy/plugins/monitoring/public/views/elasticsearch/nodes/index.js b/x-pack/legacy/plugins/monitoring/public/views/elasticsearch/nodes/index.js index 67658c665d3cf..1368cbfd8fee1 100644 --- a/x-pack/legacy/plugins/monitoring/public/views/elasticsearch/nodes/index.js +++ b/x-pack/legacy/plugins/monitoring/public/views/elasticsearch/nodes/index.js @@ -84,7 +84,7 @@ uiRoutes.when('/elasticsearch/nodes', { scope={$scope} injector={$injector} productName={ELASTICSEARCH_CUSTOM_ID} - render={({ setupMode, flyoutComponent }) => ( + render={({ setupMode, flyoutComponent, bottomBarComponent }) => ( {flyoutComponent} + {bottomBarComponent} )} /> diff --git a/x-pack/legacy/plugins/monitoring/public/views/kibana/instances/index.js b/x-pack/legacy/plugins/monitoring/public/views/kibana/instances/index.js index 1b8e2b193c97b..182a4064d0b20 100644 --- a/x-pack/legacy/plugins/monitoring/public/views/kibana/instances/index.js +++ b/x-pack/legacy/plugins/monitoring/public/views/kibana/instances/index.js @@ -47,7 +47,7 @@ uiRoutes.when('/kibana/instances', { scope={$scope} injector={$injector} productName={KIBANA_SYSTEM_ID} - render={({ setupMode, flyoutComponent }) => ( + render={({ setupMode, flyoutComponent, bottomBarComponent }) => ( {flyoutComponent} + {bottomBarComponent} )} /> diff --git a/x-pack/legacy/plugins/monitoring/public/views/logstash/nodes/index.js b/x-pack/legacy/plugins/monitoring/public/views/logstash/nodes/index.js index a392911dcda1d..0c65c82a47f05 100644 --- a/x-pack/legacy/plugins/monitoring/public/views/logstash/nodes/index.js +++ b/x-pack/legacy/plugins/monitoring/public/views/logstash/nodes/index.js @@ -46,7 +46,7 @@ uiRoutes.when('/logstash/nodes', { scope={$scope} injector={$injector} productName={LOGSTASH_SYSTEM_ID} - render={({ setupMode, flyoutComponent }) => ( + render={({ setupMode, flyoutComponent, bottomBarComponent }) => ( {flyoutComponent} + {bottomBarComponent} )} /> diff --git a/x-pack/legacy/plugins/monitoring/public/views/no_data/index.js b/x-pack/legacy/plugins/monitoring/public/views/no_data/index.js index 9aa5b985da6f7..9924653ac819e 100644 --- a/x-pack/legacy/plugins/monitoring/public/views/no_data/index.js +++ b/x-pack/legacy/plugins/monitoring/public/views/no_data/index.js @@ -4,15 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -import React from 'react'; import uiRoutes from 'ui/routes'; import template from './index.html'; import { CODE_PATH_LICENSE } from '../../../common/constants'; -import { I18nContext } from 'ui/i18n'; -import { render } from 'react-dom'; -import { NoData } from '../../components/no_data/no_data'; - -const REACT_NODE_ID_NO_DATA = 'noDataReact'; +import { NoDataController } from './controller'; uiRoutes .when('/no-data', { @@ -31,18 +26,6 @@ uiRoutes }); } }, - controller: class { - constructor($injector, $scope) { - $scope.$$postDigest(() => { - render( - - $scope.$apply(() => $injector.get('kbnUrl').changePath(path))} /> - , - document.getElementById(REACT_NODE_ID_NO_DATA) - ); - }); - - } - } + controller: NoDataController, }) .otherwise({ redirectTo: '/home' }); From cfb67e6de0bfe016aa52e49b103f00b756e050c3 Mon Sep 17 00:00:00 2001 From: chrisronline Date: Mon, 9 Sep 2019 14:52:58 -0400 Subject: [PATCH 09/43] Consolidate UI code, design changes, use constants defined in our plugin --- .../plugins/monitoring/common/constants.js | 24 +- .../components/apm/instances/instances.js | 205 ++++++++++-------- .../components/beats/listing/listing.js | 56 +++-- .../components/elasticsearch/nodes/nodes.js | 8 +- .../components/kibana/instances/instances.js | 2 +- .../components/logstash/listing/listing.js | 2 +- .../metricbeat_migration/flyout/flyout.js | 62 ++---- .../apm/common_apm_instructions.js | 10 - ...isable_internal_collection_instructions.js | 81 +------ .../apm/enable_metricbeat_instructions.js | 81 +------ .../beats/common_beats_instructions.js | 5 - ...isable_internal_collection_instructions.js | 82 +------ .../beats/enable_metricbeat_instructions.js | 81 +------ .../instruction_steps/common_instructions.js | 177 +++++++++++++++ .../common_elasticsearch_instructions.js | 14 -- ...isable_internal_collection_instructions.js | 81 +------ .../enable_metricbeat_instructions.js | 79 +------ .../get_instruction_steps.js | 15 +- .../kibana/common_kibana_instructions.js | 14 -- ...isable_internal_collection_instructions.js | 79 +------ .../kibana/enable_metricbeat_instructions.js | 81 +------ .../logstash/common_logstash_instructions.js | 10 - ...isable_internal_collection_instructions.js | 81 +------ .../enable_metricbeat_instructions.js | 81 +------ .../public/components/setup_mode/badge.js | 6 +- .../components/setup_mode/common_text.js | 19 -- .../components/setup_mode/formatting.js | 56 +++++ .../components/setup_mode/listing_callout.js | 44 ++-- .../public/components/setup_mode/tooltip.js | 12 +- .../public/components/table/eui_table.js | 151 +------------ .../public/views/apm/instances/index.js | 4 +- .../public/views/beats/listing/index.js | 3 +- .../public/views/elasticsearch/nodes/index.js | 4 +- .../public/views/kibana/instances/index.js | 3 +- .../public/views/logstash/nodes/index.js | 3 +- .../setup/collection/get_collection_status.js | 30 ++- 36 files changed, 513 insertions(+), 1233 deletions(-) delete mode 100644 x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/common_apm_instructions.js create mode 100644 x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/common_instructions.js delete mode 100644 x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/elasticsearch/common_elasticsearch_instructions.js delete mode 100644 x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/common_kibana_instructions.js delete mode 100644 x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/common_logstash_instructions.js delete mode 100644 x-pack/legacy/plugins/monitoring/public/components/setup_mode/common_text.js create mode 100644 x-pack/legacy/plugins/monitoring/public/components/setup_mode/formatting.js diff --git a/x-pack/legacy/plugins/monitoring/common/constants.js b/x-pack/legacy/plugins/monitoring/common/constants.js index 60560d6f0fa76..f953741cd2e02 100644 --- a/x-pack/legacy/plugins/monitoring/common/constants.js +++ b/x-pack/legacy/plugins/monitoring/common/constants.js @@ -154,30 +154,10 @@ export const INDEX_PATTERN_FILEBEAT = 'filebeat-*'; export const METRICBEAT_INDEX_NAME_UNIQUE_TOKEN = '-mb-'; // We use this for metricbeat migration to identify specific products that we do not have constants for -export const ELASTICSEARCH_CUSTOM_ID = 'elasticsearch'; -export const APM_CUSTOM_ID = 'apm'; -/** - * The name of the Kibana System ID used to publish and look up Kibana stats through the Monitoring system. - * @type {string} - */ +export const ELASTICSEARCH_SYSTEM_ID = 'elasticsearch'; export const KIBANA_SYSTEM_ID = 'kibana'; - -/** - * The name of the Beats System ID used to publish and look up Beats stats through the Monitoring system. - * @type {string} - */ export const BEATS_SYSTEM_ID = 'beats'; - -/** - * The name of the Apm System ID used to publish and look up Apm stats through the Monitoring system. - * @type {string} - */ -export const APM_SYSTEM_ID = 'beats'; - -/** - * The name of the Kibana System ID used to look up Logstash stats through the Monitoring system. - * @type {string} - */ +export const APM_SYSTEM_ID = 'apm'; export const LOGSTASH_SYSTEM_ID = 'logstash'; /** * The id of the infra source owned by the monitoring plugin. diff --git a/x-pack/legacy/plugins/monitoring/public/components/apm/instances/instances.js b/x-pack/legacy/plugins/monitoring/public/components/apm/instances/instances.js index 86de231baeccc..b0ecb0ae5aeb7 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/apm/instances/instances.js +++ b/x-pack/legacy/plugins/monitoring/public/components/apm/instances/instances.js @@ -8,80 +8,111 @@ import React, { Fragment } from 'react'; import moment from 'moment'; import { uniq, get } from 'lodash'; import { EuiMonitoringTable } from '../../table'; -import { EuiLink, EuiPage, EuiPageBody, EuiPageContent, EuiSpacer, EuiCallOut } from '@elastic/eui'; +import { EuiLink, EuiPage, EuiPageBody, EuiPageContent, EuiSpacer } from '@elastic/eui'; import { Status } from './status'; import { formatMetric } from '../../../lib/format_number'; import { formatTimestampToDuration } from '../../../../common'; import { i18n } from '@kbn/i18n'; +import { APM_SYSTEM_ID } from '../../../../common/constants'; +import { ListingCallOut } from '../../setup_mode/listing_callout'; +import { SetupModeBadge } from '../../setup_mode/badge'; -const columns = [ - { - name: i18n.translate('xpack.monitoring.apm.instances.nameTitle', { - defaultMessage: 'Name' - }), - field: 'name', - render: (name, instance) => ( - - {name} - - ) - }, - { - name: i18n.translate('xpack.monitoring.apm.instances.outputEnabledTitle', { - defaultMessage: 'Output Enabled' - }), - field: 'output' - }, - { - name: i18n.translate('xpack.monitoring.apm.instances.totalEventsRateTitle', { - defaultMessage: 'Total Events Rate' - }), - field: 'total_events_rate', - render: value => formatMetric(value, '', '/s') - }, - { - name: i18n.translate('xpack.monitoring.apm.instances.bytesSentRateTitle', { - defaultMessage: 'Bytes Sent Rate' - }), - field: 'bytes_sent_rate', - render: value => formatMetric(value, 'byte', '/s') - }, - { - name: i18n.translate('xpack.monitoring.apm.instances.outputErrorsTitle', { - defaultMessage: 'Output Errors' - }), - field: 'errors', - render: value => formatMetric(value, '0') - }, - { - name: i18n.translate('xpack.monitoring.apm.instances.lastEventTitle', { - defaultMessage: 'Last Event' - }), - field: 'time_of_last_event', - render: value => i18n.translate('xpack.monitoring.apm.instances.lastEventValue', { - defaultMessage: '{timeOfLastEvent} ago', - values: { - timeOfLastEvent: formatTimestampToDuration(+moment(value), 'since') +function getColumns(setupMode) { + return [ + { + name: i18n.translate('xpack.monitoring.apm.instances.nameTitle', { + defaultMessage: 'Name' + }), + field: 'name', + render: (name, apm) => { + let setupModeStatus = null; + if (setupMode && setupMode.enabled) { + const list = get(setupMode, 'data.byUuid', {}); + const status = list[apm.uuid] || {}; + const instance = { + uuid: apm.uuid, + name: apm.name + }; + + setupModeStatus = ( +
+ +
+ ); + } + + return ( + + + {name} + + {setupModeStatus} + + ); } - }) - }, - { - name: i18n.translate('xpack.monitoring.apm.instances.allocatedMemoryTitle', { - defaultMessage: 'Allocated Memory' - }), - field: 'memory', - render: value => formatMetric(value, 'byte') - }, - { - name: i18n.translate('xpack.monitoring.apm.instances.versionTitle', { - defaultMessage: 'Version' - }), - field: 'version' - }, -]; + }, + { + name: i18n.translate('xpack.monitoring.apm.instances.outputEnabledTitle', { + defaultMessage: 'Output Enabled' + }), + field: 'output' + }, + { + name: i18n.translate('xpack.monitoring.apm.instances.totalEventsRateTitle', { + defaultMessage: 'Total Events Rate' + }), + field: 'total_events_rate', + render: value => formatMetric(value, '', '/s') + }, + { + name: i18n.translate('xpack.monitoring.apm.instances.bytesSentRateTitle', { + defaultMessage: 'Bytes Sent Rate' + }), + field: 'bytes_sent_rate', + render: value => formatMetric(value, 'byte', '/s') + }, + { + name: i18n.translate('xpack.monitoring.apm.instances.outputErrorsTitle', { + defaultMessage: 'Output Errors' + }), + field: 'errors', + render: value => formatMetric(value, '0') + }, + { + name: i18n.translate('xpack.monitoring.apm.instances.lastEventTitle', { + defaultMessage: 'Last Event' + }), + field: 'time_of_last_event', + render: value => i18n.translate('xpack.monitoring.apm.instances.lastEventValue', { + defaultMessage: '{timeOfLastEvent} ago', + values: { + timeOfLastEvent: formatTimestampToDuration(+moment(value), 'since') + } + }) + }, + { + name: i18n.translate('xpack.monitoring.apm.instances.allocatedMemoryTitle', { + defaultMessage: 'Allocated Memory' + }), + field: 'memory', + render: value => formatMetric(value, 'byte') + }, + { + name: i18n.translate('xpack.monitoring.apm.instances.versionTitle', { + defaultMessage: 'Version' + }), + field: 'version' + }, + ]; +} export function ApmServerInstances({ apms, setupMode }) { const { @@ -91,26 +122,14 @@ export function ApmServerInstances({ apms, setupMode }) { data, } = apms; - let detectedInstanceMessage = null; - if (setupMode.enabled && setupMode.data && get(setupMode.data, 'detected.mightExist')) { - detectedInstanceMessage = ( - - -

- {i18n.translate('xpack.monitoring.apm.instances.metricbeatMigration.detectedInstanceDescription', { - defaultMessage: `Based on your indices, we think you might have an APM server. Click the 'Setup monitoring' - button below to start monitoring this APM server.` - })} -

-
- -
+ let setupModeCallout = null; + if (setupMode.data) { + setupModeCallout = ( + ); } @@ -124,19 +143,15 @@ export function ApmServerInstances({ apms, setupMode }) { - {detectedInstanceMessage} + {setupModeCallout} ( - { - scope.$evalAsync(() => { - kbnUrl.changePath(`/beats/beat/${beat.uuid}`); - }); - }} - data-test-subj={`beatLink-${name}`} - > - {name} - - ) + render: (name, beat) => { + let setupModeStatus = null; + if (setupMode && setupMode.enabled) { + const list = get(setupMode, 'data.byUuid', {}); + const status = list[beat.uuid] || {}; + const instance = { + uuid: beat.uuid, + name: beat.name + }; + + setupModeStatus = ( +
+ +
+ ); + } + + return ( +
+ { + scope.$evalAsync(() => { + kbnUrl.changePath(`/beats/beat/${beat.uuid}`); + }); + }} + data-test-subj={`beatLink-${name}`} + > + {name} + + {setupModeStatus} +
+ ); + } }, { name: i18n.translate('xpack.monitoring.beats.instances.typeTitle', { defaultMessage: 'Type' }), @@ -110,7 +138,7 @@ export class Listing extends PureComponent { className="beatsTable" rows={data} setupMode={setupMode} - useNodeIdentifier={false} + productName={BEATS_SYSTEM_ID} columns={this.getColumns()} sorting={sorting} pagination={pagination} diff --git a/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js b/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js index 360adf1c2a0a6..b74bf66035e25 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js +++ b/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js @@ -25,7 +25,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import _ from 'lodash'; -import { ELASTICSEARCH_CUSTOM_ID } from '../../../../common/constants'; +import { ELASTICSEARCH_SYSTEM_ID } from '../../../../common/constants'; import { ListingCallOut } from '../../setup_mode/listing_callout'; const getSortHandler = (type) => (item) => _.get(item, [type, 'summary', 'lastVal']); @@ -68,7 +68,7 @@ const getColumns = (showCgroupMetricsElasticsearch, setupMode) => { setupMode={setupMode} status={status} instance={instance} - productName={ELASTICSEARCH_CUSTOM_ID} + productName={ELASTICSEARCH_SYSTEM_ID} /> ); @@ -271,7 +271,7 @@ export function ElasticsearchNodes({ clusterStatus, showCgroupMetricsElasticsear { const customRenderResponse = { shouldRender: false, @@ -345,7 +345,7 @@ export function ElasticsearchNodes({ clusterStatus, showCgroupMetricsElasticsear sorting={sorting} pagination={pagination} setupMode={setupMode} - useNodeIdentifier + productName={ELASTICSEARCH_SYSTEM_ID} search={{ box: { incremental: true, diff --git a/x-pack/legacy/plugins/monitoring/public/components/kibana/instances/instances.js b/x-pack/legacy/plugins/monitoring/public/components/kibana/instances/instances.js index 4c4798ad15c11..46876740efa41 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/kibana/instances/instances.js +++ b/x-pack/legacy/plugins/monitoring/public/components/kibana/instances/instances.js @@ -236,7 +236,7 @@ export class KibanaInstances extends PureComponent { sorting={sorting} pagination={pagination} setupMode={setupMode} - useNodeIdentifier={false} + productName={KIBANA_SYSTEM_ID} search={{ box: { incremental: true, diff --git a/x-pack/legacy/plugins/monitoring/public/components/logstash/listing/listing.js b/x-pack/legacy/plugins/monitoring/public/components/logstash/listing/listing.js index 5a7e543b6e263..94f83e4046c61 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/logstash/listing/listing.js +++ b/x-pack/legacy/plugins/monitoring/public/components/logstash/listing/listing.js @@ -177,7 +177,7 @@ export class Listing extends PureComponent { className="logstashNodesTable" rows={flattenedData} setupMode={setupMode} - useNodeIdentifier + productName={LOGSTASH_SYSTEM_ID} columns={columns} sorting={{ ...sorting, diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/flyout/flyout.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/flyout/flyout.js index 37117813b8a0b..88e11c176018f 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/flyout/flyout.js +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/flyout/flyout.js @@ -26,7 +26,7 @@ import { } from '@elastic/eui'; import { getInstructionSteps } from '../instruction_steps'; import { Storage } from 'ui/storage'; -import { STORAGE_KEY, ELASTICSEARCH_CUSTOM_ID } from '../../../../common/constants'; +import { STORAGE_KEY, ELASTICSEARCH_SYSTEM_ID, KIBANA_SYSTEM_ID } from '../../../../common/constants'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; import { @@ -34,8 +34,8 @@ import { INSTRUCTION_STEP_ENABLE_METRICBEAT, INSTRUCTION_STEP_DISABLE_INTERNAL } from '../constants'; -import { KIBANA_SYSTEM_ID, BEATS_SYSTEM_ID } from '../../../../../telemetry/common/constants'; import { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } from 'ui/documentation_links'; +import { getIdentifier, formatProductName } from '../../setup_mode/formatting'; const storage = new Storage(window.localStorage); const ES_MONITORING_URL_KEY = `${STORAGE_KEY}.mb_migration.esMonitoringUrl`; @@ -142,7 +142,7 @@ export class Flyout extends Component { let willShowNextButton = activeStep !== INSTRUCTION_STEP_DISABLE_INTERNAL; if (activeStep === INSTRUCTION_STEP_ENABLE_METRICBEAT) { - if (productName === ELASTICSEARCH_CUSTOM_ID) { + if (productName === ELASTICSEARCH_SYSTEM_ID) { willShowNextButton = false; // ES can be fully migrated for net new users willDisableDoneButton = !product.isPartiallyMigrated && !product.isFullyMigrated; @@ -222,7 +222,7 @@ export class Flyout extends Component { if (productName === KIBANA_SYSTEM_ID) { documentationUrl = `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/monitoring-metricbeat.html`; } - else if (productName === ELASTICSEARCH_CUSTOM_ID) { + else if (productName === ELASTICSEARCH_SYSTEM_ID) { documentationUrl = `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/reference/${DOC_LINK_VERSION}/configuring-metricbeat.html`; } @@ -244,59 +244,29 @@ export class Flyout extends Component { render() { const { onClose, instance, productName, product } = this.props; - let instanceType = null; - let instanceName = instance ? instance.name : null; - - if (productName === KIBANA_SYSTEM_ID) { - instanceType = i18n.translate('xpack.monitoring.metricbeatMigration.flyout.kibanaInstance', { - defaultMessage: 'instance', - }); - } - else if (productName === ELASTICSEARCH_CUSTOM_ID) { - if (instance) { - instanceType = i18n.translate('xpack.monitoring.metricbeatMigration.flyout.elasticsearchNode', { - defaultMessage: 'node', - }); - } - else { - instanceName = i18n.translate('xpack.monitoring.metricbeatMigration.flyout.elasticsearchNodesTitle', { - defaultMessage: 'Elasticsearch nodes', - }); - } - } + const instanceIdentifier = getIdentifier(productName); + const instanceName = (instance && instance.name) || formatProductName(productName); let title = i18n.translate('xpack.monitoring.metricbeatMigration.flyout.flyoutTitle', { - defaultMessage: 'Migrate {instanceType} `{instanceName}` with Metricbeat', + defaultMessage: 'Monitor {instanceIdentifier} `{instanceName}` with Metricbeat', values: { instanceName, - instanceType + instanceIdentifier } }); if (product.isNetNewUser) { title = i18n.translate('xpack.monitoring.metricbeatMigration.flyout.flyoutTitleNewUser', { - defaultMessage: 'Monitor {instanceType} `{instanceName}` with Metricbeat', + defaultMessage: 'Monitor {instanceName} {instanceIdentifier} with Metricbeat', values: { - instanceName, - instanceType + instanceIdentifier, + instanceName } }); } let noClusterUuidPrompt = null; if (product.isFullyMigrated && product.clusterUuid === null) { - const nodeText = i18n.translate('xpack.monitoring.metricbeatMigration.flyout.node', { - defaultMessage: 'node' - }); - const instanceText = i18n.translate('xpack.monitoring.metricbeatMigration.flyout.instance', { - defaultMessage: 'instance' - }); - - let typeText = nodeText; - if (productName === BEATS_SYSTEM_ID) { - typeText = instanceText; - } - noClusterUuidPrompt = ( Click here to view the Standalone cluster. @@ -332,10 +302,10 @@ export class Flyout extends Component { 'xpack.monitoring.metricbeatMigration.flyout.noClusterUuidCheckboxLabel', { defaultMessage: `Yes, I understand that I will need to look in the Standalone cluster for - this {productName} {typeText}.`, + this {productName} {instanceIdentifier}.`, values: { productName, - typeText + instanceIdentifier } } )} diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/common_apm_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/common_apm_instructions.js deleted file mode 100644 index 643f299bca344..0000000000000 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/common_apm_instructions.js +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ -import { i18n } from '@kbn/i18n'; - -export const statusTitle = i18n.translate('xpack.monitoring.metricbeatMigration.apmInstructions.statusTitle', { - defaultMessage: `Migration status` -}); diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/disable_internal_collection_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/disable_internal_collection_instructions.js index 023f29fc6c28e..9bbe57a1c8c24 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/disable_internal_collection_instructions.js +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/disable_internal_collection_instructions.js @@ -8,14 +8,11 @@ import React, { Fragment } from 'react'; import { EuiSpacer, EuiCodeBlock, - EuiCallOut, EuiText } from '@elastic/eui'; -import { formatTimestampToDuration } from '../../../../../common'; -import { CALCULATE_DURATION_SINCE } from '../../../../../common/constants'; import { Monospace } from '../components/monospace'; import { FormattedMessage } from '@kbn/i18n/react'; -import { statusTitle } from './common_apm_instructions'; +import { getDisableStatusStep } from '../common_instructions'; export function getApmInstructionsForDisablingInternalCollection(product, meta) { const disableInternalCollectionStep = { @@ -57,81 +54,7 @@ export function getApmInstructionsForDisablingInternalCollection(product, meta) ) }; - let migrationStatusStep = null; - if (!product || !product.isFullyMigrated) { - let lastInternallyCollectedMessage = ''; - // It is possible that, during the migration steps, products are not reporting - // monitoring data for a period of time outside the window of our server-side check - // and this is most likely temporary so we want to be defensive and not error out - // and hopefully wait for the next check and this state will be self-corrected. - if (product) { - const lastInternallyCollectedTimestamp = product.lastInternallyCollectedTimestamp || product.lastTimestamp; - const secondsSinceLastInternalCollectionLabel = - formatTimestampToDuration(lastInternallyCollectedTimestamp, CALCULATE_DURATION_SINCE); - lastInternallyCollectedMessage = (); - } - - migrationStatusStep = { - title: statusTitle, - status: 'incomplete', - children: ( - -

- -

-

- {lastInternallyCollectedMessage} -

-
- ) - }; - } - else { - migrationStatusStep = { - title: statusTitle, - status: 'complete', - children: ( - -

- -

-
- ) - }; - } + const migrationStatusStep = getDisableStatusStep(product, meta); return [ disableInternalCollectionStep, diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/enable_metricbeat_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/enable_metricbeat_instructions.js index 3f27cdd35ace0..8a5f920af4536 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/enable_metricbeat_instructions.js +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/enable_metricbeat_instructions.js @@ -9,50 +9,20 @@ import { EuiSpacer, EuiCodeBlock, EuiLink, - EuiCallOut, EuiText } from '@elastic/eui'; import { Monospace } from '../components/monospace'; import { FormattedMessage } from '@kbn/i18n/react'; -import { statusTitle } from './common_apm_instructions'; import { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } from 'ui/documentation_links'; +import { getMigrationStatusStep, getSecurityStep } from '../common_instructions'; export function getApmInstructionsForEnablingMetricbeat(product, _meta, { esMonitoringUrl, }) { - const securitySetup = ( - - - - - {` `} - - - - - ) - }} - /> - - )} - /> -
+ const securitySetup = getSecurityStep( + `${ELASTIC_WEBSITE_URL}guide/en/apm/reference/${DOC_LINK_VERSION}/configuring-metricbeat.html` ); + const installMetricbeatStep = { title: i18n.translate('xpack.monitoring.metricbeatMigration.apmInstructions.installMetricbeatTitle', { defaultMessage: 'Install Metricbeat on the same server as the APM server' @@ -165,48 +135,7 @@ export function getApmInstructionsForEnablingMetricbeat(product, _meta, { ) }; - let migrationStatusStep = null; - if (product.isInternalCollector || product.isNetNewUser) { - migrationStatusStep = { - title: statusTitle, - status: 'incomplete', - children: ( - - ) - }; - } - else if (product.isPartiallyMigrated || product.isFullyMigrated) { - migrationStatusStep = { - title: statusTitle, - status: 'complete', - children: ( - -

- -

-
- ) - }; - } + const migrationStatusStep = getMigrationStatusStep(product); return [ installMetricbeatStep, diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/common_beats_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/common_beats_instructions.js index 0ada632f9779e..8953b8a858d43 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/common_beats_instructions.js +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/common_beats_instructions.js @@ -3,11 +3,6 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { i18n } from '@kbn/i18n'; - -export const statusTitle = i18n.translate('xpack.monitoring.metricbeatMigration.beatsInstructions.statusTitle', { - defaultMessage: `Migration status` -}); export const UNDETECTED_BEAT_TYPE = 'beat'; export const DEFAULT_BEAT_FOR_URLS = 'metricbeat'; diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/disable_internal_collection_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/disable_internal_collection_instructions.js index e597de68e30fb..0032997959c09 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/disable_internal_collection_instructions.js +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/disable_internal_collection_instructions.js @@ -8,14 +8,12 @@ import React, { Fragment } from 'react'; import { EuiSpacer, EuiCodeBlock, - EuiCallOut, EuiText } from '@elastic/eui'; -import { formatTimestampToDuration } from '../../../../../common'; -import { CALCULATE_DURATION_SINCE } from '../../../../../common/constants'; import { Monospace } from '../components/monospace'; import { FormattedMessage } from '@kbn/i18n/react'; -import { statusTitle, UNDETECTED_BEAT_TYPE } from './common_beats_instructions'; +import { UNDETECTED_BEAT_TYPE } from './common_beats_instructions'; +import { getDisableStatusStep } from '../common_instructions'; export function getBeatsInstructionsForDisablingInternalCollection(product, meta) { const beatType = product.beatType; @@ -65,81 +63,7 @@ export function getBeatsInstructionsForDisablingInternalCollection(product, meta ) }; - let migrationStatusStep = null; - if (!product || !product.isFullyMigrated) { - let lastInternallyCollectedMessage = ''; - // It is possible that, during the migration steps, products are not reporting - // monitoring data for a period of time outside the window of our server-side check - // and this is most likely temporary so we want to be defensive and not error out - // and hopefully wait for the next check and this state will be self-corrected. - if (product) { - const lastInternallyCollectedTimestamp = product.lastInternallyCollectedTimestamp || product.lastTimestamp; - const secondsSinceLastInternalCollectionLabel = - formatTimestampToDuration(lastInternallyCollectedTimestamp, CALCULATE_DURATION_SINCE); - lastInternallyCollectedMessage = (); - } - - migrationStatusStep = { - title: statusTitle, - status: 'incomplete', - children: ( - -

- -

-

- {lastInternallyCollectedMessage} -

-
- ) - }; - } - else { - migrationStatusStep = { - title: statusTitle, - status: 'complete', - children: ( - -

- -

-
- ) - }; - } + const migrationStatusStep = getDisableStatusStep(product, meta); return [ disableInternalCollectionStep, diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/enable_metricbeat_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/enable_metricbeat_instructions.js index 8d167379615d5..37dbed2ed7247 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/enable_metricbeat_instructions.js +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/enable_metricbeat_instructions.js @@ -14,46 +14,18 @@ import { } from '@elastic/eui'; import { Monospace } from '../components/monospace'; import { FormattedMessage } from '@kbn/i18n/react'; -import { statusTitle, UNDETECTED_BEAT_TYPE, DEFAULT_BEAT_FOR_URLS } from './common_beats_instructions'; +import { UNDETECTED_BEAT_TYPE, DEFAULT_BEAT_FOR_URLS } from './common_beats_instructions'; import { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } from 'ui/documentation_links'; +import { getMigrationStatusStep, getSecurityStep } from '../common_instructions'; export function getBeatsInstructionsForEnablingMetricbeat(product, _meta, { esMonitoringUrl, }) { const beatType = product.beatType; - const securitySetup = ( - - - - - {` `} - - - - - ) - }} - /> - - )} - /> - + const securitySetup = getSecurityStep( + `${ELASTIC_WEBSITE_URL}guide/en/beats/reference/${DOC_LINK_VERSION}/configuring-metricbeat.html` ); + const installMetricbeatStep = { title: i18n.translate('xpack.monitoring.metricbeatMigration.beatsInstructions.installMetricbeatTitle', { defaultMessage: 'Install Metricbeat on the same server as this {beatType}', @@ -205,48 +177,7 @@ export function getBeatsInstructionsForEnablingMetricbeat(product, _meta, { ) }; - let migrationStatusStep = null; - if (product.isInternalCollector || product.isNetNewUser) { - migrationStatusStep = { - title: statusTitle, - status: 'incomplete', - children: ( - - ) - }; - } - else if (product.isPartiallyMigrated || product.isFullyMigrated) { - migrationStatusStep = { - title: statusTitle, - status: 'complete', - children: ( - -

- -

-
- ) - }; - } + const migrationStatusStep = getMigrationStatusStep(product); return [ installMetricbeatStep, diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/common_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/common_instructions.js new file mode 100644 index 0000000000000..f172f2c2b4691 --- /dev/null +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/common_instructions.js @@ -0,0 +1,177 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +import React, { Fragment } from 'react'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n/react'; +import { + EuiCallOut, + EuiSpacer, + EuiText, + EuiLink +} from '@elastic/eui'; +import { CALCULATE_DURATION_SINCE } from '../../../../common/constants'; +import { formatTimestampToDuration } from '../../../../common'; + +export const MIGRATION_STATUS_LABEL = i18n.translate('xpack.monitoring.metricbeatMigration.migrationStatus', { + defaultMessage: `Migration status` +}); + +export const MONITORING_STATUS_LABEL = i18n.translate('xpack.monitoring.metricbeatMigration.monitoringStatus', { + defaultMessage: `Monitoring status` +}); + +export function getSecurityStep(url) { + return ( + + + + + {` `} + + + + + ) + }} + /> + + )} + /> + + ); +} + +export function getMigrationStatusStep(product) { + if (product.isInternalCollector || product.isNetNewUser) { + return { + title: product.isNetNewUser ? MONITORING_STATUS_LABEL : MIGRATION_STATUS_LABEL, + status: 'incomplete', + children: ( + + ) + }; + } + else if (product.isPartiallyMigrated || product.isFullyMigrated) { + return { + title: MIGRATION_STATUS_LABEL, + status: 'complete', + children: ( + +

+ {i18n.translate('xpack.monitoring.metricbeatMigration.fullyMigratedStatusDescription', { + defaultMessage: 'Metricbeat is shipping monitoring data.' + })} +

+
+ ) + }; + } + + return null; +} + +export function getDisableStatusStep(product, meta) { + if (!product || !product.isFullyMigrated) { + let lastInternallyCollectedMessage = ''; + // It is possible that, during the migration steps, products are not reporting + // monitoring data for a period of time outside the window of our server-side check + // and this is most likely temporary so we want to be defensive and not error out + // and hopefully wait for the next check and this state will be self-corrected. + if (product) { + const lastInternallyCollectedTimestamp = product.lastInternallyCollectedTimestamp || product.lastTimestamp; + const secondsSinceLastInternalCollectionLabel = + formatTimestampToDuration(lastInternallyCollectedTimestamp, CALCULATE_DURATION_SINCE); + lastInternallyCollectedMessage = i18n.translate( + 'xpack.monitoring.metricbeatMigration.disableInternalCollection.partiallyMigratedStatusDescription', + { + defaultMessage: 'Last internal collection occurred {secondsSinceLastInternalCollectionLabel} ago.', + values: { + secondsSinceLastInternalCollectionLabel + } + } + ); + } + + return { + title: MIGRATION_STATUS_LABEL, + status: 'incomplete', + children: ( + +

+ {i18n.translate('xpack.monitoring.metricbeatMigration.partiallyMigratedStatusDescription', { + defaultMessage: `Note that it can take up to {secondsAgo} seconds to detect, + but we will continuously check in the background.`, + values: { + secondsAgo: meta.secondsAgo + } + })} +

+

+ {lastInternallyCollectedMessage} +

+
+ ) + }; + } + + return { + title: MIGRATION_STATUS_LABEL, + status: 'complete', + children: ( + +

+ {i18n.translate('xpack.monitoring.metricbeatMigration.disableInternalCollection.fullyMigratedStatusDescription', { + defaultMessage: 'We are not seeing any documents from internal collection. Migration complete!' + })} +

+
+ ) + }; +} diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/elasticsearch/common_elasticsearch_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/elasticsearch/common_elasticsearch_instructions.js deleted file mode 100644 index 3c55fef3ab7f3..0000000000000 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/elasticsearch/common_elasticsearch_instructions.js +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ -import { i18n } from '@kbn/i18n'; - -export const statusTitle = i18n.translate('xpack.monitoring.metricbeatMigration.elasticsearchInstructions.statusTitle', { - defaultMessage: `Migration status` -}); - -export const statusTitleNewUser = i18n.translate('xpack.monitoring.metricbeatMigration.elasticsearchInstructions.statusTitleNewUser', { - defaultMessage: `Monitoring status` -}); diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/elasticsearch/disable_internal_collection_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/elasticsearch/disable_internal_collection_instructions.js index d09f134b1d299..eb3da8de73e6a 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/elasticsearch/disable_internal_collection_instructions.js +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/elasticsearch/disable_internal_collection_instructions.js @@ -8,14 +8,11 @@ import React, { Fragment } from 'react'; import { EuiSpacer, EuiCodeBlock, - EuiCallOut, EuiText } from '@elastic/eui'; -import { formatTimestampToDuration } from '../../../../../common'; -import { CALCULATE_DURATION_SINCE } from '../../../../../common/constants'; import { Monospace } from '../components/monospace'; import { FormattedMessage } from '@kbn/i18n/react'; -import { statusTitle } from './common_elasticsearch_instructions'; +import { getDisableStatusStep } from '../common_instructions'; export function getElasticsearchInstructionsForDisablingInternalCollection(product, meta) { const disableInternalCollectionStep = { @@ -55,81 +52,7 @@ export function getElasticsearchInstructionsForDisablingInternalCollection(produ ) }; - let migrationStatusStep = null; - if (!product || !product.isFullyMigrated) { - let lastInternallyCollectedMessage = ''; - // It is possible that, during the migration steps, products are not reporting - // monitoring data for a period of time outside the window of our server-side check - // and this is most likely temporary so we want to be defensive and not error out - // and hopefully wait for the next check and this state will be self-corrected. - if (product) { - const lastInternallyCollectedTimestamp = product.lastInternallyCollectedTimestamp || product.lastTimestamp; - const secondsSinceLastInternalCollectionLabel = - formatTimestampToDuration(lastInternallyCollectedTimestamp, CALCULATE_DURATION_SINCE); - lastInternallyCollectedMessage = (); - } - - migrationStatusStep = { - title: statusTitle, - status: 'incomplete', - children: ( - -

- -

-

- {lastInternallyCollectedMessage} -

-
- ) - }; - } - else { - migrationStatusStep = { - title: statusTitle, - status: 'complete', - children: ( - -

- -

-
- ) - }; - } + const migrationStatusStep = getDisableStatusStep(product, meta); return [ disableInternalCollectionStep, diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/elasticsearch/enable_metricbeat_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/elasticsearch/enable_metricbeat_instructions.js index e4c1b7cdcbc84..01e39e079b3c3 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/elasticsearch/enable_metricbeat_instructions.js +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/elasticsearch/enable_metricbeat_instructions.js @@ -9,49 +9,18 @@ import { EuiSpacer, EuiCodeBlock, EuiLink, - EuiCallOut, EuiText } from '@elastic/eui'; import { Monospace } from '../components/monospace'; import { FormattedMessage } from '@kbn/i18n/react'; -import { statusTitle, statusTitleNewUser } from './common_elasticsearch_instructions'; import { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } from 'ui/documentation_links'; +import { getSecurityStep, getMigrationStatusStep } from '../common_instructions'; export function getElasticsearchInstructionsForEnablingMetricbeat(product, _meta, { esMonitoringUrl, }) { - const securitySetup = ( - - - - - {` `} - - - - - ) - }} - /> - - )} - /> - + const securitySetup = getSecurityStep( + `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/reference/${DOC_LINK_VERSION}/configuring-metricbeat.html` ); const installMetricbeatStep = { @@ -176,47 +145,7 @@ export function getElasticsearchInstructionsForEnablingMetricbeat(product, _meta ) }; - let migrationStatusStep = null; - if (product.isInternalCollector || product.isNetNewUser) { - migrationStatusStep = { - title: product.isNetNewUser ? statusTitleNewUser : statusTitle, - status: 'incomplete', - children: ( - - ) - }; - } - else if (product.isPartiallyMigrated || product.isFullyMigrated) { - migrationStatusStep = { - title: statusTitle, - status: 'complete', - children: ( - -

- -

-
- ) - }; - } + const migrationStatusStep = getMigrationStatusStep(product); return [ installMetricbeatStep, diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/get_instruction_steps.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/get_instruction_steps.js index 7075be3def9bb..933e95a6c2e7a 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/get_instruction_steps.js +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/get_instruction_steps.js @@ -21,15 +21,20 @@ import { getBeatsInstructionsForDisablingInternalCollection, } from './beats'; import { - getApmInstructionsForEnablingMetricbeat, getApmInstructionsForDisablingInternalCollection, + getApmInstructionsForEnablingMetricbeat, } from './apm'; import { INSTRUCTION_STEP_ENABLE_METRICBEAT, INSTRUCTION_STEP_DISABLE_INTERNAL } from '../constants'; -import { ELASTICSEARCH_CUSTOM_ID, APM_CUSTOM_ID } from '../../../../common/constants'; -import { KIBANA_SYSTEM_ID, LOGSTASH_SYSTEM_ID, BEATS_SYSTEM_ID } from '../../../../../telemetry/common/constants'; +import { + ELASTICSEARCH_SYSTEM_ID, + APM_SYSTEM_ID, + KIBANA_SYSTEM_ID, + LOGSTASH_SYSTEM_ID, + BEATS_SYSTEM_ID +} from '../../../../common/constants'; export function getInstructionSteps(productName, product, step, meta, opts) { switch (productName) { @@ -40,7 +45,7 @@ export function getInstructionSteps(productName, product, step, meta, opts) { if (step === INSTRUCTION_STEP_DISABLE_INTERNAL) { return getKibanaInstructionsForDisablingInternalCollection(product, meta, opts); } - case ELASTICSEARCH_CUSTOM_ID: + case ELASTICSEARCH_SYSTEM_ID: if (step === INSTRUCTION_STEP_ENABLE_METRICBEAT) { return getElasticsearchInstructionsForEnablingMetricbeat(product, meta, opts); } @@ -61,7 +66,7 @@ export function getInstructionSteps(productName, product, step, meta, opts) { if (step === INSTRUCTION_STEP_DISABLE_INTERNAL) { return getBeatsInstructionsForDisablingInternalCollection(product, meta, opts); } - case APM_CUSTOM_ID: + case APM_SYSTEM_ID: if (step === INSTRUCTION_STEP_ENABLE_METRICBEAT) { return getApmInstructionsForEnablingMetricbeat(product, meta, opts); } diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/common_kibana_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/common_kibana_instructions.js deleted file mode 100644 index 25b869e32b9b7..0000000000000 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/common_kibana_instructions.js +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ -import { i18n } from '@kbn/i18n'; - -export const statusTitle = i18n.translate('xpack.monitoring.metricbeatMigration.kibanaInstructions.statusTitle', { - defaultMessage: `Migration status` -}); - -export const statusTitleNewUser = i18n.translate('xpack.monitoring.metricbeatMigration.kibanaInstructions.statusTitleNewUser', { - defaultMessage: `Monitoring status` -}); diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/disable_internal_collection_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/disable_internal_collection_instructions.js index f0a0c1de51653..264d8b0cd77da 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/disable_internal_collection_instructions.js +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/disable_internal_collection_instructions.js @@ -11,11 +11,9 @@ import { EuiCallOut, EuiText } from '@elastic/eui'; -import { formatTimestampToDuration } from '../../../../../common'; -import { CALCULATE_DURATION_SINCE } from '../../../../../common/constants'; import { Monospace } from '../components/monospace'; import { FormattedMessage } from '@kbn/i18n/react'; -import { statusTitle } from './common_kibana_instructions'; +import { getDisableStatusStep } from '../common_instructions'; export function getKibanaInstructionsForDisablingInternalCollection(product, meta) { let restartWarning = null; @@ -94,80 +92,7 @@ export function getKibanaInstructionsForDisablingInternalCollection(product, met ) }; - let migrationStatusStep = null; - if (!product || !product.isFullyMigrated) { - let lastInternallyCollectedMessage = ''; - // It is possible that, during the migration steps, products are not reporting - // monitoring data for a period of time outside the window of our server-side check - // and this is most likely temporary so we want to be defensive and not error out - // and hopefully wait for the next check and this state will be self-corrected. - if (product) { - const lastInternallyCollectedTimestamp = product.lastInternallyCollectedTimestamp || product.lastTimestamp; - const secondsSinceLastInternalCollectionLabel = - formatTimestampToDuration(lastInternallyCollectedTimestamp, CALCULATE_DURATION_SINCE); - lastInternallyCollectedMessage = (); - } - - migrationStatusStep = { - title: statusTitle, - status: 'incomplete', - children: ( - -

- -

-

- {lastInternallyCollectedMessage} -

-
- ) - }; - } - else { - migrationStatusStep = { - title: statusTitle, - status: 'complete', - children: ( - -

- -

-
- ) - }; - } + const migrationStatusStep = getDisableStatusStep(product, meta); return [ disableInternalCollectionStep, diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/enable_metricbeat_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/enable_metricbeat_instructions.js index 1cd8fdea25151..d2bb32a752875 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/enable_metricbeat_instructions.js +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/enable_metricbeat_instructions.js @@ -9,50 +9,20 @@ import { EuiSpacer, EuiCodeBlock, EuiLink, - EuiCallOut, EuiText } from '@elastic/eui'; import { Monospace } from '../components/monospace'; import { FormattedMessage } from '@kbn/i18n/react'; -import { statusTitle, statusTitleNewUser } from './common_kibana_instructions'; import { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } from 'ui/documentation_links'; +import { getMigrationStatusStep, getSecurityStep } from '../common_instructions'; export function getKibanaInstructionsForEnablingMetricbeat(product, _meta, { esMonitoringUrl, }) { - const securitySetup = ( - - - - - {` `} - - - - - ) - }} - /> - - )} - /> - + const securitySetup = getSecurityStep( + `${ELASTIC_WEBSITE_URL}guide/en/kibana/reference/${DOC_LINK_VERSION}/configuring-metricbeat.html` ); + const installMetricbeatStep = { title: i18n.translate('xpack.monitoring.metricbeatMigration.kibanaInstructions.installMetricbeatTitle', { defaultMessage: 'Install Metricbeat on the same server as Kibana' @@ -165,48 +135,7 @@ export function getKibanaInstructionsForEnablingMetricbeat(product, _meta, { ) }; - let migrationStatusStep = null; - if (product.isInternalCollector || product.isNetNewUser) { - migrationStatusStep = { - title: product.isNetNewUser ? statusTitleNewUser : statusTitle, - status: 'incomplete', - children: ( - - ) - }; - } - else if (product.isPartiallyMigrated || product.isFullyMigrated) { - migrationStatusStep = { - title: statusTitle, - status: 'complete', - children: ( - -

- -

-
- ) - }; - } + const migrationStatusStep = getMigrationStatusStep(product); return [ installMetricbeatStep, diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/common_logstash_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/common_logstash_instructions.js deleted file mode 100644 index 642add4d43fc4..0000000000000 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/common_logstash_instructions.js +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ -import { i18n } from '@kbn/i18n'; - -export const statusTitle = i18n.translate('xpack.monitoring.metricbeatMigration.logstashInstructions.statusTitle', { - defaultMessage: `Migration status` -}); diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/disable_internal_collection_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/disable_internal_collection_instructions.js index 7c7a91eb7e536..4e94606b01f8d 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/disable_internal_collection_instructions.js +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/disable_internal_collection_instructions.js @@ -8,14 +8,11 @@ import React, { Fragment } from 'react'; import { EuiSpacer, EuiCodeBlock, - EuiCallOut, EuiText } from '@elastic/eui'; -import { formatTimestampToDuration } from '../../../../../common'; -import { CALCULATE_DURATION_SINCE } from '../../../../../common/constants'; import { Monospace } from '../components/monospace'; import { FormattedMessage } from '@kbn/i18n/react'; -import { statusTitle } from './common_logstash_instructions'; +import { getDisableStatusStep } from '../common_instructions'; export function getLogstashInstructionsForDisablingInternalCollection(product, meta) { const disableInternalCollectionStep = { @@ -57,81 +54,7 @@ export function getLogstashInstructionsForDisablingInternalCollection(product, m ) }; - let migrationStatusStep = null; - if (!product || !product.isFullyMigrated) { - let lastInternallyCollectedMessage = ''; - // It is possible that, during the migration steps, products are not reporting - // monitoring data for a period of time outside the window of our server-side check - // and this is most likely temporary so we want to be defensive and not error out - // and hopefully wait for the next check and this state will be self-corrected. - if (product) { - const lastInternallyCollectedTimestamp = product.lastInternallyCollectedTimestamp || product.lastTimestamp; - const secondsSinceLastInternalCollectionLabel = - formatTimestampToDuration(lastInternallyCollectedTimestamp, CALCULATE_DURATION_SINCE); - lastInternallyCollectedMessage = (); - } - - migrationStatusStep = { - title: statusTitle, - status: 'incomplete', - children: ( - -

- -

-

- {lastInternallyCollectedMessage} -

-
- ) - }; - } - else { - migrationStatusStep = { - title: statusTitle, - status: 'complete', - children: ( - -

- -

-
- ) - }; - } + const migrationStatusStep = getDisableStatusStep(product, meta); return [ disableInternalCollectionStep, diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/enable_metricbeat_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/enable_metricbeat_instructions.js index 71300163ce6d2..39ee20acf3b1d 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/enable_metricbeat_instructions.js +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/enable_metricbeat_instructions.js @@ -9,50 +9,20 @@ import { EuiSpacer, EuiCodeBlock, EuiLink, - EuiCallOut, EuiText } from '@elastic/eui'; import { Monospace } from '../components/monospace'; import { FormattedMessage } from '@kbn/i18n/react'; -import { statusTitle } from './common_logstash_instructions'; import { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } from 'ui/documentation_links'; +import { getMigrationStatusStep, getSecurityStep } from '../common_instructions'; export function getLogstashInstructionsForEnablingMetricbeat(product, _meta, { esMonitoringUrl, }) { - const securitySetup = ( - - - - - {` `} - - - - - ) - }} - /> - - )} - /> - + const securitySetup = getSecurityStep( + `${ELASTIC_WEBSITE_URL}guide/en/logstash/reference/${DOC_LINK_VERSION}/configuring-metricbeat.html` ); + const installMetricbeatStep = { title: i18n.translate('xpack.monitoring.metricbeatMigration.logstashInstructions.installMetricbeatTitle', { defaultMessage: 'Install Metricbeat on the same server as Logstash' @@ -165,48 +135,7 @@ export function getLogstashInstructionsForEnablingMetricbeat(product, _meta, { ) }; - let migrationStatusStep = null; - if (product.isInternalCollector || product.isNetNewUser) { - migrationStatusStep = { - title: statusTitle, - status: 'incomplete', - children: ( - - ) - }; - } - else if (product.isPartiallyMigrated || product.isFullyMigrated) { - migrationStatusStep = { - title: statusTitle, - status: 'complete', - children: ( - -

- -

-
- ) - }; - } + const migrationStatusStep = getMigrationStatusStep(product); return [ installMetricbeatStep, diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.js index d9449b0678df9..36ed044b94493 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.js +++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.js @@ -11,7 +11,7 @@ import { EuiIcon } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { ELASTICSEARCH_CUSTOM_ID } from '../../../common/constants'; +import { ELASTICSEARCH_SYSTEM_ID } from '../../../common/constants'; const clickToMonitorWithMetricbeat = i18n.translate('xpack.monitoring.setupMode.clickToMonitorWithMetricbeat', { defaultMessage: 'Click to monitor with Metricbeat' @@ -23,7 +23,7 @@ export function SetupModeBadge({ setupMode, productName, status, instance }) { // Migrating from partially to fully for Elasticsearch involves changing a cluster // setting which impacts all nodes in the cluster, which we have a separate callout // for. Since it does not make sense to do this on a per node basis, show nothing here - const explicitlyAvoidLink = status.isPartiallyMigrated && productName === ELASTICSEARCH_CUSTOM_ID; + const explicitlyAvoidLink = status.isPartiallyMigrated && productName === ELASTICSEARCH_SYSTEM_ID; if (!explicitlyAvoidLink && (status.isInternalCollector || status.isPartiallyMigrated || status.isNetNewUser)) { useLink = true; } @@ -64,7 +64,7 @@ export function SetupModeBadge({ setupMode, productName, status, instance }) {   - + {i18n.translate('xpack.monitoring.setupMode.usingMetricbeatCollection', { defaultMessage: 'Monitored with Metricbeat' })} diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/common_text.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/common_text.js deleted file mode 100644 index 88926ab67c49a..0000000000000 --- a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/common_text.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ -import { i18n } from '@kbn/i18n'; - -export const NODE_IDENTIFIER_SINGULAR = i18n.translate('xpack.monitoring.setupMode.node', { - defaultMessage: `node`, -}); -export const NODE_IDENTIFIER_PLURAL = i18n.translate('xpack.monitoring.setupMode.nodes', { - defaultMessage: `nodes`, -}); -export const INSTANCE_IDENTIFIER_SINGULAR = i18n.translate('xpack.monitoring.setupMode.instance', { - defaultMessage: `instance`, -}); -export const INSTANCE_IDENTIFIER_PLURAL = i18n.translate('xpack.monitoring.setupMode.instances', { - defaultMessage: `instances`, -}); diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/formatting.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/formatting.js new file mode 100644 index 0000000000000..d88608bbb1afe --- /dev/null +++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/formatting.js @@ -0,0 +1,56 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +import { capitalize } from 'lodash'; +import { i18n } from '@kbn/i18n'; +import { + APM_SYSTEM_ID, + LOGSTASH_SYSTEM_ID, + ELASTICSEARCH_SYSTEM_ID, + KIBANA_SYSTEM_ID, + BEATS_SYSTEM_ID +} from '../../../common/constants'; + +const NODE_IDENTIFIER_SINGULAR = i18n.translate('xpack.monitoring.setupMode.node', { + defaultMessage: `node`, +}); +const NODE_IDENTIFIER_PLURAL = i18n.translate('xpack.monitoring.setupMode.nodes', { + defaultMessage: `nodes`, +}); +const INSTANCE_IDENTIFIER_SINGULAR = i18n.translate('xpack.monitoring.setupMode.instance', { + defaultMessage: `instance`, +}); +const INSTANCE_IDENTIFIER_PLURAL = i18n.translate('xpack.monitoring.setupMode.instances', { + defaultMessage: `instances`, +}); +const SERVER_IDENTIFIER_SINGULAR = i18n.translate('xpack.monitoring.setupMode.server', { + defaultMessage: `server`, +}); +const SERVER_IDENTIFIER_PLURAL = i18n.translate('xpack.monitoring.setupMode.servers', { + defaultMessage: `servers`, +}); + + +export function formatProductName(productName) { + if (productName === APM_SYSTEM_ID) { + return productName.toUpperCase(); + } + return capitalize(productName); +} + +const PRODUCTS_THAT_USE_NODES = [LOGSTASH_SYSTEM_ID, ELASTICSEARCH_SYSTEM_ID]; +const PRODUCTS_THAT_USE_INSTANCES = [KIBANA_SYSTEM_ID, BEATS_SYSTEM_ID]; +export function getIdentifier(productName, usePlural = false) { + if (PRODUCTS_THAT_USE_INSTANCES.includes(productName)) { + return usePlural ? INSTANCE_IDENTIFIER_PLURAL : INSTANCE_IDENTIFIER_SINGULAR; + } + if (PRODUCTS_THAT_USE_NODES.includes(productName)) { + return usePlural ? NODE_IDENTIFIER_PLURAL : NODE_IDENTIFIER_SINGULAR; + } + if (productName === APM_SYSTEM_ID) { + return usePlural ? SERVER_IDENTIFIER_PLURAL : SERVER_IDENTIFIER_SINGULAR; + } + return productName; +} diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js index 060885d4102dc..c4e86c1da03d3 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js +++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js @@ -5,20 +5,15 @@ */ import React, { Fragment } from 'react'; -import { capitalize, get } from 'lodash'; +import { get } from 'lodash'; import { EuiCallOut, EuiSpacer, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { - NODE_IDENTIFIER_PLURAL, - INSTANCE_IDENTIFIER_PLURAL, - NODE_IDENTIFIER_SINGULAR, - INSTANCE_IDENTIFIER_SINGULAR -} from './common_text'; +import { formatProductName, getIdentifier } from './formatting'; -export function ListingCallOut({ setupModeData, productName, useNodeIdentifier = false, customRenderer = null }) { +export function ListingCallOut({ setupModeData, productName, customRenderer = null }) { if (customRenderer) { const { shouldRender, componentToRender } = customRenderer(); if (shouldRender) { @@ -37,8 +32,8 @@ export function ListingCallOut({ setupModeData, productName, useNodeIdentifier = title={i18n.translate('xpack.monitoring.setupMode.detectedNodeTitle', { defaultMessage: '{product} {identifier} detected', values: { - product: capitalize(productName), - identifier: useNodeIdentifier ? NODE_IDENTIFIER_SINGULAR : INSTANCE_IDENTIFIER_SINGULAR + product: formatProductName(productName), + identifier: getIdentifier(productName) } })} color="warning" @@ -49,8 +44,8 @@ export function ListingCallOut({ setupModeData, productName, useNodeIdentifier = defaultMessage: `Based on your indices, we think you might have a {product} {identifier}. Click 'Set up monitoring' below to start monitoring this {identifier}.`, values: { - product: capitalize(productName), - identifier: useNodeIdentifier ? NODE_IDENTIFIER_SINGULAR : INSTANCE_IDENTIFIER_SINGULAR + product: formatProductName(productName), + identifier: getIdentifier(productName) } })}

@@ -63,17 +58,20 @@ export function ListingCallOut({ setupModeData, productName, useNodeIdentifier =

{i18n.translate('xpack.monitoring.setupMode.netNewUserDescription', { - defaultMessage: `But we did find the following {product} {identifier} that require monitoring setup.`, + defaultMessage: `If you have {product} {identifier}, click 'Set up monitoring' below to monitor with Metricbeat.`, values: { - product: capitalize(productName), - identifier: useNodeIdentifier ? NODE_IDENTIFIER_PLURAL : INSTANCE_IDENTIFIER_PLURAL + product: formatProductName(productName), + identifier: getIdentifier(productName, true) } })}

@@ -88,9 +86,9 @@ export function ListingCallOut({ setupModeData, productName, useNodeIdentifier = @@ -142,8 +140,8 @@ export function ListingCallOut({ setupModeData, productName, useNodeIdentifier = {i18n.translate('xpack.monitoring.setupMode.disableInternalCollectionDescription', { defaultMessage: `These {product} {identifier} are monitored through internal collection. Migrate to monitor with Metricbeat.`, values: { - product: capitalize(productName), - identifier: useNodeIdentifier ? NODE_IDENTIFIER_PLURAL : INSTANCE_IDENTIFIER_PLURAL + product: formatProductName(productName), + identifier: getIdentifier(productName, true) } })}

diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js index c32dbfdef95c7..34e33be259c3c 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js +++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js @@ -13,9 +13,9 @@ import { EuiLink } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { NODE_IDENTIFIER_SINGULAR, INSTANCE_IDENTIFIER_SINGULAR, NODE_IDENTIFIER_PLURAL, INSTANCE_IDENTIFIER_PLURAL } from './common_text'; +import { getIdentifier } from './formatting'; -export function SetupModeTooltip({ setupModeData, badgeClickAction, useNodeIdentifier = false }) { +export function SetupModeTooltip({ setupModeData, badgeClickAction, productName }) { if (!setupModeData) { return null; } @@ -56,7 +56,7 @@ export function SetupModeTooltip({ setupModeData, badgeClickAction, useNodeIdent @@ -79,7 +79,7 @@ export function SetupModeTooltip({ setupModeData, badgeClickAction, useNodeIdent defaultMessage: `At least one {identifier} isn’t monitored using Metricbeat. Click this icon to get the status of each {identifier}.`, values: { - identifier: useNodeIdentifier ? NODE_IDENTIFIER_SINGULAR : INSTANCE_IDENTIFIER_SINGULAR + identifier: getIdentifier(productName) } })} > @@ -101,7 +101,7 @@ export function SetupModeTooltip({ setupModeData, badgeClickAction, useNodeIdent defaultMessage: `Metricbeat is monitoring all {identifierPlural}. Click this icon to go to the {identifierPlural} view and disable internal collection.`, values: { - identifierPlural: useNodeIdentifier ? NODE_IDENTIFIER_PLURAL : INSTANCE_IDENTIFIER_PLURAL + identifierPlural: getIdentifier(productName, true) } })} > @@ -122,7 +122,7 @@ export function SetupModeTooltip({ setupModeData, badgeClickAction, useNodeIdent content={i18n.translate('xpack.monitoring.setupMode.tooltip.allSet', { defaultMessage: `Metricbeat is monitoring all {identifierPlural}.`, values: { - identifierPlural: useNodeIdentifier ? NODE_IDENTIFIER_PLURAL : INSTANCE_IDENTIFIER_PLURAL + identifierPlural: getIdentifier(productName, true) } })} > diff --git a/x-pack/legacy/plugins/monitoring/public/components/table/eui_table.js b/x-pack/legacy/plugins/monitoring/public/components/table/eui_table.js index ef87f259d8378..53b16c29143bc 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/table/eui_table.js +++ b/x-pack/legacy/plugins/monitoring/public/components/table/eui_table.js @@ -11,7 +11,7 @@ import { EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { NODE_IDENTIFIER_SINGULAR, INSTANCE_IDENTIFIER_SINGULAR } from '../setup_mode/common_text'; +import { getIdentifier } from '../setup_mode/formatting'; export class EuiMonitoringTable extends React.PureComponent { render() { @@ -20,7 +20,7 @@ export class EuiMonitoringTable extends React.PureComponent { search = {}, columns: _columns, setupMode, - useNodeIdentifier, + productName, ...props } = this.props; @@ -45,151 +45,6 @@ export class EuiMonitoringTable extends React.PureComponent { let footerContent = null; if (setupMode && setupMode.enabled) { - // columns.push({ - // name: i18n.translate('xpack.monitoring.euiTable.setupStatusTitle', { - // defaultMessage: 'Set up Status' - // }), - // sortable: product => { - // const list = get(setupMode, 'data.byUuid', {}); - // const status = list[get(product, uuidField)] || {}; - - // if (status.isInternalCollector) { - // return 4; - // } - - // if (status.isPartiallyMigrated) { - // return 3; - // } - - // if (status.isFullyMigrated) { - // return 2; - // } - - // if (status.isNetNewUser) { - // return 1; - // } - - // return 0; - // }, - // render: (product) => { - // const list = get(setupMode, 'data.byUuid', {}); - // const status = list[get(product, uuidField)] || {}; - - // let statusBadge = null; - // if (status.isInternalCollector) { - // statusBadge = ( - // - // {i18n.translate('xpack.monitoring.euiTable.isInternalCollectorLabel', { - // defaultMessage: 'Internal collection' - // })} - // - // ); - // } - // else if (status.isPartiallyMigrated) { - // statusBadge = ( - // - // {i18n.translate('xpack.monitoring.euiTable.isPartiallyMigratedLabel', { - // defaultMessage: 'Internal collection and Metricbeat collection' - // })} - // - // ); - // } - // else if (status.isFullyMigrated) { - // statusBadge = ( - // - // {i18n.translate('xpack.monitoring.euiTable.isFullyMigratedLabel', { - // defaultMessage: 'Metricbeat collection' - // })} - // - // ); - // } - // else if (status.isNetNewUser) { - // statusBadge = ( - // - // {i18n.translate('xpack.monitoring.euiTable.isNetNewUserLabel', { - // defaultMessage: 'No monitoring detected' - // })} - // - // ); - // } - // else { - // statusBadge = i18n.translate('xpack.monitoring.euiTable.migrationStatusUnknown', { - // defaultMessage: 'N/A' - // }); - // } - - // return statusBadge; - // } - // }); - - // columns.push({ - // name: i18n.translate('xpack.monitoring.euiTable.setupActionTitle', { - // defaultMessage: 'Set up' - // }), - // sortable: product => { - // const list = get(setupMode, 'data.byUuid', {}); - // const status = list[get(product, uuidField)] || {}; - - // if (status.isInternalCollector || status.isNetNewUser) { - // return 1; - // } - - // if (status.isPartiallyMigrated) { - // if (setupMode.productName === ELASTICSEARCH_CUSTOM_ID) { - // // See comment for same conditional in render function - // return 0; - // } - // return 1; - // } - - // return 0; - // }, - // render: (product) => { - // const uuid = get(product, uuidField); - // const list = get(setupMode, 'data.byUuid', {}); - // const status = list[uuid] || {}; - // const instance = { - // uuid: get(product, uuidField), - // name: get(product, nameField), - // }; - - // // Migrating from partially to fully for Elasticsearch involves changing a cluster - // // setting which impacts all nodes in the cluster, which we have a separate callout - // // for. Since it does not make sense to do this on a per node basis, show nothing here - // if (status.isPartiallyMigrated && setupMode.productName === ELASTICSEARCH_CUSTOM_ID) { - // return null; - // } - - // if (status.isInternalCollector || status.isPartiallyMigrated) { - // return ( - // setupMode.openFlyout(instance)}> - // {i18n.translate('xpack.monitoring.euiTable.migrateButtonLabel', { - // defaultMessage: 'Migrate `{name}` to use Metricbeat', - // values: { - // name: product.name - // } - // })} - // - // ); - // } - - // if (status.isNetNewUser) { - // return ( - // setupMode.openFlyout(instance)}> - // {i18n.translate('xpack.monitoring.euiTable.setupButtonLabel', { - // defaultMessage: 'Set up `{name}` to use Metricbeat', - // values: { - // name: product.name - // } - // })} - // - // ); - // } - - // return null; - // } - // }); - footerContent = ( @@ -197,7 +52,7 @@ export class EuiMonitoringTable extends React.PureComponent { {i18n.translate('xpack.monitoring.euiTable.setupNewButtonLabel', { defaultMessage: 'Set up monitoring for new {identifier}', values: { - identifier: useNodeIdentifier ? NODE_IDENTIFIER_SINGULAR : INSTANCE_IDENTIFIER_SINGULAR + identifier: getIdentifier(productName) } })} diff --git a/x-pack/legacy/plugins/monitoring/public/views/apm/instances/index.js b/x-pack/legacy/plugins/monitoring/public/views/apm/instances/index.js index 03a69a008e096..35116924f5d5c 100644 --- a/x-pack/legacy/plugins/monitoring/public/views/apm/instances/index.js +++ b/x-pack/legacy/plugins/monitoring/public/views/apm/instances/index.js @@ -14,7 +14,7 @@ import { ApmServerInstances } from '../../../components/apm/instances'; import { MonitoringViewBaseEuiTableController } from '../..'; import { I18nContext } from 'ui/i18n'; import { SetupModeRenderer } from '../../../components/renderers'; -import { APM_CUSTOM_ID, CODE_PATH_APM } from '../../../../common/constants'; +import { APM_SYSTEM_ID, CODE_PATH_APM } from '../../../../common/constants'; uiRoutes.when('/apm/instances', { template, @@ -67,7 +67,7 @@ uiRoutes.when('/apm/instances', { ( {flyoutComponent} diff --git a/x-pack/legacy/plugins/monitoring/public/views/beats/listing/index.js b/x-pack/legacy/plugins/monitoring/public/views/beats/listing/index.js index e5a95c279a1bd..deb195df1d810 100644 --- a/x-pack/legacy/plugins/monitoring/public/views/beats/listing/index.js +++ b/x-pack/legacy/plugins/monitoring/public/views/beats/listing/index.js @@ -15,8 +15,7 @@ import React, { Fragment } from 'react'; import { I18nContext } from 'ui/i18n'; import { Listing } from '../../../components/beats/listing/listing'; import { SetupModeRenderer } from '../../../components/renderers'; -import { BEATS_SYSTEM_ID } from '../../../../../telemetry/common/constants'; -import { CODE_PATH_BEATS } from '../../../../common/constants'; +import { CODE_PATH_BEATS, BEATS_SYSTEM_ID } from '../../../../common/constants'; uiRoutes.when('/beats/beats', { template, diff --git a/x-pack/legacy/plugins/monitoring/public/views/elasticsearch/nodes/index.js b/x-pack/legacy/plugins/monitoring/public/views/elasticsearch/nodes/index.js index 1368cbfd8fee1..ce7e81a80e521 100644 --- a/x-pack/legacy/plugins/monitoring/public/views/elasticsearch/nodes/index.js +++ b/x-pack/legacy/plugins/monitoring/public/views/elasticsearch/nodes/index.js @@ -16,7 +16,7 @@ import { ElasticsearchNodes } from '../../../components'; import { I18nContext } from 'ui/i18n'; import { ajaxErrorHandlersProvider } from '../../../lib/ajax_error_handler'; import { SetupModeRenderer } from '../../../components/renderers'; -import { ELASTICSEARCH_CUSTOM_ID, CODE_PATH_ELASTICSEARCH } from '../../../../common/constants'; +import { ELASTICSEARCH_SYSTEM_ID, CODE_PATH_ELASTICSEARCH } from '../../../../common/constants'; uiRoutes.when('/elasticsearch/nodes', { template, @@ -83,7 +83,7 @@ uiRoutes.when('/elasticsearch/nodes', { ( {flyoutComponent} diff --git a/x-pack/legacy/plugins/monitoring/public/views/kibana/instances/index.js b/x-pack/legacy/plugins/monitoring/public/views/kibana/instances/index.js index 182a4064d0b20..f5f2f5a5a76df 100644 --- a/x-pack/legacy/plugins/monitoring/public/views/kibana/instances/index.js +++ b/x-pack/legacy/plugins/monitoring/public/views/kibana/instances/index.js @@ -13,8 +13,7 @@ import template from './index.html'; import { KibanaInstances } from 'plugins/monitoring/components/kibana/instances'; import { SetupModeRenderer } from '../../../components/renderers'; import { I18nContext } from 'ui/i18n'; -import { KIBANA_SYSTEM_ID } from '../../../../../telemetry/common/constants'; -import { CODE_PATH_KIBANA } from '../../../../common/constants'; +import { KIBANA_SYSTEM_ID, CODE_PATH_KIBANA } from '../../../../common/constants'; uiRoutes.when('/kibana/instances', { template, diff --git a/x-pack/legacy/plugins/monitoring/public/views/logstash/nodes/index.js b/x-pack/legacy/plugins/monitoring/public/views/logstash/nodes/index.js index 0c65c82a47f05..1f4b37b77ad64 100644 --- a/x-pack/legacy/plugins/monitoring/public/views/logstash/nodes/index.js +++ b/x-pack/legacy/plugins/monitoring/public/views/logstash/nodes/index.js @@ -12,8 +12,7 @@ import template from './index.html'; import { I18nContext } from 'ui/i18n'; import { Listing } from '../../../components/logstash/listing'; import { SetupModeRenderer } from '../../../components/renderers'; -import { LOGSTASH_SYSTEM_ID } from '../../../../../telemetry/common/constants'; -import { CODE_PATH_LOGSTASH } from '../../../../common/constants'; +import { CODE_PATH_LOGSTASH, LOGSTASH_SYSTEM_ID } from '../../../../common/constants'; uiRoutes.when('/logstash/nodes', { template, diff --git a/x-pack/legacy/plugins/monitoring/server/lib/setup/collection/get_collection_status.js b/x-pack/legacy/plugins/monitoring/server/lib/setup/collection/get_collection_status.js index f67c0db5bd3df..8ac6b33dbdc3c 100644 --- a/x-pack/legacy/plugins/monitoring/server/lib/setup/collection/get_collection_status.js +++ b/x-pack/legacy/plugins/monitoring/server/lib/setup/collection/get_collection_status.js @@ -5,8 +5,14 @@ */ import { get, uniq } from 'lodash'; -import { METRICBEAT_INDEX_NAME_UNIQUE_TOKEN, ELASTICSEARCH_CUSTOM_ID, APM_CUSTOM_ID } from '../../../../common/constants'; -import { KIBANA_SYSTEM_ID, BEATS_SYSTEM_ID, LOGSTASH_SYSTEM_ID } from '../../../../../telemetry/common/constants'; +import { + METRICBEAT_INDEX_NAME_UNIQUE_TOKEN, + ELASTICSEARCH_SYSTEM_ID, + APM_SYSTEM_ID, + KIBANA_SYSTEM_ID, + BEATS_SYSTEM_ID, + LOGSTASH_SYSTEM_ID +} from '../../../../common/constants'; import { getLivesNodes } from '../../elasticsearch/nodes/get_nodes/get_live_nodes'; import { KIBANA_STATS_TYPE } from '../../../../../../../../src/legacy/server/status/constants'; @@ -144,13 +150,13 @@ async function detectProducts(req) { [KIBANA_SYSTEM_ID]: { doesExist: true, }, - [ELASTICSEARCH_CUSTOM_ID]: { + [ELASTICSEARCH_SYSTEM_ID]: { doesExist: true, }, [BEATS_SYSTEM_ID]: { mightExist: false, }, - [APM_CUSTOM_ID]: { + [APM_SYSTEM_ID]: { mightExist: false, }, [LOGSTASH_SYSTEM_ID]: { @@ -174,7 +180,7 @@ async function detectProducts(req) { ] }, { - id: APM_CUSTOM_ID, + id: APM_SYSTEM_ID, indices: [ 'apm-*' ] @@ -194,12 +200,12 @@ async function detectProducts(req) { function getUuidBucketName(productName) { switch (productName) { - case ELASTICSEARCH_CUSTOM_ID: + case ELASTICSEARCH_SYSTEM_ID: return 'es_uuids'; case KIBANA_SYSTEM_ID: return 'kibana_uuids'; case BEATS_SYSTEM_ID: - case APM_CUSTOM_ID: + case APM_SYSTEM_ID: return 'beats_uuids'; case LOGSTASH_SYSTEM_ID: return 'logstash_uuids'; @@ -232,7 +238,7 @@ function shouldSkipBucket(product, bucket) { if (product.name === BEATS_SYSTEM_ID && isBeatFromAPM(bucket)) { return true; } - if (product.name === APM_CUSTOM_ID && !isBeatFromAPM(bucket)) { + if (product.name === APM_SYSTEM_ID && !isBeatFromAPM(bucket)) { return true; } return false; @@ -313,8 +319,8 @@ export const getCollectionStatus = async (req, indexPatterns, clusterUuid, nodeU { name: KIBANA_SYSTEM_ID }, { name: BEATS_SYSTEM_ID }, { name: LOGSTASH_SYSTEM_ID }, - { name: APM_CUSTOM_ID, token: '-beats-' }, - { name: ELASTICSEARCH_CUSTOM_ID, token: '-es-' }, + { name: APM_SYSTEM_ID, token: '-beats-' }, + { name: ELASTICSEARCH_SYSTEM_ID, token: '-es-' }, ]; const [ @@ -348,7 +354,7 @@ export const getCollectionStatus = async (req, indexPatterns, clusterUuid, nodeU const internalCollectorsUuidsMap = {}; const partiallyMigratedUuidsMap = {}; - if (product.name === ELASTICSEARCH_CUSTOM_ID && liveEsNodes.length) { + if (product.name === ELASTICSEARCH_SYSTEM_ID && liveEsNodes.length) { productStatus.byUuid = liveEsNodes.reduce((accum, esNode) => ({ ...accum, [esNode.id]: { @@ -435,7 +441,7 @@ export const getCollectionStatus = async (req, indexPatterns, clusterUuid, nodeU } // If there are multiple buckets, they are partially upgraded assuming a single mb index exists else { - const considerAllInstancesMigrated = product.name === ELASTICSEARCH_CUSTOM_ID && + const considerAllInstancesMigrated = product.name === ELASTICSEARCH_SYSTEM_ID && clusterUuid === liveClusterUuid && !liveClusterInternalCollectionEnabled; const internalTimestamps = []; for (const indexBucket of indexBuckets) { From 2e7273490c9eb309dda3adfa382e1627146f16ad Mon Sep 17 00:00:00 2001 From: chrisronline Date: Mon, 9 Sep 2019 15:09:57 -0400 Subject: [PATCH 10/43] Fix tooltips --- .../public/components/cluster/overview/apm_panel.js | 4 ++-- .../public/components/cluster/overview/beats_panel.js | 3 ++- .../components/cluster/overview/elasticsearch_panel.js | 3 ++- .../public/components/cluster/overview/kibana_panel.js | 3 ++- .../public/components/cluster/overview/logstash_panel.js | 4 ++-- .../components/metricbeat_migration/flyout/flyout.js | 2 +- .../instruction_steps/common_instructions.js | 7 +++---- 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/apm_panel.js b/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/apm_panel.js index 0998475467ebb..aa53ecd21e6b4 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/apm_panel.js +++ b/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/apm_panel.js @@ -24,7 +24,7 @@ import { EuiFlexGroup, } from '@elastic/eui'; import { formatTimestampToDuration } from '../../../../common'; -import { CALCULATE_DURATION_SINCE } from '../../../../common/constants'; +import { CALCULATE_DURATION_SINCE, APM_SYSTEM_ID } from '../../../../common/constants'; import { SetupModeTooltip } from '../../setup_mode/tooltip'; export function ApmPanel(props) { @@ -43,8 +43,8 @@ export function ApmPanel(props) { ? ( ) : null; diff --git a/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/beats_panel.js b/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/beats_panel.js index 9b13570eb656f..935ee1f9cc100 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/beats_panel.js +++ b/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/beats_panel.js @@ -23,6 +23,7 @@ import { ClusterItemContainer, DisabledIfNoDataAndInSetupModeLink } from './help import { FormattedMessage } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; import { SetupModeTooltip } from '../../setup_mode/tooltip'; +import { BEATS_SYSTEM_ID } from '../../../../common/constants'; export function BeatsPanel(props) { const { setupMode } = props; @@ -40,7 +41,7 @@ export function BeatsPanel(props) { ? ( ) diff --git a/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/elasticsearch_panel.js b/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/elasticsearch_panel.js index 4e81e335a8f5b..9bf18adf50069 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/elasticsearch_panel.js +++ b/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/elasticsearch_panel.js @@ -33,6 +33,7 @@ import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; import { Reason } from '../../logs/reason'; import { SetupModeTooltip } from '../../setup_mode/tooltip'; +import { ELASTICSEARCH_SYSTEM_ID } from '../../../../common/constants'; const calculateShards = shards => { const total = get(shards, 'total', 0); @@ -165,7 +166,7 @@ export function ElasticsearchPanel(props) { ? ( ) diff --git a/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/kibana_panel.js b/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/kibana_panel.js index c998f3bd6c0bf..91ec34087817c 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/kibana_panel.js +++ b/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/kibana_panel.js @@ -23,6 +23,7 @@ import { import { FormattedMessage } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; import { SetupModeTooltip } from '../../setup_mode/tooltip'; +import { KIBANA_SYSTEM_ID } from '../../../../common/constants'; export function KibanaPanel(props) { const setupMode = props.setupMode; @@ -43,7 +44,7 @@ export function KibanaPanel(props) { ? ( ) diff --git a/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/logstash_panel.js b/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/logstash_panel.js index 89cafa09327cf..1033f178b7010 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/logstash_panel.js +++ b/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/logstash_panel.js @@ -7,7 +7,7 @@ import React from 'react'; import { formatNumber } from 'plugins/monitoring/lib/format_number'; import { ClusterItemContainer, BytesPercentageUsage, DisabledIfNoDataAndInSetupModeLink } from './helpers'; -import { LOGSTASH } from '../../../../common/constants'; +import { LOGSTASH, LOGSTASH_SYSTEM_ID } from '../../../../common/constants'; import { EuiFlexGrid, @@ -46,7 +46,7 @@ export function LogstashPanel(props) { ? ( ) diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/flyout/flyout.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/flyout/flyout.js index 88e11c176018f..933a482be36e5 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/flyout/flyout.js +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/flyout/flyout.js @@ -248,7 +248,7 @@ export class Flyout extends Component { const instanceName = (instance && instance.name) || formatProductName(productName); let title = i18n.translate('xpack.monitoring.metricbeatMigration.flyout.flyoutTitle', { - defaultMessage: 'Monitor {instanceIdentifier} `{instanceName}` with Metricbeat', + defaultMessage: 'Monitor `{instanceName}` {instanceIdentifier} with Metricbeat', values: { instanceName, instanceIdentifier diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/common_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/common_instructions.js index f172f2c2b4691..8821b7e02811a 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/common_instructions.js +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/common_instructions.js @@ -114,7 +114,7 @@ export function getDisableStatusStep(product, meta) { lastInternallyCollectedMessage = i18n.translate( 'xpack.monitoring.metricbeatMigration.disableInternalCollection.partiallyMigratedStatusDescription', { - defaultMessage: 'Last internal collection occurred {secondsSinceLastInternalCollectionLabel} ago.', + defaultMessage: 'Last internal collection was {secondsSinceLastInternalCollectionLabel} ago.', values: { secondsSinceLastInternalCollectionLabel } @@ -131,14 +131,13 @@ export function getDisableStatusStep(product, meta) { color="warning" title={i18n.translate('xpack.monitoring.metricbeatMigration.partiallyMigratedStatusTitle', { - defaultMessage: `We still see data coming from internal collection of Elasticsearch.` + defaultMessage: `Data is still coming from internal collection` } )} >

{i18n.translate('xpack.monitoring.metricbeatMigration.partiallyMigratedStatusDescription', { - defaultMessage: `Note that it can take up to {secondsAgo} seconds to detect, - but we will continuously check in the background.`, + defaultMessage: `It can take up to {secondsAgo} seconds to detect data, and we’ll continue checking.`, values: { secondsAgo: meta.secondsAgo } From da0e65832da894ce9ee053723357288a9f80094c Mon Sep 17 00:00:00 2001 From: chrisronline Date: Tue, 10 Sep 2019 11:30:52 -0400 Subject: [PATCH 11/43] Design/copy feedback --- .../components/elasticsearch/nodes/nodes.js | 7 +- .../public/components/no_data/no_data.js | 5 +- .../public/components/setup_mode/badge.js | 126 +++++++++--------- .../public/components/setup_mode/tooltip.js | 6 +- .../monitoring/public/lib/setup_mode.js | 31 ++--- .../public/views/no_data/controller.js | 3 +- 6 files changed, 86 insertions(+), 92 deletions(-) diff --git a/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js b/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js index b74bf66035e25..a80d0ff2ecc2a 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js +++ b/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js @@ -29,7 +29,7 @@ import { ELASTICSEARCH_SYSTEM_ID } from '../../../../common/constants'; import { ListingCallOut } from '../../setup_mode/listing_callout'; const getSortHandler = (type) => (item) => _.get(item, [type, 'summary', 'lastVal']); -const getColumns = (showCgroupMetricsElasticsearch, setupMode) => { +const getColumns = (showCgroupMetricsElasticsearch, setupMode, clusterUuid) => { const cols = []; const cpuUsageColumnTitle = i18n.translate('xpack.monitoring.elasticsearch.nodes.cpuUsageColumnTitle', { @@ -69,6 +69,7 @@ const getColumns = (showCgroupMetricsElasticsearch, setupMode) => { status={status} instance={instance} productName={ELASTICSEARCH_SYSTEM_ID} + clusterUuid={clusterUuid} /> ); @@ -243,7 +244,7 @@ const getColumns = (showCgroupMetricsElasticsearch, setupMode) => { export function ElasticsearchNodes({ clusterStatus, showCgroupMetricsElasticsearch, ...props }) { const { sorting, pagination, onTableChange, clusterUuid, setupMode } = props; - const columns = getColumns(showCgroupMetricsElasticsearch, setupMode); + const columns = getColumns(showCgroupMetricsElasticsearch, setupMode, clusterUuid); // Merge the nodes data with the setup data if enabled const nodes = props.nodes || []; @@ -302,7 +303,7 @@ export function ElasticsearchNodes({ clusterStatus, showCgroupMetricsElasticsear {i18n.translate( 'xpack.monitoring.elasticsearch.nodes.metricbeatMigration.disableInternalCollectionMigrationButtonLabel', { - defaultMessage: 'Disable and finish migration' + defaultMessage: 'Disable internal collection' } )} diff --git a/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js b/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js index 732b14fe6cd55..88a2a1a7859de 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js +++ b/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js @@ -144,5 +144,8 @@ export function NoData(props) { } NoData.propTypes = { - changePath: PropTypes.func.isRequired, + changePath: PropTypes.func, + isLoading: PropTypes.bool.isRequired, + reason: PropTypes.object, + checkMessage: PropTypes.string }; diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.js index 36ed044b94493..85bcac68bae58 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.js +++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.js @@ -6,102 +6,98 @@ import React, { Fragment } from 'react'; import { - EuiLink, EuiTextColor, - EuiIcon + EuiIcon, + EuiBadge } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { ELASTICSEARCH_SYSTEM_ID } from '../../../common/constants'; const clickToMonitorWithMetricbeat = i18n.translate('xpack.monitoring.setupMode.clickToMonitorWithMetricbeat', { - defaultMessage: 'Click to monitor with Metricbeat' + defaultMessage: 'Monitor with Metricbeat' }); -export function SetupModeBadge({ setupMode, productName, status, instance }) { - let useLink = false; +const clickToDisableInternalCollection = i18n.translate('xpack.monitoring.setupMode.clickToDisableInternalCollection', { + defaultMessage: 'Disable internal collection' +}); + +export function SetupModeBadge({ setupMode, productName, status, instance, clusterUuid }) { + let customAction = null; + let customText = null; + + const setupModeData = setupMode.data || {}; + const setupModeMeta = setupMode.meta || {}; // Migrating from partially to fully for Elasticsearch involves changing a cluster - // setting which impacts all nodes in the cluster, which we have a separate callout - // for. Since it does not make sense to do this on a per node basis, show nothing here - const explicitlyAvoidLink = status.isPartiallyMigrated && productName === ELASTICSEARCH_SYSTEM_ID; - if (!explicitlyAvoidLink && (status.isInternalCollector || status.isPartiallyMigrated || status.isNetNewUser)) { - useLink = true; + // setting which impacts all nodes in the cluster so the action text needs to reflect that + const allPartiallyMigrated = setupModeData.totalUniquePartiallyMigratedCount === setupModeData.totalUniqueInstanceCount; + + if (status.isPartiallyMigrated && productName === ELASTICSEARCH_SYSTEM_ID) { + if (allPartiallyMigrated) { + customText = clickToDisableInternalCollection; + if (setupModeMeta.liveClusterUuid === clusterUuid) { + customAction = setupMode.shortcutToFinishMigration; + } + } + else { + return ( + + +   + + {i18n.translate('xpack.monitoring.setupMode.monitorAllNodes', { + defaultMessage: 'Monitor all nodes with Metricbeat' + })} + + + ); + } + } + + const badgeProps = {}; + if (status.isInternalCollector || status.isPartiallyMigrated || status.isNetNewUser) { + badgeProps.onClick = customAction ? customAction : () => setupMode.openFlyout(instance); } + let statusText = null; if (status.isInternalCollector) { statusText = ( - - -   - - {clickToMonitorWithMetricbeat} - - + + {customText || clickToMonitorWithMetricbeat} + ); } else if (status.isPartiallyMigrated) { - const text = explicitlyAvoidLink - ? i18n.translate('xpack.monitoring.setupMode.monitorAllNodes', { - defaultMessage: 'Monitor all nodes with Metricbeat' - }) - : i18n.translate('xpack.monitoring.setupMode.clickToDisableInternalCollection', { - defaultMessage: 'Click to disable internal collection' - }); - statusText = ( - - -   - - {text} - - + + {customText || clickToDisableInternalCollection} + ); } else if (status.isFullyMigrated) { statusText = ( - - -   - - {i18n.translate('xpack.monitoring.setupMode.usingMetricbeatCollection', { - defaultMessage: 'Monitored with Metricbeat' - })} - - + + {customText || i18n.translate('xpack.monitoring.setupMode.usingMetricbeatCollection', { + defaultMessage: 'Monitored with Metricbeat' + })} + ); } else if (status.isNetNewUser) { statusText = ( - - -   - - {clickToMonitorWithMetricbeat} - - + + {customText || clickToMonitorWithMetricbeat} + ); } else { statusText = ( - - -   - - {i18n.translate('xpack.monitoring.setupMode.unknown', { - defaultMessage: 'N/A' - })} - - - ); - } - - if (useLink) { - return ( - setupMode.openFlyout(instance)}> - {statusText} - + + {customText || i18n.translate('xpack.monitoring.setupMode.unknown', { + defaultMessage: 'N/A' + })} + ); } diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js index 34e33be259c3c..8ea67dc0c0d07 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js +++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js @@ -38,7 +38,7 @@ export function SetupModeTooltip({ setupModeData, badgeClickAction, productName @@ -77,7 +77,7 @@ export function SetupModeTooltip({ setupModeData, badgeClickAction, productName position="top" content={i18n.translate('xpack.monitoring.setupMode.tooltip.oneInternal', { defaultMessage: `At least one {identifier} isn’t monitored using Metricbeat. - Click this icon to get the status of each {identifier}.`, + Click to get the status of each {identifier}.`, values: { identifier: getIdentifier(productName) } @@ -99,7 +99,7 @@ export function SetupModeTooltip({ setupModeData, badgeClickAction, productName position="top" content={i18n.translate('xpack.monitoring.setupMode.tooltip.disableInternal', { defaultMessage: `Metricbeat is monitoring all {identifierPlural}. - Click this icon to go to the {identifierPlural} view and disable internal collection.`, + Click to go to the {identifierPlural} view and disable internal collection.`, values: { identifierPlural: getIdentifier(productName, true) } diff --git a/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.js b/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.js index 34688a0e21eb9..d0b130bdbf0a5 100644 --- a/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.js +++ b/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.js @@ -116,26 +116,19 @@ export const disableElasticsearchInternalCollection = async () => { }; export const toggleSetupMode = inSetupMode => { - return new Promise(async (resolve, reject) => { - try { - checkAngularState(); - } catch (err) { - return reject(err); - } - - const globalState = angularState.injector.get('globalState'); - setupModeState.enabled = inSetupMode; - globalState.inSetupMode = inSetupMode; - globalState.save(); - setSetupModeMenuItem(); // eslint-disable-line no-use-before-define - notifySetupModeDataChange(); - - if (inSetupMode) { - await updateSetupModeData(); - } + checkAngularState(); - resolve(); - }); + const globalState = angularState.injector.get('globalState'); + setupModeState.enabled = inSetupMode; + globalState.inSetupMode = inSetupMode; + globalState.save(); + setSetupModeMenuItem(); // eslint-disable-line no-use-before-define + notifySetupModeDataChange(); + + if (inSetupMode) { + // Intentionally do not await this so we don't block UI operations + updateSetupModeData(); + } }; const setSetupModeMenuItem = () => { diff --git a/x-pack/legacy/plugins/monitoring/public/views/no_data/controller.js b/x-pack/legacy/plugins/monitoring/public/views/no_data/controller.js index 1576b80235c44..eaad32e706e3a 100644 --- a/x-pack/legacy/plugins/monitoring/public/views/no_data/controller.js +++ b/x-pack/legacy/plugins/monitoring/public/views/no_data/controller.js @@ -67,6 +67,7 @@ export class NoDataController { new NodeSettingsChecker($http) ]; const enabler = new Enabler($http, updateModel); + const changePath = path => kbnUrl.changePath(path); $scope.$$postDigest(() => { startChecks(checkers, updateModel); // Start the checkers that use APIs for finding the reason for no data @@ -77,7 +78,7 @@ export class NoDataController { props => { render( - + , document.getElementById(REACT_NODE_ID_NO_DATA) ); From 2241135727389d1420348e0f3e5e9838d0ffb2b9 Mon Sep 17 00:00:00 2001 From: chrisronline Date: Tue, 10 Sep 2019 15:07:46 -0400 Subject: [PATCH 12/43] Use badge and onClick --- .../public/components/setup_mode/badge.js | 31 +++++++-- .../public/components/setup_mode/tooltip.js | 67 +++++++++---------- 2 files changed, 56 insertions(+), 42 deletions(-) diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.js index 85bcac68bae58..fed53052a59bf 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.js +++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.js @@ -21,6 +21,14 @@ const clickToDisableInternalCollection = i18n.translate('xpack.monitoring.setupM defaultMessage: 'Disable internal collection' }); +const monitoredWithMetricbeat = i18n.translate('xpack.monitoring.setupMode.usingMetricbeatCollection', { + defaultMessage: 'Monitored with Metricbeat' +}); + +const unknown = i18n.translate('xpack.monitoring.setupMode.unknown', { + defaultMessage: 'N/A' +}); + export function SetupModeBadge({ setupMode, productName, status, instance, clusterUuid }) { let customAction = null; let customText = null; @@ -62,6 +70,9 @@ export function SetupModeBadge({ setupMode, productName, status, instance, clust let statusText = null; if (status.isInternalCollector) { + if (badgeProps.onClick) { + badgeProps.onClickAriaLabel = customText || clickToMonitorWithMetricbeat; + } statusText = ( {customText || clickToMonitorWithMetricbeat} @@ -69,6 +80,9 @@ export function SetupModeBadge({ setupMode, productName, status, instance, clust ); } else if (status.isPartiallyMigrated) { + if (badgeProps.onClick) { + badgeProps.onClickAriaLabel = customText || clickToDisableInternalCollection; + } statusText = ( {customText || clickToDisableInternalCollection} @@ -76,15 +90,19 @@ export function SetupModeBadge({ setupMode, productName, status, instance, clust ); } else if (status.isFullyMigrated) { + if (badgeProps.onClick) { + badgeProps.onClickAriaLabel = customText || monitoredWithMetricbeat; + } statusText = ( - {customText || i18n.translate('xpack.monitoring.setupMode.usingMetricbeatCollection', { - defaultMessage: 'Monitored with Metricbeat' - })} + {customText || monitoredWithMetricbeat} ); } else if (status.isNetNewUser) { + if (badgeProps.onClick) { + badgeProps.onClickAriaLabel = customText || clickToMonitorWithMetricbeat; + } statusText = ( {customText || clickToMonitorWithMetricbeat} @@ -92,11 +110,12 @@ export function SetupModeBadge({ setupMode, productName, status, instance, clust ); } else { + if (badgeProps.onClick) { + badgeProps.onClickAriaLabel = customText || unknown; + } statusText = ( - {customText || i18n.translate('xpack.monitoring.setupMode.unknown', { - defaultMessage: 'N/A' - })} + {customText || unknown} ); } diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js index 8ea67dc0c0d07..336086abc1569 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js +++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js @@ -10,7 +10,6 @@ import { EuiBadge, EuiFlexItem, EuiToolTip, - EuiLink } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { getIdentifier } from './formatting'; @@ -34,6 +33,9 @@ export function SetupModeTooltip({ setupModeData, badgeClickAction, productName if (totalUniqueInstanceCount === 0) { if (mightExist) { + const detectedText = i18n.translate('xpack.monitoring.setupMode.tooltip.detected', { + defaultMessage: 'Detected' + }); tooltip = ( - - - {i18n.translate('xpack.monitoring.setupMode.tooltip.detected', { - defaultMessage: 'Detected' - })} - - + + {detectedText} + ); } else { + const noMonitoringText = i18n.translate('xpack.monitoring.setupMode.tooltip.noMonitoring', { + defaultMessage: 'No monitoring' + }); + tooltip = ( - - - {i18n.translate('xpack.monitoring.setupMode.tooltip.noMonitoring', { - defaultMessage: 'No monitoring' - })} - - + + {noMonitoringText} + ); } } else if (!allMonitoredByMetricbeat) { + const internalCollection = i18n.translate('xpack.monitoring.euiTable.isInternalCollectorLabel', { + defaultMessage: 'Internal collection' + }); tooltip = ( - - - {i18n.translate('xpack.monitoring.euiTable.isInternalCollectorLabel', { - defaultMessage: 'Internal collection' - })} - - + + {internalCollection} + ); } else if (internalCollectionOn) { + const internalAndMB = i18n.translate('xpack.monitoring.euiTable.isPartiallyMigratedLabel', { + defaultMessage: 'Internal collection and Metricbeat collection' + }); tooltip = ( - - - {i18n.translate('xpack.monitoring.euiTable.isPartiallyMigratedLabel', { - defaultMessage: 'Internal collection and Metricbeat collection' - })} - - + + {internalAndMB} + ); } else { + const metricbeatCollection = i18n.translate('xpack.monitoring.euiTable.isFullyMigratedLabel', { + defaultMessage: 'Metricbeat collection' + }); tooltip = ( - - - {i18n.translate('xpack.monitoring.euiTable.isFullyMigratedLabel', { - defaultMessage: 'Metricbeat collection' - })} - - + + {metricbeatCollection} + ); } From faea4c269d8c599abeeb9178f3c019731757136c Mon Sep 17 00:00:00 2001 From: chrisronline Date: Mon, 16 Sep 2019 09:52:32 -0400 Subject: [PATCH 13/43] More feedback --- .../public/components/renderers/setup_mode.js | 6 +++--- .../public/components/setup_mode/tooltip.js | 13 ++++++------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/x-pack/legacy/plugins/monitoring/public/components/renderers/setup_mode.js b/x-pack/legacy/plugins/monitoring/public/components/renderers/setup_mode.js index 12a2163a33c37..5de51d9ed5819 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/renderers/setup_mode.js +++ b/x-pack/legacy/plugins/monitoring/public/components/renderers/setup_mode.js @@ -130,8 +130,8 @@ export class SetupModeRenderer extends React.Component { @@ -147,7 +147,7 @@ export class SetupModeRenderer extends React.Component { toggleSetupMode(false)}> {i18n.translate('xpack.monitoring.setupMode.exit', { - defaultMessage: `Exit set up mode` + defaultMessage: `Exit setup mode` })} diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js index 336086abc1569..59e44e0ea3d35 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js +++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js @@ -34,7 +34,7 @@ export function SetupModeTooltip({ setupModeData, badgeClickAction, productName if (totalUniqueInstanceCount === 0) { if (mightExist) { const detectedText = i18n.translate('xpack.monitoring.setupMode.tooltip.detected', { - defaultMessage: 'Detected' + defaultMessage: 'No collection' }); tooltip = ( Date: Mon, 16 Sep 2019 10:22:07 -0400 Subject: [PATCH 14/43] Only detect usage on the live cluster --- .../__test__/get_collection_status.js | 25 ++++++++++++++++--- .../setup/collection/get_collection_status.js | 24 ++++++++++-------- 2 files changed, 35 insertions(+), 14 deletions(-) diff --git a/x-pack/legacy/plugins/monitoring/server/lib/setup/collection/__test__/get_collection_status.js b/x-pack/legacy/plugins/monitoring/server/lib/setup/collection/__test__/get_collection_status.js index 228e2b602dfbb..bb42dad26786a 100644 --- a/x-pack/legacy/plugins/monitoring/server/lib/setup/collection/__test__/get_collection_status.js +++ b/x-pack/legacy/plugins/monitoring/server/lib/setup/collection/__test__/get_collection_status.js @@ -9,7 +9,8 @@ import sinon from 'sinon'; import { getCollectionStatus } from '../'; import { getIndexPatterns } from '../../../cluster/get_index_patterns'; -const mockReq = (searchResult = {}, msearchResult = { responses: [] }) => { +const liveClusterUuid = 'a12'; +const mockReq = (searchResult = {}) => { return { server: { config() { @@ -18,12 +19,28 @@ const mockReq = (searchResult = {}, msearchResult = { responses: [] }) => { .withArgs('server.uuid').returns('kibana-1234') }; }, + usage: { + collectorSet: { + getCollectorByType: () => ({ + isReady: () => false + }) + } + }, plugins: { elasticsearch: { getCluster() { return { - callWithRequest(_req, type) { - return Promise.resolve(type === 'search' ? searchResult : msearchResult); + callWithRequest(_req, type, params) { + if (type === 'transport.request' && (params && params.path === '/_cluster/state/cluster_uuid')) { + return Promise.resolve({ cluster_uuid: liveClusterUuid }); + } + if (type === 'transport.request' && (params && params.path === '/_nodes')) { + return Promise.resolve({ nodes: {} }); + } + if (type === 'cat.indices') { + return Promise.resolve([1]); + } + return Promise.resolve(searchResult); } }; } @@ -192,7 +209,7 @@ describe('getCollectionStatus', () => { ] }); - const result = await getCollectionStatus(req, getIndexPatterns(req.server)); + const result = await getCollectionStatus(req, getIndexPatterns(req.server), liveClusterUuid); expect(result.kibana.detected.doesExist).to.be(true); expect(result.elasticsearch.detected.doesExist).to.be(true); diff --git a/x-pack/legacy/plugins/monitoring/server/lib/setup/collection/get_collection_status.js b/x-pack/legacy/plugins/monitoring/server/lib/setup/collection/get_collection_status.js index 8ac6b33dbdc3c..6997843350f4f 100644 --- a/x-pack/legacy/plugins/monitoring/server/lib/setup/collection/get_collection_status.js +++ b/x-pack/legacy/plugins/monitoring/server/lib/setup/collection/get_collection_status.js @@ -145,7 +145,7 @@ const getRecentMonitoringDocuments = async (req, indexPatterns, clusterUuid, nod return await callWithRequest(req, 'search', params); }; -async function detectProducts(req) { +async function detectProducts(req, isLiveCluster) { const result = { [KIBANA_SYSTEM_ID]: { doesExist: true, @@ -187,11 +187,13 @@ async function detectProducts(req) { } ]; - const { callWithRequest } = req.server.plugins.elasticsearch.getCluster('data'); - for (const { id, indices } of detectionSearch) { - const response = await callWithRequest(req, 'cat.indices', { index: indices, format: 'json' }); - if (response.length) { - result[id].mightExist = true; + if (isLiveCluster) { + const { callWithRequest } = req.server.plugins.elasticsearch.getCluster('data'); + for (const { id, indices } of detectionSearch) { + const response = await callWithRequest(req, 'cat.indices', { index: indices, format: 'json' }); + if (response.length) { + result[id].mightExist = true; + } } } @@ -314,6 +316,8 @@ async function getLiveElasticsearchCollectionEnabled(req) { export const getCollectionStatus = async (req, indexPatterns, clusterUuid, nodeUuid, skipLiveData) => { const config = req.server.config(); const kibanaUuid = config.get('server.uuid'); + const liveClusterUuid = skipLiveData ? null : await getLiveElasticsearchClusterUuid(req); + const isLiveCluster = clusterUuid && liveClusterUuid === clusterUuid; const PRODUCTS = [ { name: KIBANA_SYSTEM_ID }, @@ -328,12 +332,12 @@ export const getCollectionStatus = async (req, indexPatterns, clusterUuid, nodeU detectedProducts ] = await Promise.all([ await getRecentMonitoringDocuments(req, indexPatterns, clusterUuid, nodeUuid), - await detectProducts(req) + await detectProducts(req, isLiveCluster) ]); - const liveClusterUuid = skipLiveData ? null : await getLiveElasticsearchClusterUuid(req); - const liveEsNodes = skipLiveData || (clusterUuid && liveClusterUuid !== clusterUuid) ? [] : await getLivesNodes(req); - const liveKibanaInstance = skipLiveData || (clusterUuid && liveClusterUuid !== clusterUuid) ? {} : await getLiveKibanaInstance(req); + + const liveEsNodes = skipLiveData || !isLiveCluster ? [] : await getLivesNodes(req); + const liveKibanaInstance = skipLiveData || !isLiveCluster ? {} : await getLiveKibanaInstance(req); const indicesBuckets = get(recentDocuments, 'aggregations.indices.buckets', []); const liveClusterInternalCollectionEnabled = await getLiveElasticsearchCollectionEnabled(req); From 17991ab49b72b8edaddadbbe4ecae8595c58e329 Mon Sep 17 00:00:00 2001 From: chrisronline Date: Mon, 16 Sep 2019 13:18:18 -0400 Subject: [PATCH 15/43] Fix existing tests, remove test that will be added in other PR --- .../__snapshots__/listing.test.js.snap | 8 +- .../__snapshots__/no_data.test.js.snap | 148 ++++++++++------ .../monitoring/public/lib/setup_mode.test.js | 163 ------------------ 3 files changed, 102 insertions(+), 217 deletions(-) delete mode 100644 x-pack/legacy/plugins/monitoring/public/lib/setup_mode.test.js diff --git a/x-pack/legacy/plugins/monitoring/public/components/logstash/listing/__snapshots__/listing.test.js.snap b/x-pack/legacy/plugins/monitoring/public/components/logstash/listing/__snapshots__/listing.test.js.snap index 987505dda09bb..edb7d139bb935 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/logstash/listing/__snapshots__/listing.test.js.snap +++ b/x-pack/legacy/plugins/monitoring/public/components/logstash/listing/__snapshots__/listing.test.js.snap @@ -55,7 +55,7 @@ exports[`Listing should render with certain data pieces missing 1`] = ` ], } } - nameField="name" + productName="logstash" rows={ Array [ Object { @@ -82,7 +82,6 @@ exports[`Listing should render with certain data pieces missing 1`] = ` } } setupMode={Object {}} - setupNewButtonLabel="Setup monitoring for new Logstash node" sorting={ Object { "sort": Object { @@ -93,7 +92,6 @@ exports[`Listing should render with certain data pieces missing 1`] = ` }, } } - uuidField="logstash.uuid" /> `; @@ -152,7 +150,7 @@ exports[`Listing should render with expected props 1`] = ` ], } } - nameField="name" + productName="logstash" rows={ Array [ Object { @@ -211,7 +209,6 @@ exports[`Listing should render with expected props 1`] = ` } } setupMode={Object {}} - setupNewButtonLabel="Setup monitoring for new Logstash node" sorting={ Object { "sort": Object { @@ -222,6 +219,5 @@ exports[`Listing should render with expected props 1`] = ` }, } } - uuidField="logstash.uuid" /> `; diff --git a/x-pack/legacy/plugins/monitoring/public/components/no_data/__tests__/__snapshots__/no_data.test.js.snap b/x-pack/legacy/plugins/monitoring/public/components/no_data/__tests__/__snapshots__/no_data.test.js.snap index 7c663a26bc9df..4242056e2a911 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/no_data/__tests__/__snapshots__/no_data.test.js.snap +++ b/x-pack/legacy/plugins/monitoring/public/components/no_data/__tests__/__snapshots__/no_data.test.js.snap @@ -22,43 +22,68 @@ exports[`NoData should show a default message if reason is unknown 1`] = `

+

+ No monitoring data found +

+

- There is a - - - food - - - setting that has - +

+
+
+
+ +
+
+
+
+ +
@@ -89,38 +114,65 @@ exports[`NoData should show text next to the spinner while checking a setting 1`

- We're looking for your monitoring data + No monitoring data found

- -
-

- Monitoring provides insight to your hardware performance and load. -

-
-

+

+ Have you set up monitoring yet? If so, make sure that the selected time period in the upper right includes monitoring data. +

+
+
+
- -
-
- checking something to test... +
+
+
diff --git a/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.test.js b/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.test.js deleted file mode 100644 index 0321c5d978667..0000000000000 --- a/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.test.js +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { toggleSetupMode, initSetupModeState, getSetupModeState, updateSetupModeData } from './setup_mode'; - -jest.mock('./ajax_error_handler', () => ({ - ajaxErrorHandlersProvider: err => { - throw err; - } -})); - -let data = {}; - -const injectorModulesMock = { - globalState: { - save: jest.fn() - }, - Private: module => module, - $http: { - post: jest.fn().mockImplementation(() => { - return { data }; - }) - }, - $executor: { - run: jest.fn() - } -}; - -const angularStateMock = { - injector: { - get: module => { - return injectorModulesMock[module] || {}; - } - }, - scope: { - $apply: fn => fn && fn() - } -}; - -describe('setup_mode', () => { - describe('setup', () => { - afterEach(async () => { - toggleSetupMode(false); - }); - - it('should require angular state', async () => { - expect(toggleSetupMode(true)).rejects.toEqual('Unable to interact with setup ' - + 'mode because the angular injector was not previously set. This needs to be ' - + 'set by calling `initSetupModeState`.'); - }); - - it('should enable toggle mode', async () => { - initSetupModeState(angularStateMock.scope, angularStateMock.injector); - await toggleSetupMode(true); - expect(injectorModulesMock.globalState.inSetupMode).toBe(true); - }); - - it('should disable toggle mode', async () => { - initSetupModeState(angularStateMock.scope, angularStateMock.injector); - await toggleSetupMode(false); - expect(injectorModulesMock.globalState.inSetupMode).toBe(false); - }); - - it('should set top nav config', async () => { - initSetupModeState(angularStateMock.scope, angularStateMock.injector); - expect(angularStateMock.scope.topNavMenu.length).toBe(1); - await toggleSetupMode(true); - expect(angularStateMock.scope.topNavMenu.length).toBe(2); - }); - }); - - describe('in setup mode', () => { - afterEach(async () => { - data = {}; - toggleSetupMode(false); - }); - - it('should enable it through clicking top nav item', async () => { - initSetupModeState(angularStateMock.scope, angularStateMock.injector); - await angularStateMock.scope.topNavMenu[0].run(); - expect(injectorModulesMock.globalState.inSetupMode).toBe(true); - }); - - it('should not fetch data if on cloud', async () => { - data = { - _meta: { - isOnCloud: true - } - }; - initSetupModeState(angularStateMock.scope, angularStateMock.injector); - await toggleSetupMode(true); - const state = getSetupModeState(); - expect(state.enabled).toBe(false); - }); - - it('should set the newly discovered cluster uuid', async () => { - const clusterUuid = '1ajy'; - data = { - _meta: { - liveClusterUuid: clusterUuid - }, - elasticsearch: { - byUuid: { - 123: { - isPartiallyMigrated: true - } - } - } - }; - initSetupModeState(angularStateMock.scope, angularStateMock.injector); - await toggleSetupMode(true); - expect(injectorModulesMock.globalState.cluster_uuid).toBe(clusterUuid); - }); - - it('should fetch data for a given cluster', async () => { - const clusterUuid = '1ajy'; - data = { - _meta: { - liveClusterUuid: clusterUuid - }, - elasticsearch: { - byUuid: { - 123: { - isPartiallyMigrated: true - } - } - } - }; - - initSetupModeState(angularStateMock.scope, angularStateMock.injector); - await toggleSetupMode(true); - expect(injectorModulesMock.$http.post).toHaveBeenCalledWith( - `../api/monitoring/v1/setup/collection/cluster/${clusterUuid}`, - { ccs: undefined } - ); - }); - - it('should fetch data for a single node', async () => { - initSetupModeState(angularStateMock.scope, angularStateMock.injector); - await toggleSetupMode(true); - injectorModulesMock.$http.post.mockClear(); - await updateSetupModeData('45asd'); - expect(injectorModulesMock.$http.post).toHaveBeenCalledWith( - '../api/monitoring/v1/setup/collection/node/45asd', - { ccs: undefined } - ); - }); - - it('should fetch data without a cluster uuid', async () => { - initSetupModeState(angularStateMock.scope, angularStateMock.injector); - await toggleSetupMode(true); - injectorModulesMock.$http.post.mockClear(); - await updateSetupModeData(undefined, true); - expect(injectorModulesMock.$http.post).toHaveBeenCalledWith( - '../api/monitoring/v1/setup/collection/cluster', - { ccs: undefined } - ); - }); - }); -}); From af03ab401664624e644fb906fd86868e556a8b43 Mon Sep 17 00:00:00 2001 From: chrisronline Date: Mon, 16 Sep 2019 16:17:23 -0400 Subject: [PATCH 16/43] Fix failing test --- .../plugins/monitoring/public/components/no_data/no_data.js | 6 +++--- x-pack/test/functional/services/monitoring/no_data.js | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js b/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js index 88a2a1a7859de..6113bb98f20c8 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js +++ b/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js @@ -66,7 +66,7 @@ export function NoData(props) { - setUseInternalCollection(false)}> + setUseInternalCollection(false)}> - - setUseInternalCollection(true)}> + setUseInternalCollection(true)} data-test-subj="useInternalCollection"> + Date: Tue, 17 Sep 2019 09:51:22 -0400 Subject: [PATCH 17/43] Fix issue with wrong callout showing --- .../monitoring/public/components/elasticsearch/nodes/nodes.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js b/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js index a80d0ff2ecc2a..e00df8fcc0665 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js +++ b/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js @@ -279,7 +279,8 @@ export function ElasticsearchNodes({ clusterStatus, showCgroupMetricsElasticsear componentToRender: null }; - if (setupMode.data.totalUniquePartiallyMigratedCount === setupMode.data.totalUniqueInstanceCount) { + const hasInstances = setupMode.data.totalUniqueInstanceCount > 0; + if (hasInstances && setupMode.data.totalUniquePartiallyMigratedCount === setupMode.data.totalUniqueInstanceCount) { const finishMigrationAction = _.get(setupMode.meta, 'liveClusterUuid') === clusterUuid ? setupMode.shortcutToFinishMigration : setupMode.openFlyout; From cdc25ea245e856a287f2c34f18921187e2ae9d30 Mon Sep 17 00:00:00 2001 From: chrisronline Date: Tue, 17 Sep 2019 10:41:14 -0400 Subject: [PATCH 18/43] Ensure we check for live nodes if no cluster uuid is provided --- .../server/lib/setup/collection/get_collection_status.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/legacy/plugins/monitoring/server/lib/setup/collection/get_collection_status.js b/x-pack/legacy/plugins/monitoring/server/lib/setup/collection/get_collection_status.js index 6997843350f4f..5f8659148b5ba 100644 --- a/x-pack/legacy/plugins/monitoring/server/lib/setup/collection/get_collection_status.js +++ b/x-pack/legacy/plugins/monitoring/server/lib/setup/collection/get_collection_status.js @@ -317,7 +317,7 @@ export const getCollectionStatus = async (req, indexPatterns, clusterUuid, nodeU const config = req.server.config(); const kibanaUuid = config.get('server.uuid'); const liveClusterUuid = skipLiveData ? null : await getLiveElasticsearchClusterUuid(req); - const isLiveCluster = clusterUuid && liveClusterUuid === clusterUuid; + const isLiveCluster = !clusterUuid || liveClusterUuid === clusterUuid; const PRODUCTS = [ { name: KIBANA_SYSTEM_ID }, From 207c0c745312e19475b1ce0519dfd2e196cad51c Mon Sep 17 00:00:00 2001 From: chrisronline Date: Tue, 17 Sep 2019 10:42:41 -0400 Subject: [PATCH 19/43] We need a custom listing callout for ES --- .../components/elasticsearch/nodes/nodes.js | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js b/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js index e00df8fcc0665..d1bc1a2c8ba10 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js +++ b/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js @@ -280,7 +280,28 @@ export function ElasticsearchNodes({ clusterStatus, showCgroupMetricsElasticsear }; const hasInstances = setupMode.data.totalUniqueInstanceCount > 0; - if (hasInstances && setupMode.data.totalUniquePartiallyMigratedCount === setupMode.data.totalUniqueInstanceCount) { + if (!hasInstances) { + customRenderResponse.shouldRender = true; + customRenderResponse.componentToRender = ( + + +

+ {i18n.translate('xpack.monitoring.elasticsearch.nodes.metricbeatMigration.detectedNodeDescription', { + defaultMessage: `The following nodes are not monitored. Click 'Monitor with Metricbeat' below to start monitoring.`, + })} +

+
+ +
+ ); + } + else if (setupMode.data.totalUniquePartiallyMigratedCount === setupMode.data.totalUniqueInstanceCount) { const finishMigrationAction = _.get(setupMode.meta, 'liveClusterUuid') === clusterUuid ? setupMode.shortcutToFinishMigration : setupMode.openFlyout; From 46ef2af0898c18ea35eed02ebba5bf1a79020a60 Mon Sep 17 00:00:00 2001 From: chrisronline Date: Tue, 17 Sep 2019 10:53:33 -0400 Subject: [PATCH 20/43] Custom callout for kibana instances --- .../components/kibana/instances/instances.js | 35 ++++++++++++++++++- .../public/components/setup_mode/tooltip.js | 2 +- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/x-pack/legacy/plugins/monitoring/public/components/kibana/instances/instances.js b/x-pack/legacy/plugins/monitoring/public/components/kibana/instances/instances.js index 46876740efa41..9e2134baee368 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/kibana/instances/instances.js +++ b/x-pack/legacy/plugins/monitoring/public/components/kibana/instances/instances.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { PureComponent } from 'react'; +import React, { PureComponent, Fragment } from 'react'; import { EuiPage, EuiPageBody, @@ -12,6 +12,7 @@ import { EuiPanel, EuiSpacer, EuiLink, + EuiCallOut } from '@elastic/eui'; import { capitalize, get } from 'lodash'; import { ClusterStatus } from '../cluster_status'; @@ -209,6 +210,38 @@ export class KibanaInstances extends PureComponent { setupModeData={setupMode.data} useNodeIdentifier={false} productName={KIBANA_SYSTEM_ID} + customRenderer={() => { + const customRenderResponse = { + shouldRender: false, + componentToRender: null + }; + + const hasInstances = setupMode.data.totalUniqueInstanceCount > 0; + if (!hasInstances) { + customRenderResponse.shouldRender = true; + customRenderResponse.componentToRender = ( + + +

+ {i18n.translate('xpack.monitoring.kibana.instances.metricbeatMigration.detectedNodeDescription', { + defaultMessage: `The following instances are not monitored. + Click 'Monitor with Metricbeat' below to start monitoring.`, + })} +

+
+ +
+ ); + } + + return customRenderResponse; + }} /> ); } diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js index 59e44e0ea3d35..7d85020aed994 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js +++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js @@ -27,7 +27,7 @@ export function SetupModeTooltip({ setupModeData, badgeClickAction, productName const allMonitoredByMetricbeat = totalUniqueInstanceCount > 0 && (totalUniqueFullyMigratedCount === totalUniqueInstanceCount || totalUniquePartiallyMigratedCount === totalUniqueInstanceCount); const internalCollectionOn = totalUniquePartiallyMigratedCount > 0; - const mightExist = get(setupModeData, 'detected.mightExist'); + const mightExist = get(setupModeData, 'detected.mightExist') || get(setupModeData, 'detected.doesExist'); let tooltip = null; From 7ba9bf12bb112871282ceb97be4c4d28213c5627 Mon Sep 17 00:00:00 2001 From: chrisronline Date: Tue, 17 Sep 2019 10:56:12 -0400 Subject: [PATCH 21/43] More space from the bottom bar --- .../monitoring/public/components/renderers/setup_mode.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/legacy/plugins/monitoring/public/components/renderers/setup_mode.js b/x-pack/legacy/plugins/monitoring/public/components/renderers/setup_mode.js index 5de51d9ed5819..166e31da5ee6d 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/renderers/setup_mode.js +++ b/x-pack/legacy/plugins/monitoring/public/components/renderers/setup_mode.js @@ -121,7 +121,7 @@ export class SetupModeRenderer extends React.Component { return ( - + From 2d83d88fe025218d3a96edd08f18f9babcb283f5 Mon Sep 17 00:00:00 2001 From: chrisronline Date: Tue, 17 Sep 2019 11:08:52 -0400 Subject: [PATCH 22/43] Disable switching if they enabled internal collection --- .../plugins/monitoring/public/components/no_data/no_data.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js b/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js index 6113bb98f20c8..b569aed93ef6a 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js +++ b/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js @@ -65,8 +65,8 @@ export function NoData(props) { - - setUseInternalCollection(false)}> + setUseInternalCollection(false)}> + Date: Tue, 17 Sep 2019 11:47:32 -0400 Subject: [PATCH 23/43] Copy updates --- .../public/components/elasticsearch/nodes/nodes.js | 5 ++--- .../instruction_steps/common_instructions.js | 4 ++-- .../monitoring/public/components/renderers/setup_mode.js | 4 ++-- .../monitoring/public/components/setup_mode/badge.js | 2 +- .../monitoring/public/components/setup_mode/tooltip.js | 7 +++---- .../monitoring/public/components/table/eui_table.js | 2 +- 6 files changed, 11 insertions(+), 13 deletions(-) diff --git a/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js b/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js index d1bc1a2c8ba10..57e56974b37b2 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js +++ b/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js @@ -311,15 +311,14 @@ export function ElasticsearchNodes({ clusterStatus, showCgroupMetricsElasticsear

{i18n.translate('xpack.monitoring.elasticsearch.nodes.metricbeatMigration.disableInternalCollectionDescription', { - defaultMessage: `Metricbeat is now monitoring your Elasticsearch servers. - Disable internal collection to finish the migration.` + defaultMessage: `Disable internal collection to finish the migration.` })}

diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/common_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/common_instructions.js index 8821b7e02811a..0b55ecabf1fa0 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/common_instructions.js +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/common_instructions.js @@ -34,7 +34,7 @@ export function getSecurityStep(url) { @@ -137,7 +137,7 @@ export function getDisableStatusStep(product, meta) { >

{i18n.translate('xpack.monitoring.metricbeatMigration.partiallyMigratedStatusDescription', { - defaultMessage: `It can take up to {secondsAgo} seconds to detect data, and we’ll continue checking.`, + defaultMessage: `It can take up to {secondsAgo} seconds to detect data.`, values: { secondsAgo: meta.secondsAgo } diff --git a/x-pack/legacy/plugins/monitoring/public/components/renderers/setup_mode.js b/x-pack/legacy/plugins/monitoring/public/components/renderers/setup_mode.js index 166e31da5ee6d..9c0c8c1f5f882 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/renderers/setup_mode.js +++ b/x-pack/legacy/plugins/monitoring/public/components/renderers/setup_mode.js @@ -130,8 +130,8 @@ export class SetupModeRenderer extends React.Component { diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.js index fed53052a59bf..f7d89ee80e548 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.js +++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.js @@ -54,7 +54,7 @@ export function SetupModeBadge({ setupMode, productName, status, instance, clust   {i18n.translate('xpack.monitoring.setupMode.monitorAllNodes', { - defaultMessage: 'Monitor all nodes with Metricbeat' + defaultMessage: 'Some nodes only use internal collection' })} diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js index 7d85020aed994..1fe3b4fecb205 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js +++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js @@ -40,7 +40,7 @@ export function SetupModeTooltip({ setupModeData, badgeClickAction, productName @@ -77,7 +77,7 @@ export function SetupModeTooltip({ setupModeData, badgeClickAction, productName setupMode.openFlyout({}, true)}> {i18n.translate('xpack.monitoring.euiTable.setupNewButtonLabel', { - defaultMessage: 'Set up monitoring for new {identifier}', + defaultMessage: 'Set up monitoring for another {identifier}', values: { identifier: getIdentifier(productName) } From 74547022eb8c2479ad1bad71827f4de28a3df403 Mon Sep 17 00:00:00 2001 From: chrisronline Date: Tue, 17 Sep 2019 12:54:59 -0400 Subject: [PATCH 24/43] Fix broken tests --- x-pack/test/functional/apps/monitoring/elasticsearch/nodes.js | 4 ++-- .../test/functional/apps/monitoring/elasticsearch/overview.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/x-pack/test/functional/apps/monitoring/elasticsearch/nodes.js b/x-pack/test/functional/apps/monitoring/elasticsearch/nodes.js index 81f683dc9a4ce..da78ba67c76e5 100644 --- a/x-pack/test/functional/apps/monitoring/elasticsearch/nodes.js +++ b/x-pack/test/functional/apps/monitoring/elasticsearch/nodes.js @@ -214,8 +214,8 @@ export default function ({ getService, getPageObjects }) { nodesCount: 'Nodes\n3', indicesCount: 'Indices\n20', memory: 'Memory\n575.3 MB / 2.0 GB', - totalShards: 'Total Shards\n80', - unassignedShards: 'Unassigned Shards\n5', + totalShards: 'Total shards\n80', + unassignedShards: 'Unassigned shards\n5', documentCount: 'Documents\n25,927', dataSize: 'Data\n101.6 MB', health: 'Health: yellow', diff --git a/x-pack/test/functional/apps/monitoring/elasticsearch/overview.js b/x-pack/test/functional/apps/monitoring/elasticsearch/overview.js index 3f90c6a096e90..d86127b3e6fb8 100644 --- a/x-pack/test/functional/apps/monitoring/elasticsearch/overview.js +++ b/x-pack/test/functional/apps/monitoring/elasticsearch/overview.js @@ -35,8 +35,8 @@ export default function ({ getService, getPageObjects }) { nodesCount: 'Nodes\n3', indicesCount: 'Indices\n20', memory: 'Memory\n575.3 MB / 2.0 GB', - totalShards: 'Total Shards\n80', - unassignedShards: 'Unassigned Shards\n5', + totalShards: 'Total shards\n80', + unassignedShards: 'Unassigned shards\n5', documentCount: 'Documents\n25,927', dataSize: 'Data\n101.6 MB', health: 'Health: yellow', From 6af3a076451b51cb9fd6e4159aeb81050a5681b9 Mon Sep 17 00:00:00 2001 From: chrisronline Date: Tue, 17 Sep 2019 14:46:46 -0400 Subject: [PATCH 25/43] Fix more tests --- .../apps/monitoring/elasticsearch/index_detail.js | 12 ++++++------ .../apps/monitoring/elasticsearch/indices.js | 4 ++-- .../apps/monitoring/elasticsearch/nodes.js | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/x-pack/test/functional/apps/monitoring/elasticsearch/index_detail.js b/x-pack/test/functional/apps/monitoring/elasticsearch/index_detail.js index 7fbb8990d1f27..c3fe5f9273a89 100644 --- a/x-pack/test/functional/apps/monitoring/elasticsearch/index_detail.js +++ b/x-pack/test/functional/apps/monitoring/elasticsearch/index_detail.js @@ -45,8 +45,8 @@ export default function ({ getService, getPageObjects }) { dataSize: 'Total\n8.8 MB', dataSizePrimaries: 'Primaries\n4.4 MB', documentCount: 'Documents\n628', - totalShards: 'Total Shards\n10', - unassignedShards: 'Unassigned Shards\n0', + totalShards: 'Total shards\n10', + unassignedShards: 'Unassigned shards\n0', health: 'Health: green', }); }); @@ -58,8 +58,8 @@ export default function ({ getService, getPageObjects }) { dataSize: 'Total\n4.8 KB', dataSizePrimaries: 'Primaries\n4.8 KB', documentCount: 'Documents\n1', - totalShards: 'Total Shards\n1', - unassignedShards: 'Unassigned Shards\n0', + totalShards: 'Total shards\n1', + unassignedShards: 'Unassigned shards\n0', health: 'Health: green', }); }); @@ -71,8 +71,8 @@ export default function ({ getService, getPageObjects }) { dataSize: 'Total\n1.2 MB', dataSizePrimaries: 'Primaries\n657.6 KB', documentCount: 'Documents\n10', - totalShards: 'Total Shards\n10', - unassignedShards: 'Unassigned Shards\n1', + totalShards: 'Total shards\n10', + unassignedShards: 'Unassigned shards\n1', health: 'Health: yellow', }); }); diff --git a/x-pack/test/functional/apps/monitoring/elasticsearch/indices.js b/x-pack/test/functional/apps/monitoring/elasticsearch/indices.js index fc3669079dbce..ff809b95a834e 100644 --- a/x-pack/test/functional/apps/monitoring/elasticsearch/indices.js +++ b/x-pack/test/functional/apps/monitoring/elasticsearch/indices.js @@ -35,8 +35,8 @@ export default function ({ getService, getPageObjects }) { nodesCount: 'Nodes\n1', indicesCount: 'Indices\n19', memory: 'Memory\n267.7 MB / 676.8 MB', - totalShards: 'Total Shards\n46', - unassignedShards: 'Unassigned Shards\n23', + totalShards: 'Total shards\n46', + unassignedShards: 'Unassigned shards\n23', documentCount: 'Documents\n4,535', dataSize: 'Data\n8.6 MB', health: 'Health: red', diff --git a/x-pack/test/functional/apps/monitoring/elasticsearch/nodes.js b/x-pack/test/functional/apps/monitoring/elasticsearch/nodes.js index da78ba67c76e5..86f47775e50cd 100644 --- a/x-pack/test/functional/apps/monitoring/elasticsearch/nodes.js +++ b/x-pack/test/functional/apps/monitoring/elasticsearch/nodes.js @@ -39,8 +39,8 @@ export default function ({ getService, getPageObjects }) { nodesCount: 'Nodes\n2', indicesCount: 'Indices\n20', memory: 'Memory\n696.6 MB / 1.3 GB', - totalShards: 'Total Shards\n79', - unassignedShards: 'Unassigned Shards\n7', + totalShards: 'Total shards\n79', + unassignedShards: 'Unassigned shards\n7', documentCount: 'Documents\n25,758', dataSize: 'Data\n100.0 MB', health: 'Health: yellow', From b83a1d4418b7c85161da958dd949d4ea506239a3 Mon Sep 17 00:00:00 2001 From: chrisronline Date: Tue, 17 Sep 2019 21:29:29 -0400 Subject: [PATCH 26/43] Fix i18n --- .../plugins/monitoring/public/components/no_data/no_data.js | 2 +- .../monitoring/public/components/setup_mode/listing_callout.js | 2 +- .../plugins/monitoring/public/components/setup_mode/tooltip.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js b/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js index b569aed93ef6a..e55a1775bb24c 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js +++ b/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js @@ -122,7 +122,7 @@ export function NoData(props) { isLoading={isLoading} > diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js index c4e86c1da03d3..4e9c1c4bd9e53 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js +++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js @@ -137,7 +137,7 @@ export function ListingCallOut({ setupModeData, productName, customRenderer = nu iconType="flag" >

- {i18n.translate('xpack.monitoring.setupMode.disableInternalCollectionDescription', { + {i18n.translate('xpack.monitoring.setupMode.migrateToMetricbeatDescription', { defaultMessage: `These {product} {identifier} are monitored through internal collection. Migrate to monitor with Metricbeat.`, values: { product: formatProductName(productName), diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js index 1fe3b4fecb205..07079ce11b169 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js +++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js @@ -57,7 +57,7 @@ export function SetupModeTooltip({ setupModeData, badgeClickAction, productName tooltip = ( From 7facf4730fe85fb4ae35679e90cc7317e7e0f51a Mon Sep 17 00:00:00 2001 From: chrisronline Date: Thu, 19 Sep 2019 13:27:36 -0400 Subject: [PATCH 27/43] Update copy --- .../monitoring/public/components/setup_mode/badge.js | 2 +- .../public/components/setup_mode/listing_callout.js | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.js index f7d89ee80e548..fe653af357e99 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.js +++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.js @@ -54,7 +54,7 @@ export function SetupModeBadge({ setupMode, productName, status, instance, clust   {i18n.translate('xpack.monitoring.setupMode.monitorAllNodes', { - defaultMessage: 'Some nodes only use internal collection' + defaultMessage: 'Some nodes use only internal collection' })} diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js index 4e9c1c4bd9e53..9302af1f59c18 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js +++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js @@ -41,12 +41,7 @@ export function ListingCallOut({ setupModeData, productName, customRenderer = nu >

{i18n.translate('xpack.monitoring.setupMode.detectedNodeDescription', { - defaultMessage: `Based on your indices, we think you might have a {product} {identifier}. Click 'Set up monitoring' - below to start monitoring this {identifier}.`, - values: { - product: formatProductName(productName), - identifier: getIdentifier(productName) - } + defaultMessage: `Click 'Set up monitoring' below to start monitoring this {identifier}.` })}

@@ -58,7 +53,7 @@ export function ListingCallOut({ setupModeData, productName, customRenderer = nu

{i18n.translate('xpack.monitoring.setupMode.netNewUserDescription', { - defaultMessage: `If you have {product} {identifier}, click 'Set up monitoring' below to monitor with Metricbeat.`, + defaultMessage: `Click 'Set up monitoring' to start monitoring with Metricbeat.`, values: { product: formatProductName(productName), identifier: getIdentifier(productName, true) From b9c29a80a6e1a0dda951d701b18122a7e8b69335 Mon Sep 17 00:00:00 2001 From: chrisronline Date: Fri, 20 Sep 2019 09:10:07 -0400 Subject: [PATCH 28/43] Fix a couple i18n issues --- .../public/components/setup_mode/listing_callout.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js index 9302af1f59c18..f57ea68dd2278 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js +++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js @@ -41,7 +41,10 @@ export function ListingCallOut({ setupModeData, productName, customRenderer = nu >

{i18n.translate('xpack.monitoring.setupMode.detectedNodeDescription', { - defaultMessage: `Click 'Set up monitoring' below to start monitoring this {identifier}.` + defaultMessage: `Click 'Set up monitoring' below to start monitoring this {identifier}.`, + values: { + identifier: getIdentifier(productName) + } })}

@@ -64,10 +67,6 @@ export function ListingCallOut({ setupModeData, productName, customRenderer = nu

{i18n.translate('xpack.monitoring.setupMode.netNewUserDescription', { defaultMessage: `Click 'Set up monitoring' to start monitoring with Metricbeat.`, - values: { - product: formatProductName(productName), - identifier: getIdentifier(productName, true) - } })}

From d86ebba8ba9cfc453770955ce3ed07bca3d332d9 Mon Sep 17 00:00:00 2001 From: chrisronline Date: Fri, 20 Sep 2019 12:15:58 -0400 Subject: [PATCH 29/43] Fixing a couple of missing scenarios --- .../components/setup_mode/listing_callout.js | 39 +++++++++++--- .../setup/collection/get_collection_status.js | 51 +++++++++++-------- 2 files changed, 61 insertions(+), 29 deletions(-) diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js index f57ea68dd2278..11276c204fa96 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js +++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js @@ -13,6 +13,10 @@ import { import { i18n } from '@kbn/i18n'; import { formatProductName, getIdentifier } from './formatting'; +const MIGRATE_TO_MB_LABEL = i18n.translate('xpack.monitoring.setupMode.migrateToMetricbeat', { + defaultMessage: 'Migrate to Metricbeat', +}); + export function ListingCallOut({ setupModeData, productName, customRenderer = null }) { if (customRenderer) { const { shouldRender, componentToRender } = customRenderer(); @@ -119,20 +123,41 @@ export function ListingCallOut({ setupModeData, productName, customRenderer = nu ); } - if (setupModeData.totalUniqueInstanceCount > 0 && - setupModeData.totalUniqueFullyMigratedCount === 0 && setupModeData.totalUniquePartiallyMigratedCount === 0) { + if (setupModeData.totalUniqueInstanceCount > 0) { + if (setupModeData.totalUniqueFullyMigratedCount === 0 && setupModeData.totalUniquePartiallyMigratedCount === 0) { + return ( + + +

+ {i18n.translate('xpack.monitoring.setupMode.migrateToMetricbeatDescription', { + defaultMessage: `These {product} {identifier} are monitored through internal collection. + Migrate to monitor with Metricbeat.`, + values: { + product: formatProductName(productName), + identifier: getIdentifier(productName, true) + } + })} +

+
+ +
+ ); + } + return (

- {i18n.translate('xpack.monitoring.setupMode.migrateToMetricbeatDescription', { - defaultMessage: `These {product} {identifier} are monitored through internal collection. Migrate to monitor with Metricbeat.`, + {i18n.translate('xpack.monitoring.setupMode.migrateSomeToMetricbeatDescription', { + defaultMessage: `Some {product} {identifier} are monitored through internal collection. Migrate to monitor with Metricbeat.`, values: { product: formatProductName(productName), identifier: getIdentifier(productName, true) diff --git a/x-pack/legacy/plugins/monitoring/server/lib/setup/collection/get_collection_status.js b/x-pack/legacy/plugins/monitoring/server/lib/setup/collection/get_collection_status.js index 5f8659148b5ba..d15a3ea986d3e 100644 --- a/x-pack/legacy/plugins/monitoring/server/lib/setup/collection/get_collection_status.js +++ b/x-pack/legacy/plugins/monitoring/server/lib/setup/collection/get_collection_status.js @@ -358,28 +358,6 @@ export const getCollectionStatus = async (req, indexPatterns, clusterUuid, nodeU const internalCollectorsUuidsMap = {}; const partiallyMigratedUuidsMap = {}; - if (product.name === ELASTICSEARCH_SYSTEM_ID && liveEsNodes.length) { - productStatus.byUuid = liveEsNodes.reduce((accum, esNode) => ({ - ...accum, - [esNode.id]: { - node: esNode, - isNetNewUser: true - }, - }), {}); - } - - if (product.name === KIBANA_SYSTEM_ID && liveKibanaInstance) { - const kibanaLiveUuid = get(liveKibanaInstance, 'kibana.uuid'); - if (kibanaLiveUuid) { - productStatus.byUuid = { - [kibanaLiveUuid]: { - instance: liveKibanaInstance, - isNetNewUser: true - } - }; - } - } - // If there is no data, then they are a net new user if (!indexBuckets || indexBuckets.length === 0) { productStatus.totalUniqueInstanceCount = 0; @@ -528,6 +506,35 @@ export const getCollectionStatus = async (req, indexPatterns, clusterUuid, nodeU productStatus.detected = detectedProducts[product.name]; } + if (product.name === ELASTICSEARCH_SYSTEM_ID && liveEsNodes.length) { + productStatus.byUuid = liveEsNodes.reduce((byUuid, esNode) => { + if (!byUuid[esNode.id]) { + productStatus.totalUniqueInstanceCount++; + return { + ...byUuid, + [esNode.id]: { + node: esNode, + isNetNewUser: true + }, + }; + } + return byUuid; + }, productStatus.byUuid); + } + + if (product.name === KIBANA_SYSTEM_ID && liveKibanaInstance) { + const kibanaLiveUuid = get(liveKibanaInstance, 'kibana.uuid'); + if (kibanaLiveUuid && !productStatus.byUuid[kibanaLiveUuid]) { + productStatus.totalUniqueInstanceCount++; + productStatus.byUuid = { + [kibanaLiveUuid]: { + instance: liveKibanaInstance, + isNetNewUser: true + } + }; + } + } + return { ...products, [product.name]: productStatus, From 3f57210015b07300cc2caf3095532c0c445f7ef2 Mon Sep 17 00:00:00 2001 From: chrisronline Date: Tue, 24 Sep 2019 13:36:51 -0400 Subject: [PATCH 30/43] Fix translations --- .../translations/translations/ja-JP.json | 112 ------------------ .../translations/translations/zh-CN.json | 112 ------------------ 2 files changed, 224 deletions(-) diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index d2c2446b09777..57e4670571def 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -8241,9 +8241,6 @@ "xpack.monitoring.elasticsearch.nodes.diskFreeSpaceColumnTitle": "ディスクの空き容量", "xpack.monitoring.elasticsearch.nodes.jvmMemoryColumnTitle": "{javaVirtualMachine} メモリー", "xpack.monitoring.elasticsearch.nodes.loadAverageColumnTitle": "平均負荷", - "xpack.monitoring.elasticsearch.nodes.metribeatMigration.disableInternalCollectionDescription": "ご使用の Elasticsearch サーバーはすべて Metricbeat により監視されています。\n 但し、移行を完了させるには内部収集を無効にする必要があります。", - "xpack.monitoring.elasticsearch.nodes.metribeatMigration.disableInternalCollectionMigrationButtonLabel": "無効にして移行を完了させる", - "xpack.monitoring.elasticsearch.nodes.metribeatMigration.disableInternalCollectionTitle": "内部収集を無効にして移行を完了させる", "xpack.monitoring.elasticsearch.nodes.monitoringTablePlaceholder": "ノードをフィルタリング…", "xpack.monitoring.elasticsearch.nodes.nameColumnTitle": "名前", "xpack.monitoring.elasticsearch.nodes.routeTitle": "Elasticsearch - ノード", @@ -8311,10 +8308,6 @@ "xpack.monitoring.euiTable.isFullyMigratedLabel": "Metricbeat 収集", "xpack.monitoring.euiTable.isInternalCollectorLabel": "内部収集", "xpack.monitoring.euiTable.isPartiallyMigratedLabel": "内部収集と Metricbeat 収集", - "xpack.monitoring.euiTable.migrateButtonLabel": "移行", - "xpack.monitoring.euiTable.migrationStatusUnknown": "N/A", - "xpack.monitoring.euiTable.setupActionTitle": "セットアップアクション", - "xpack.monitoring.euiTable.setupStatusTitle": "セットアップステータス", "xpack.monitoring.feature.reserved.description": "ユーザーアクセスを許可するには、monitoring_user ロールも割り当てる必要があります。", "xpack.monitoring.featureRegistry.monitoringFeatureName": "スタック監視", "xpack.monitoring.formatNumbers.notAvailableLabel": "N/A", @@ -8436,58 +8429,32 @@ "xpack.monitoring.logstashNavigation.pipelineVersionDescription": "バージョンは {relativeLastSeen} 時点でアクティブ、初回検知 {relativeFirstSeen}", "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.configureMetricbeatDescription": "{file} にこれらの変更を加えます。", "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.configureMetricbeatTitle": "Metricbeat を構成して監視クラスターに送ります", - "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.disableInternalCollection.fullyMigratedStatusDescription": "内部収集からのドキュメントがありません。移行完了!", - "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.disableInternalCollection.fullyMigratedStatusTitle": "お疲れさまでした!", - "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.disableInternalCollection.partiallyMigratedStatusDescription": "最後の内部収集は {secondsSinceLastInternalCollectionLabel} 前に行われました。", "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.disableInternalCollectionDescription": "Elasticsearch 監視メトリックの内部収集を無効にします。本番クラスターの各サーバーの {monospace} を false に設定します。", "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.disableInternalCollectionTitle": "Elasticsearch 監視メトリックの内部収集を無効にする", "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.enableMetricbeatModuleDescription": "モジュールはデフォルトで {url} から Elasticsearch 監視メトリックを収集します。ローカル Elasticsearch サーバーのアドレスが異なる場合は、{module} ファイルのホスト設定で指定する必要があります。", "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.enableMetricbeatModuleTitle": "Metricbeat の Elasticsearch X-Pack モジュールの有効化と構成", - "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.fullyMigratedStatusDescription": "Metricbeat から監視データが送信され始めました!", - "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.fullyMigratedStatusTitle": "お疲れさまでした!", "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.installMetricbeatLinkText": "こちらの手順に従ってください", "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.installMetricbeatTitle": "Metricbeat を Elasticsearch と同じサーバーにインストール", - "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.metricbeatSecuritySetup": "セキュリティ機能が有効な場合、追加セットアップが必要な可能性があります。{link}", - "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.metricbeatSecuritySetupLinkText": "詳細をご覧ください。", - "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.partiallyMigratedStatusTitle": "現在も Elasticsearch の内部収集からデータが送信されています。", "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.startMetricbeatLinkText": "こちらの手順に従ってください", "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.startMetricbeatTitle": "Metricbeat を起動します", - "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.statusTitle": "移行ステータス", "xpack.monitoring.metricbeatMigration.flyout.closeButtonLabel": "閉じる", "xpack.monitoring.metricbeatMigration.flyout.doneButtonLabel": "完了", - "xpack.monitoring.metricbeatMigration.flyout.elasticsearchNode": "ノード", - "xpack.monitoring.metricbeatMigration.flyout.elasticsearchNodesTitle": "Elasticsearch ノード", - "xpack.monitoring.metricbeatMigration.flyout.flyoutTitle": "{instanceName} {instanceType} の Metricbeat への移行", - "xpack.monitoring.metricbeatMigration.flyout.kibanaInstance": "インスタンス", "xpack.monitoring.metricbeatMigration.flyout.nextButtonLabel": "次へ", "xpack.monitoring.metricbeatMigration.flyout.step1.monitoringUrlHelpText": "これは通常単一のインスタンスですが、複数ある場合は、すべてのインスタンス URL をコンマ区切りで入力します。\n Metricbeat インスタンスの実行には、Elasticsearch サーバーとの通信が必要です。", "xpack.monitoring.metricbeatMigration.flyout.step1.monitoringUrlLabel": "監視クラスター URL", "xpack.monitoring.metricbeatMigration.kibanaInstructions.configureMetricbeatDescription": "{file} にこれらの変更を加えます。", "xpack.monitoring.metricbeatMigration.kibanaInstructions.configureMetricbeatTitle": "Metricbeat を構成して監視クラスターに送ります", - "xpack.monitoring.metricbeatMigration.kibanaInstructions.disableInternalCollection.checkingStatusButtonLabel": "確認中...", - "xpack.monitoring.metricbeatMigration.kibanaInstructions.disableInternalCollection.checkStatusButtonLabel": "確認", "xpack.monitoring.metricbeatMigration.kibanaInstructions.disableInternalCollection.description": "Kibana 構成ファイル ({file}) に次の設定を追加します:", - "xpack.monitoring.metricbeatMigration.kibanaInstructions.disableInternalCollection.fullyMigratedStatusDescription": "内部収集からのドキュメントがありません。移行完了!", - "xpack.monitoring.metricbeatMigration.kibanaInstructions.disableInternalCollection.fullyMigratedStatusTitle": "お疲れさまでした!", "xpack.monitoring.metricbeatMigration.kibanaInstructions.disableInternalCollection.note": "{config} をデフォルト値のままにします ({defaultValue})。", - "xpack.monitoring.metricbeatMigration.kibanaInstructions.disableInternalCollection.partiallyMigratedStatusDescription": "最後の内部収集は {secondsSinceLastInternalCollectionLabel} 前に行われました。", "xpack.monitoring.metricbeatMigration.kibanaInstructions.disableInternalCollection.restartNote": "このステップには Kibana サーバーの再起動が必要です。サーバーの再起動が完了するまでエラーが表示されます。", "xpack.monitoring.metricbeatMigration.kibanaInstructions.disableInternalCollection.restartWarningTitle": "警告", - "xpack.monitoring.metricbeatMigration.kibanaInstructions.disableInternalCollection.statusDescription": "内部収集からのドキュメントがないことを確認してください。", "xpack.monitoring.metricbeatMigration.kibanaInstructions.disableInternalCollection.title": "Kibana 監視メトリックの内部収集を無効にする", "xpack.monitoring.metricbeatMigration.kibanaInstructions.enableMetricbeatModuleDescription": "モジュールはデフォルトで http://localhost:5601 から Kibana 監視メトリックを収集します。ローカル Kibana インスタンスのアドレスが異なる場合は、{file} ファイルの {hosts} 設定で指定する必要があります。", "xpack.monitoring.metricbeatMigration.kibanaInstructions.enableMetricbeatModuleTitle": "Metricbeat の Kibana X-Pack もウールの有効化と構成", - "xpack.monitoring.metricbeatMigration.kibanaInstructions.fullyMigratedStatusDescription": "Metricbeat から監視データが送信され始めました!", - "xpack.monitoring.metricbeatMigration.kibanaInstructions.fullyMigratedStatusTitle": "お疲れさまでした!", "xpack.monitoring.metricbeatMigration.kibanaInstructions.installMetricbeatLinkText": "こちらの手順に従ってください", "xpack.monitoring.metricbeatMigration.kibanaInstructions.installMetricbeatTitle": "Metricbeat を Kibana と同じサーバーにインストール", - "xpack.monitoring.metricbeatMigration.kibanaInstructions.metricbeatSecuritySetup": "セキュリティ機能が有効な場合、追加セットアップが必要な可能性があります。{link}", - "xpack.monitoring.metricbeatMigration.kibanaInstructions.metricbeatSecuritySetupLinkText": "詳細をご覧ください。", - "xpack.monitoring.metricbeatMigration.kibanaInstructions.partiallyMigratedStatusDescription": "検出には最長 {secondsAgo} 秒かかる場合がありますが、引き続きバックグラウンドで {timePeriod} 秒ごとに確認します。", - "xpack.monitoring.metricbeatMigration.kibanaInstructions.partiallyMigratedStatusTitle": "現在も Kibana の内部収集からデータが送信されています。", "xpack.monitoring.metricbeatMigration.kibanaInstructions.startMetricbeatLinkText": "こちらの手順に従ってください", "xpack.monitoring.metricbeatMigration.kibanaInstructions.startMetricbeatTitle": "Metricbeat を起動します", - "xpack.monitoring.metricbeatMigration.kibanaInstructions.statusTitle": "移行ステータス", "xpack.monitoring.metrics.apm.outputAckedEventsRate.ackedDescription": "アウトプットにより処理されたイベントです (再試行を含む)", "xpack.monitoring.metrics.apm.outputAckedEventsRate.ackedLabel": "承認済み", "xpack.monitoring.metrics.apm.outputAckedEventsRateTitle": "アウトプット承認イベントレート", @@ -9027,131 +8994,52 @@ "xpack.monitoring.summaryStatus.statusIconLabel": "ステータス: {status}", "xpack.monitoring.summaryStatus.statusIconTitle": "ステータス: {statusIcon}", "xpack.monitoring.uiExportsDescription": "Elastic Stack の監視です", - "xpack.monitoring.apm.instances.metricbeatMigration.detectedInstanceDescription": "インデックスによると、APM サーバーがあると思われます。下の「監視をセットアップ」をクリックして\n この APM サーバーの監視を開始してください。", - "xpack.monitoring.apm.instances.metricbeatMigration.detectedInstanceTitle": "APM サーバーが検出されました", - "xpack.monitoring.apm.metricbeatMigration.setupNewButtonLabel": "新規 APM サーバーの監視をセットアップ", - "xpack.monitoring.beats.instances.metricbeatMigration.detectedInstanceDescription": "インデックスによると、Beats インスタンスがあると思われます。下の「監視をセットアップ」をクリックして\n このインスタンスの監視を開始してください。", - "xpack.monitoring.beats.instances.metricbeatMigration.detectedInstanceTitle": "Beats インスタンスが検出されました", - "xpack.monitoring.beats.metricbeatMigration.setupNewButtonLabel": "新規 Beats インスタンスの監視をセットアップ", "xpack.monitoring.chart.timeSeries.zoomOut": "ズームアウト", - "xpack.monitoring.cluster.overview.apmPanel.setupModeNodesTooltip.disableInternal": "すべてのサーバーが Metricbeat によって監視されていますが、内部収集を\n オフにする必要があります。フラッグアイコンをクリックして、サーバーリストページにアクセスし、内部収集を無効にしてください。", - "xpack.monitoring.cluster.overview.apmPanel.setupModeNodesTooltip.oneInternal": "Metricbeat により監視されていないサーバーが少なくとも 1 つあります。フラッグ\n アイコンをクリックして、サーバーリストページにアクセスし、各サーバーの詳細なステータスを確認してください。", - "xpack.monitoring.cluster.overview.beatsPanel.setupModeNodesTooltip.disableInternal": "すべてのインスタンスが Metricbeat によって監視されていますが、内部収集を\n オフにする必要があります。フラッグアイコンをクリックして、インスタンスリストページにアクセスし、内部収集を無効にしてください。", - "xpack.monitoring.cluster.overview.beatsPanel.setupModeNodesTooltip.oneInternal": "Metricbeat により監視されていないインスタンスが少なくとも 1 つあります。フラッグ\n アイコンをクリックして、インスタンスリストページにアクセスし、各インスタンスの詳細なステータスを確認してください。", - "xpack.monitoring.cluster.overview.elasticsearchPanel.setupModeNodesTooltip.disableInternal": "すべてのノードが Metricbeat によって監視されていますが、内部収集を上のメニューバーの\n フラッグアイコンをクリックして、ノードリストページにアクセスし、内部収集を無効にしてください。", - "xpack.monitoring.cluster.overview.elasticsearchPanel.setupModeNodesTooltip.oneInternal": "Metricbeat により監視されていないノードが少なくとも 1 つあります。フラッグアイコンをクリックして、ノード\n リストページにアクセスし、各ノードの詳細なステータスを確認してください。", - "xpack.monitoring.cluster.overview.kibanaPanel.setupModeNodesTooltip.disableInternal": "すべてのインスタンスが Metricbeat によって監視されていますが、内部収集を\n オフにする必要があります。フラッグアイコンをクリックして、インスタンスリストページにアクセスし、内部収集を無効にしてください。", - "xpack.monitoring.cluster.overview.kibanaPanel.setupModeNodesTooltip.oneInternal": "Metricbeat により監視されていないインスタンスが少なくとも 1 つあります。フラッグ\n アイコンをクリックして、インスタンスリストページにアクセスし、各インスタンスの詳細なステータスを確認してください。", - "xpack.monitoring.cluster.overview.logstashPanel.setupModeNodesTooltip.disableInternal": "すべてのノードが Metricbeat によって監視されていますが、内部収集を\n オフにする必要があります。フラッグアイコンをクリックして、ノードリストページにアクセスし、内部収集を無効にしてください。", - "xpack.monitoring.cluster.overview.logstashPanel.setupModeNodesTooltip.oneInternal": "Metricbeat により監視されていないノードが少なくとも 1 つあります。フラッグ\n アイコンをクリックして、ノードリストページにアクセスし、各ノードの詳細なステータスを確認してください。", - "xpack.monitoring.elasticsearch.metricbeatMigration.setupNewButtonLabel": "新規 Elasticsearch ノードの監視をセットアップ", - "xpack.monitoring.elasticsearch.nodes.metribeatMigration.netNewUserDescription": "監視データは検出されませんでしたが、次の Elasticsearch ノードが検出されました。\n 検出された各ノードとセットアップボタンが下に表示されます。このボタンをクリックすると、\n 各ノードの監視を有効にするプロセスをご案内します。", - "xpack.monitoring.elasticsearch.nodes.metribeatMigration.netNewUserTitle": "監視データが検出されませんでした", "xpack.monitoring.errors.monitoringLicenseErrorDescription": "クラスター = 「{clusterId}」のライセンス情報が見つかりませんでした。クラスターのマスターノードサーバーログにエラーや警告がないか確認してください。", "xpack.monitoring.errors.monitoringLicenseErrorTitle": "監視ライセンスエラー", - "xpack.monitoring.euiTable.isNetNewUserLabel": "監視が検出されませんでした", - "xpack.monitoring.euiTable.setupButtonLabel": "セットアップ", - "xpack.monitoring.kibana.metricbeatMigration.setupNewButtonLabel": "新規 Kibana インスタンスの監視をセットアップ", - "xpack.monitoring.kibana.nodes.metribeatMigration.netNewUserDescription": "監視データは検出されませんでしたが、次の Kibana インスタンスが検出されました。\n 検出されたインスタンスとセットアップボタンが下に表示されます。このボタンをクリックすると、\n このインスタンスの監視を有効にするプロセスをご案内します。", - "xpack.monitoring.kibana.nodes.metribeatMigration.netNewUserTitle": "監視データが検出されませんでした", "xpack.monitoring.logs.reason.defaultMessage": "ログデータが見つからず、理由を診断することができません。{link}", "xpack.monitoring.logs.reason.defaultMessageLink": "正しくセットアップされていることを確認してください。", "xpack.monitoring.logs.reason.defaultTitle": "ログデータが見つかりませんでした", - "xpack.monitoring.logstash.metricbeatMigration.setupNewButtonLabel": "新規 Logstash サーバーの監視をセットアップ", - "xpack.monitoring.logstash.nodes.metribeatMigration.netNewUserDescription": "インデックスによると、Logstash ノードがあると思われます。下の「監視をセットアップ」をクリックして\n このノードの監視を開始してください。", - "xpack.monitoring.logstash.nodes.metribeatMigration.netNewUserTitle": "監視データが検出されませんでした", "xpack.monitoring.metricbeatMigration.apmInstructions.configureMetricbeatDescription": "{file} にこれらの変更を加えます。", "xpack.monitoring.metricbeatMigration.apmInstructions.configureMetricbeatTitle": "Metricbeat を構成して監視クラスターに送ります", - "xpack.monitoring.metricbeatMigration.apmInstructions.disableInternalCollection.checkingStatusButtonLabel": "確認中...", - "xpack.monitoring.metricbeatMigration.apmInstructions.disableInternalCollection.checkStatusButtonLabel": "確認", "xpack.monitoring.metricbeatMigration.apmInstructions.disableInternalCollection.description": "APM サーバーの構成ファイル ({file}) に次の設定を追加します:", - "xpack.monitoring.metricbeatMigration.apmInstructions.disableInternalCollection.fullyMigratedStatusDescription": "内部収集からのドキュメントがありません。移行完了!", - "xpack.monitoring.metricbeatMigration.apmInstructions.disableInternalCollection.fullyMigratedStatusTitle": "お疲れさまでした!", "xpack.monitoring.metricbeatMigration.apmInstructions.disableInternalCollection.note": "この変更後、APM サーバーの再起動が必要です。", - "xpack.monitoring.metricbeatMigration.apmInstructions.disableInternalCollection.partiallyMigratedStatusDescription": "最後の内部収集は {secondsSinceLastInternalCollectionLabel} 前に行われました。", - "xpack.monitoring.metricbeatMigration.apmInstructions.disableInternalCollection.statusDescription": "内部収集からのドキュメントがないことを確認してください。", "xpack.monitoring.metricbeatMigration.apmInstructions.disableInternalCollection.title": "APM サーバーの監視メトリックの内部収集を無効にする", "xpack.monitoring.metricbeatMigration.apmInstructions.enableMetricbeatModuleDescription": "モジュールはデフォルトで http://localhost:5066 から APM サーバーの監視メトリックを収集します。ローカル APM サーバーのアドレスが異なる場合は、{file} ファイルの {hosts} 設定で指定する必要があります。", "xpack.monitoring.metricbeatMigration.apmInstructions.enableMetricbeatModuleTitle": "Metricbeat の Beat X-Pack モジュールの有効化と構成", - "xpack.monitoring.metricbeatMigration.apmInstructions.fullyMigratedStatusDescription": "Metricbeat から監視データが送信され始めました!", - "xpack.monitoring.metricbeatMigration.apmInstructions.fullyMigratedStatusTitle": "お疲れさまでした!", "xpack.monitoring.metricbeatMigration.apmInstructions.installMetricbeatLinkText": "こちらの手順に従ってください", "xpack.monitoring.metricbeatMigration.apmInstructions.installMetricbeatTitle": "Metricbeat を APM サーバーと同じサーバーにインストール", - "xpack.monitoring.metricbeatMigration.apmInstructions.isInternalCollectorStatusTitle": "この APM サーバーの Metricbeat からの監視データが検出されていません。\n 引き続きバックグラウンドで確認を続けます。", - "xpack.monitoring.metricbeatMigration.apmInstructions.metricbeatSecuritySetup": "セキュリティ機能が有効な場合、追加セットアップが必要な可能性があります。{link}", - "xpack.monitoring.metricbeatMigration.apmInstructions.metricbeatSecuritySetupLinkText": "詳細をご覧ください。", - "xpack.monitoring.metricbeatMigration.apmInstructions.partiallyMigratedStatusDescription": "検出には最長 {secondsAgo} 秒かかる場合がありますが、引き続きバックグラウンドで {timePeriod} 秒ごとに確認します。", - "xpack.monitoring.metricbeatMigration.apmInstructions.partiallyMigratedStatusTitle": "現在も APM サーバーの内部収集からデータが送信されています。", "xpack.monitoring.metricbeatMigration.apmInstructions.startMetricbeatLinkText": "こちらの手順に従ってください", "xpack.monitoring.metricbeatMigration.apmInstructions.startMetricbeatTitle": "Metricbeat を起動します", - "xpack.monitoring.metricbeatMigration.apmInstructions.statusTitle": "移行ステータス", "xpack.monitoring.metricbeatMigration.beatsInstructions.configureMetricbeatDescription": "{file} にこれらの変更を加えます。", "xpack.monitoring.metricbeatMigration.beatsInstructions.configureMetricbeatTitle": "Metricbeat を構成して監視クラスターに送ります", - "xpack.monitoring.metricbeatMigration.beatsInstructions.disableInternalCollection.checkingStatusButtonLabel": "確認中...", - "xpack.monitoring.metricbeatMigration.beatsInstructions.disableInternalCollection.checkStatusButtonLabel": "確認", "xpack.monitoring.metricbeatMigration.beatsInstructions.disableInternalCollection.description": "{beatType} の構成ファイル ({file}) に次の設定を追加します:", - "xpack.monitoring.metricbeatMigration.beatsInstructions.disableInternalCollection.fullyMigratedStatusDescription": "内部収集からのドキュメントがありません。移行完了!", - "xpack.monitoring.metricbeatMigration.beatsInstructions.disableInternalCollection.fullyMigratedStatusTitle": "お疲れさまでした!", "xpack.monitoring.metricbeatMigration.beatsInstructions.disableInternalCollection.note": "この変更後、{beatType} の再起動が必要です。", - "xpack.monitoring.metricbeatMigration.beatsInstructions.disableInternalCollection.partiallyMigratedStatusDescription": "最後の内部収集は {secondsSinceLastInternalCollectionLabel} 前に行われました。", - "xpack.monitoring.metricbeatMigration.beatsInstructions.disableInternalCollection.statusDescription": "内部収集からのドキュメントがないことを確認してください。", "xpack.monitoring.metricbeatMigration.beatsInstructions.disableInternalCollection.title": "{beatType} の監視メトリックの内部収集を無効にする", "xpack.monitoring.metricbeatMigration.beatsInstructions.enableMetricbeatModuleDescription": "モジュールはデフォルトで http://localhost:5066 から {beatType} 監視メトリックを収集します。監視されている {beatType} インスタンスのアドレスが異なる場合は、{file} ファイルの {hosts} 設定で指定する必要があります。", "xpack.monitoring.metricbeatMigration.beatsInstructions.enableMetricbeatModuleHttpEnabledDirections": "Metricbeat が実行中の {beatType} からメトリックを収集するには、{link} 必要があります。", "xpack.monitoring.metricbeatMigration.beatsInstructions.enableMetricbeatModuleHttpEnabledDirectionsLinkText": "監視されている {beatType} の HTTP エンドポイントを有効にする", "xpack.monitoring.metricbeatMigration.beatsInstructions.enableMetricbeatModuleTitle": "Metricbeat の Beat X-Pack モジュールの有効化と構成", - "xpack.monitoring.metricbeatMigration.beatsInstructions.fullyMigratedStatusDescription": "Metricbeat から監視データが送信され始めました!", - "xpack.monitoring.metricbeatMigration.beatsInstructions.fullyMigratedStatusTitle": "お疲れさまでした!", "xpack.monitoring.metricbeatMigration.beatsInstructions.installMetricbeatLinkText": "こちらの手順に従ってください", "xpack.monitoring.metricbeatMigration.beatsInstructions.installMetricbeatTitle": "Metricbeat を {beatType} と同じサーバーにインストール", - "xpack.monitoring.metricbeatMigration.beatsInstructions.isInternalCollectorStatusTitle": "この Beat の Metricbeat からの監視データが検出されていません。\n 引き続きバックグラウンドで確認を続けます。", - "xpack.monitoring.metricbeatMigration.beatsInstructions.metricbeatSecuritySetup": "セキュリティ機能が有効な場合、追加セットアップが必要な可能性があります。{link}", - "xpack.monitoring.metricbeatMigration.beatsInstructions.metricbeatSecuritySetupLinkText": "詳細をご覧ください。", - "xpack.monitoring.metricbeatMigration.beatsInstructions.partiallyMigratedStatusDescription": "検出には最長 {secondsAgo} 秒かかる場合がありますが、引き続きバックグラウンドで {timePeriod} 秒ごとに確認します。", - "xpack.monitoring.metricbeatMigration.beatsInstructions.partiallyMigratedStatusTitle": "現在も Beat の内部収集からデータが送信されています。", "xpack.monitoring.metricbeatMigration.beatsInstructions.startMetricbeatLinkText": "こちらの手順に従ってください", "xpack.monitoring.metricbeatMigration.beatsInstructions.startMetricbeatTitle": "Metricbeat を起動します", - "xpack.monitoring.metricbeatMigration.beatsInstructions.statusTitle": "移行ステータス", - "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.statusTitleNewUser": "監視ステータス", - "xpack.monitoring.metricbeatMigration.flyout.flyoutTitleNewUser": "Metricbeat で {instanceName} {instanceType} を監視", - "xpack.monitoring.metricbeatMigration.flyout.instance": "インスタンス", - "xpack.monitoring.metricbeatMigration.flyout.noClusterUuidCheckboxLabel": "はい、\n この {productName} {typeText} スタンドアロンクラスターを調べる必要があることを理解しています。", - "xpack.monitoring.metricbeatMigration.flyout.noClusterUuidDescription": "この {productName} {typeText} は Elasticsearch クラスターに接続されていないため、完全に移行された時点で、この {productName} {typeText} はこのクラスターではなくスタンドアロンクラスターに表示されます。 {link}", "xpack.monitoring.metricbeatMigration.flyout.noClusterUuidTitle": "クラスターが検出されてませんでした", - "xpack.monitoring.metricbeatMigration.flyout.node": "ノード", - "xpack.monitoring.metricbeatMigration.kibanaInstructions.statusTitleNewUser": "監視ステータス", "xpack.monitoring.metricbeatMigration.logstashInstructions.configureMetricbeatDescription": "{file} にこれらの変更を加えます。", "xpack.monitoring.metricbeatMigration.logstashInstructions.configureMetricbeatTitle": "Metricbeat を構成して監視クラスターに送ります", - "xpack.monitoring.metricbeatMigration.logstashInstructions.disableInternalCollection.checkingStatusButtonLabel": "確認中...", - "xpack.monitoring.metricbeatMigration.logstashInstructions.disableInternalCollection.checkStatusButtonLabel": "確認", "xpack.monitoring.metricbeatMigration.logstashInstructions.disableInternalCollection.description": "Logstash 構成ファイル ({file}) に次の設定を追加します:", - "xpack.monitoring.metricbeatMigration.logstashInstructions.disableInternalCollection.fullyMigratedStatusDescription": "内部収集からのドキュメントがありません。移行完了!", - "xpack.monitoring.metricbeatMigration.logstashInstructions.disableInternalCollection.fullyMigratedStatusTitle": "お疲れさまでした!", "xpack.monitoring.metricbeatMigration.logstashInstructions.disableInternalCollection.note": "この変更後、Logstash の再起動が必要です。", - "xpack.monitoring.metricbeatMigration.logstashInstructions.disableInternalCollection.partiallyMigratedStatusDescription": "最後の内部収集は {secondsSinceLastInternalCollectionLabel} 前に行われました。", - "xpack.monitoring.metricbeatMigration.logstashInstructions.disableInternalCollection.statusDescription": "内部収集からのドキュメントがないことを確認してください。", "xpack.monitoring.metricbeatMigration.logstashInstructions.disableInternalCollection.title": "Logstash 監視メトリックの内部収集を無効にする", "xpack.monitoring.metricbeatMigration.logstashInstructions.enableMetricbeatModuleDescription": "モジュールはデフォルトで http://localhost:9600 から Logstash 監視メトリックを収集します。ローカル Logstash インスタンスのアドレスが異なる場合は、{file} ファイルの {hosts} 設定で指定する必要があります。", "xpack.monitoring.metricbeatMigration.logstashInstructions.enableMetricbeatModuleTitle": "Metricbeat の Logstash X-Pack もウールの有効化と構成", - "xpack.monitoring.metricbeatMigration.logstashInstructions.fullyMigratedStatusDescription": "Metricbeat から監視データが送信され始めました!", - "xpack.monitoring.metricbeatMigration.logstashInstructions.fullyMigratedStatusTitle": "お疲れさまでした!", "xpack.monitoring.metricbeatMigration.logstashInstructions.installMetricbeatLinkText": "こちらの手順に従ってください", "xpack.monitoring.metricbeatMigration.logstashInstructions.installMetricbeatTitle": "Metricbeat を Logstash と同じサーバーにインストール", - "xpack.monitoring.metricbeatMigration.logstashInstructions.isInternalCollectorStatusTitle": "この Metricbeat ノードの Metricbeat からの監視データが検出されていません。\n 引き続きバックグラウンドで確認を続けます。", - "xpack.monitoring.metricbeatMigration.logstashInstructions.metricbeatSecuritySetup": "セキュリティ機能が有効な場合、追加セットアップが必要な可能性があります。{link}", - "xpack.monitoring.metricbeatMigration.logstashInstructions.metricbeatSecuritySetupLinkText": "詳細をご覧ください。", - "xpack.monitoring.metricbeatMigration.logstashInstructions.partiallyMigratedStatusDescription": "検出には最長 {secondsAgo} 秒かかる場合がありますが、引き続きバックグラウンドで {timePeriod} 秒ごとに確認します。", - "xpack.monitoring.metricbeatMigration.logstashInstructions.partiallyMigratedStatusTitle": "現在も Logstash の内部収集からデータが送信されています。", "xpack.monitoring.metricbeatMigration.logstashInstructions.startMetricbeatLinkText": "こちらの手順に従ってください", "xpack.monitoring.metricbeatMigration.logstashInstructions.startMetricbeatTitle": "Metricbeat を起動します", - "xpack.monitoring.metricbeatMigration.logstashInstructions.statusTitle": "移行ステータス", "xpack.monitoring.noData.blurbs.cloudDeploymentDescription": "次の場所に戻ってください: ", "xpack.monitoring.noData.blurbs.cloudDeploymentDescriptionMore": "Elastic Cloud での監視の詳細は、 ", "xpack.monitoring.noData.blurbs.cloudDeploymentTitle": "監視データはこちらに表示されません。", "xpack.monitoring.noData.explanations.exportersCloudDescription": "Elastic Cloud では、監視データが専用の監視クラスターに格納されます。", - "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.isInternalCollectorStatusTitle": "この Elasticsearch ノードの Metricbeat からの監視データが検出されていません。\n 引き続きバックグラウンドで確認を続けます。", - "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.partiallyMigratedStatusDescription": "検出には最長 {secondsAgo} 秒かかる場合がありますが、引き続きバックグラウンドで確認します。", - "xpack.monitoring.metricbeatMigration.kibanaInstructions.isInternalCollectorStatusTitle": "この Kibana インスタンスの Metricbeat からの監視データが検出されていません。\n 引き続きバックグラウンドで確認を続けます。", "xpack.remoteClusters.addAction.clusterNameAlreadyExistsErrorMessage": "「{clusterName}」という名前のクラスターが既に存在します。", "xpack.remoteClusters.addAction.errorTitle": "クラスターの追加中にエラーが発生", "xpack.remoteClusters.addAction.failedDefaultErrorMessage": "{statusCode} エラーでリクエスト失敗: {message}", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index a0cfdbe2c03e9..bc128d6002b88 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -8243,9 +8243,6 @@ "xpack.monitoring.elasticsearch.nodes.diskFreeSpaceColumnTitle": "磁盘可用空间", "xpack.monitoring.elasticsearch.nodes.jvmMemoryColumnTitle": "{javaVirtualMachine} 内存", "xpack.monitoring.elasticsearch.nodes.loadAverageColumnTitle": "负载平均值", - "xpack.monitoring.elasticsearch.nodes.metribeatMigration.disableInternalCollectionDescription": "系统将使用 Metricbeat 监测所有 Elasticsearch 服务器,\n 但您需要禁用内部收集以完成迁移。", - "xpack.monitoring.elasticsearch.nodes.metribeatMigration.disableInternalCollectionMigrationButtonLabel": "禁用并完成迁移", - "xpack.monitoring.elasticsearch.nodes.metribeatMigration.disableInternalCollectionTitle": "禁用内部收集以完成迁移", "xpack.monitoring.elasticsearch.nodes.monitoringTablePlaceholder": "筛选节点……", "xpack.monitoring.elasticsearch.nodes.nameColumnTitle": "名称", "xpack.monitoring.elasticsearch.nodes.routeTitle": "Elasticsearch - 节点", @@ -8313,10 +8310,6 @@ "xpack.monitoring.euiTable.isFullyMigratedLabel": "Metricbeat 收集", "xpack.monitoring.euiTable.isInternalCollectorLabel": "内部收集", "xpack.monitoring.euiTable.isPartiallyMigratedLabel": "内部收集和 Metricbeat 收集", - "xpack.monitoring.euiTable.migrateButtonLabel": "迁移", - "xpack.monitoring.euiTable.migrationStatusUnknown": "不适用", - "xpack.monitoring.euiTable.setupActionTitle": "设置操作", - "xpack.monitoring.euiTable.setupStatusTitle": "设置状态", "xpack.monitoring.feature.reserved.description": "要向用户授予访问权限,还应分配 monitoring_user 角色。", "xpack.monitoring.featureRegistry.monitoringFeatureName": "堆栈监测", "xpack.monitoring.formatNumbers.notAvailableLabel": "不适用", @@ -8438,58 +8431,32 @@ "xpack.monitoring.logstashNavigation.pipelineVersionDescription": "活动版本 {relativeLastSeen} 和首次看到 {relativeFirstSeen}", "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.configureMetricbeatDescription": "在 {file} 文件中进行这些更改。", "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.configureMetricbeatTitle": "配置 Metricbeat 以发送至监测集群", - "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.disableInternalCollection.fullyMigratedStatusDescription": "我们未看到任何来自内部收集的文档。迁移完成!", - "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.disableInternalCollection.fullyMigratedStatusTitle": "恭喜您!", - "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.disableInternalCollection.partiallyMigratedStatusDescription": "上次内部收集发生于 {secondsSinceLastInternalCollectionLabel}前。", "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.disableInternalCollectionDescription": "禁用 Elasticsearch 监测指标的内部收集。在生产集群中的每个服务器上将 {monospace} 设置为 false。", "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.disableInternalCollectionTitle": "禁用 Elasticsearch 监测指标的内部收集", "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.enableMetricbeatModuleDescription": "默认情况下,该模块将从 {url} 收集 Elasticsearch 监测指标。如果本地 Elasticsearch 服务器有不同的地址,则必须通过 {module} 文件中的 hosts 设置来进行指定。", "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.enableMetricbeatModuleTitle": "在 Metricbeat 中启用并配置 Elasticsearch x-pack 模块", - "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.fullyMigratedStatusDescription": "我们现在看到来自 Metricbeat 的监测数据传送!", - "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.fullyMigratedStatusTitle": "恭喜您!", "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.installMetricbeatLinkText": "按照此处的说明执行操作", "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.installMetricbeatTitle": "在安装 Elasticsearch 的同一台服务器上安装 Metricbeat", - "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.metricbeatSecuritySetup": "如果已启用安全功能,则可能需要更多的设置。{link}", - "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.metricbeatSecuritySetupLinkText": "查看更多信息。", - "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.partiallyMigratedStatusTitle": "我们仍看到数据来自 Elasticsearch 的内部收集。", "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.startMetricbeatLinkText": "按照此处的说明执行操作", "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.startMetricbeatTitle": "启动 Metricbeat", - "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.statusTitle": "迁移状态", "xpack.monitoring.metricbeatMigration.flyout.closeButtonLabel": "关闭", "xpack.monitoring.metricbeatMigration.flyout.doneButtonLabel": "完成", - "xpack.monitoring.metricbeatMigration.flyout.elasticsearchNode": "节点", - "xpack.monitoring.metricbeatMigration.flyout.elasticsearchNodesTitle": "Elasticsearch 节点", - "xpack.monitoring.metricbeatMigration.flyout.flyoutTitle": "将 {instanceName} {instanceType} 迁移到 Metricbeat", - "xpack.monitoring.metricbeatMigration.flyout.kibanaInstance": "实例", "xpack.monitoring.metricbeatMigration.flyout.nextButtonLabel": "下一个", "xpack.monitoring.metricbeatMigration.flyout.step1.monitoringUrlHelpText": "这通常是单个实例,但如果您有多个,请输入所有实例 url,以逗号分隔。\n 切记运行的 Metricbeat 实例需要能够与这些 Elasticsearch 实例通信。", "xpack.monitoring.metricbeatMigration.flyout.step1.monitoringUrlLabel": "监测集群 URL", "xpack.monitoring.metricbeatMigration.kibanaInstructions.configureMetricbeatDescription": "在 {file} 文件中进行这些更改。", "xpack.monitoring.metricbeatMigration.kibanaInstructions.configureMetricbeatTitle": "配置 Metricbeat 以发送至监测集群", - "xpack.monitoring.metricbeatMigration.kibanaInstructions.disableInternalCollection.checkingStatusButtonLabel": "正在检查......", - "xpack.monitoring.metricbeatMigration.kibanaInstructions.disableInternalCollection.checkStatusButtonLabel": "检查", "xpack.monitoring.metricbeatMigration.kibanaInstructions.disableInternalCollection.description": "在 Kibana 配置文件 ({file}) 中添加以下设置:", - "xpack.monitoring.metricbeatMigration.kibanaInstructions.disableInternalCollection.fullyMigratedStatusDescription": "我们未看到任何来自内部收集的文档。迁移完成!", - "xpack.monitoring.metricbeatMigration.kibanaInstructions.disableInternalCollection.fullyMigratedStatusTitle": "恭喜您!", "xpack.monitoring.metricbeatMigration.kibanaInstructions.disableInternalCollection.note": "将 {config} 设置为其默认值 ({defaultValue})。", - "xpack.monitoring.metricbeatMigration.kibanaInstructions.disableInternalCollection.partiallyMigratedStatusDescription": "上次内部收集发生于 {secondsSinceLastInternalCollectionLabel}前。", "xpack.monitoring.metricbeatMigration.kibanaInstructions.disableInternalCollection.restartNote": "此步骤需要您重新启动 Kibana 服务器。在服务器再次运行之前应会看到错误。", "xpack.monitoring.metricbeatMigration.kibanaInstructions.disableInternalCollection.restartWarningTitle": "警告", - "xpack.monitoring.metricbeatMigration.kibanaInstructions.disableInternalCollection.statusDescription": "确认没有文档来自内部收集。", "xpack.monitoring.metricbeatMigration.kibanaInstructions.disableInternalCollection.title": "禁用 Kibana 监测指标的内部收集", "xpack.monitoring.metricbeatMigration.kibanaInstructions.enableMetricbeatModuleDescription": "该模块将默认从 http://localhost:5601 收集 Kibana 监测指标。如果本地 Kibana 实例有不同的地址,则必须通过 {file} 文件中的 {hosts} 设置进行指定。", "xpack.monitoring.metricbeatMigration.kibanaInstructions.enableMetricbeatModuleTitle": "在 Metricbeat 中启用并配置 Kibana x-pack 模块", - "xpack.monitoring.metricbeatMigration.kibanaInstructions.fullyMigratedStatusDescription": "我们现在看到来自 Metricbeat 的监测数据传送!", - "xpack.monitoring.metricbeatMigration.kibanaInstructions.fullyMigratedStatusTitle": "恭喜您!", "xpack.monitoring.metricbeatMigration.kibanaInstructions.installMetricbeatLinkText": "按照此处的说明执行操作", "xpack.monitoring.metricbeatMigration.kibanaInstructions.installMetricbeatTitle": "在安装 Kibana 的同一台服务器上安装 Metricbeat", - "xpack.monitoring.metricbeatMigration.kibanaInstructions.metricbeatSecuritySetup": "如果已启用安全功能,则可能需要更多的设置。{link}", - "xpack.monitoring.metricbeatMigration.kibanaInstructions.metricbeatSecuritySetupLinkText": "查看更多信息。", - "xpack.monitoring.metricbeatMigration.kibanaInstructions.partiallyMigratedStatusDescription": "请注意,检测最多花费 {secondsAgo} 秒,但我们在后台每 {timePeriod} 秒检查一次。", - "xpack.monitoring.metricbeatMigration.kibanaInstructions.partiallyMigratedStatusTitle": "我们仍看到数据来自 Kibana 的内部收集。", "xpack.monitoring.metricbeatMigration.kibanaInstructions.startMetricbeatLinkText": "按照此处的说明执行操作", "xpack.monitoring.metricbeatMigration.kibanaInstructions.startMetricbeatTitle": "启动 Metricbeat", - "xpack.monitoring.metricbeatMigration.kibanaInstructions.statusTitle": "迁移状态", "xpack.monitoring.metrics.apm.outputAckedEventsRate.ackedDescription": "输出处理的事件(包括重试)", "xpack.monitoring.metrics.apm.outputAckedEventsRate.ackedLabel": "已确认", "xpack.monitoring.metrics.apm.outputAckedEventsRateTitle": "输出已确认事件速率", @@ -9029,131 +8996,52 @@ "xpack.monitoring.summaryStatus.statusIconLabel": "状态:{status}", "xpack.monitoring.summaryStatus.statusIconTitle": "状态:{statusIcon}", "xpack.monitoring.uiExportsDescription": "Elastic Stack 的 Monitoring 组件", - "xpack.monitoring.apm.instances.metricbeatMigration.detectedInstanceDescription": "基于您的索引,我们认为您可能有 APM Server。单击下面的“设置监测”\n 按钮以开始监测此 APM Server。", - "xpack.monitoring.apm.instances.metricbeatMigration.detectedInstanceTitle": "检测到 APM Server", - "xpack.monitoring.apm.metricbeatMigration.setupNewButtonLabel": "为新的 APM Server 设置监测", - "xpack.monitoring.beats.instances.metricbeatMigration.detectedInstanceDescription": "基于您的索引,我们认为您可能有 Beats 实例。单击下面的“设置监测”\n 按钮以开始监测此实例。", - "xpack.monitoring.beats.instances.metricbeatMigration.detectedInstanceTitle": "检测到 Beats 实例", - "xpack.monitoring.beats.metricbeatMigration.setupNewButtonLabel": "为新的 Beats 实例设置监测", "xpack.monitoring.chart.timeSeries.zoomOut": "缩小", - "xpack.monitoring.cluster.overview.apmPanel.setupModeNodesTooltip.disableInternal": "正在使用 Metricbeat 监测所有服务器,但内部收集仍需要\n 关闭。单击旗帜图标可访问服务器列表页面以及禁用内部收集。", - "xpack.monitoring.cluster.overview.apmPanel.setupModeNodesTooltip.oneInternal": "至少有一个服务器未使用 Metricbeat 进行监测。单击旗帜\n 图标可访问服务器列表页面以及详细了解每个服务器的状态。", - "xpack.monitoring.cluster.overview.beatsPanel.setupModeNodesTooltip.disableInternal": "正在使用 Metricbeat 监测所有实例,但内部收集仍需要\n 关闭。单击旗帜图标可访问实例列表页面以及禁用内部收集。", - "xpack.monitoring.cluster.overview.beatsPanel.setupModeNodesTooltip.oneInternal": "至少有一个实例未使用 Metricbeat 进行监测。单击旗帜\n 图标可访问实例列表页面以及详细了解每个实例的状态。", - "xpack.monitoring.cluster.overview.elasticsearchPanel.setupModeNodesTooltip.disableInternal": "正在使用 Metricbeat 监测所有节点,但内部收集仍需要关闭。单击\n 旗帜图标可访问节点列表页面以及禁用内部收集。", - "xpack.monitoring.cluster.overview.elasticsearchPanel.setupModeNodesTooltip.oneInternal": "至少有一个节点未使用 Metricbeat 进行监测。单击旗帜图标可访问节点\n 列表页面以及详细了解每个节点的状态。", - "xpack.monitoring.cluster.overview.kibanaPanel.setupModeNodesTooltip.disableInternal": "正在使用 Metricbeat 监测所有实例,但内部收集仍需要\n 关闭。单击旗帜图标可访问实例列表页面以及禁用内部收集。", - "xpack.monitoring.cluster.overview.kibanaPanel.setupModeNodesTooltip.oneInternal": "至少有一个实例未使用 Metricbeat 进行监测。单击旗帜\n 图标可访问实例列表页面以及详细了解每个实例的状态。", - "xpack.monitoring.cluster.overview.logstashPanel.setupModeNodesTooltip.disableInternal": "正在使用 Metricbeat 监测所有节点,但内部收集仍需要\n 关闭。单击旗帜图标可访问节点列表页面以及禁用内部收集。", - "xpack.monitoring.cluster.overview.logstashPanel.setupModeNodesTooltip.oneInternal": "至少有一个节点未使用 Metricbeat 进行监测。单击旗帜\n 图标可访问节点列表页面以及详细了解每个节点的状态。", - "xpack.monitoring.elasticsearch.metricbeatMigration.setupNewButtonLabel": "为新的 Elasticsearch 节点设置监测", - "xpack.monitoring.elasticsearch.nodes.metribeatMigration.netNewUserDescription": "我们未检测到任何监测数据,但我们却检测到以下 Elasticsearch 节点。\n 检测到的每个节点与相应的“设置”按钮在下面一起列出。单击此按钮,系统将指导您完成\n 为每个节点启用监测的过程。", - "xpack.monitoring.elasticsearch.nodes.metribeatMigration.netNewUserTitle": "未检测到任何监测数据", "xpack.monitoring.errors.monitoringLicenseErrorDescription": "无法找到集群“{clusterId}”的许可信息。请在集群的主节点服务器日志中查看相关错误或警告。", "xpack.monitoring.errors.monitoringLicenseErrorTitle": "监测许可错误", - "xpack.monitoring.euiTable.isNetNewUserLabel": "未检测到监测", - "xpack.monitoring.euiTable.setupButtonLabel": "设置", - "xpack.monitoring.kibana.metricbeatMigration.setupNewButtonLabel": "为新的 Kibana 实例设置监测", - "xpack.monitoring.kibana.nodes.metribeatMigration.netNewUserDescription": "我们未检测到任何监测数据,但我们却检测到以下 Kibana 实例。\n 该检测到的实例与相应的“设置”按钮在下面一起列出。单击此按钮,系统将指导您完成\n 为此实例启用监测的过程。", - "xpack.monitoring.kibana.nodes.metribeatMigration.netNewUserTitle": "未检测到任何监测数据", "xpack.monitoring.logs.reason.defaultMessage": "我们未找到任何日志数据,我们无法诊断原因。{link}", "xpack.monitoring.logs.reason.defaultMessageLink": "请确认您的设置正确。", "xpack.monitoring.logs.reason.defaultTitle": "未找到任何日志数据", - "xpack.monitoring.logstash.metricbeatMigration.setupNewButtonLabel": "为新的 Logstash 节点设置监测", - "xpack.monitoring.logstash.nodes.metribeatMigration.netNewUserDescription": "基于您的索引,我们认为您可能有 Logstash 节点。单击下面的“设置监测”\n 按钮以开始监测此节点。", - "xpack.monitoring.logstash.nodes.metribeatMigration.netNewUserTitle": "未检测到任何监测数据", "xpack.monitoring.metricbeatMigration.apmInstructions.configureMetricbeatDescription": "在 {file} 文件中进行这些更改。", "xpack.monitoring.metricbeatMigration.apmInstructions.configureMetricbeatTitle": "配置 Metricbeat 以发送至监测集群", - "xpack.monitoring.metricbeatMigration.apmInstructions.disableInternalCollection.checkingStatusButtonLabel": "正在检查......", - "xpack.monitoring.metricbeatMigration.apmInstructions.disableInternalCollection.checkStatusButtonLabel": "检查", "xpack.monitoring.metricbeatMigration.apmInstructions.disableInternalCollection.description": "在 APM Server 的配置文件 ({file}) 中添加以下设置:", - "xpack.monitoring.metricbeatMigration.apmInstructions.disableInternalCollection.fullyMigratedStatusDescription": "我们未看到任何来自内部收集的文档。迁移完成!", - "xpack.monitoring.metricbeatMigration.apmInstructions.disableInternalCollection.fullyMigratedStatusTitle": "恭喜您!", "xpack.monitoring.metricbeatMigration.apmInstructions.disableInternalCollection.note": "进行此更改后,需要重新启动 APM Server。", - "xpack.monitoring.metricbeatMigration.apmInstructions.disableInternalCollection.partiallyMigratedStatusDescription": "上次内部收集发生于 {secondsSinceLastInternalCollectionLabel}前。", - "xpack.monitoring.metricbeatMigration.apmInstructions.disableInternalCollection.statusDescription": "确认没有文档来自内部收集。", "xpack.monitoring.metricbeatMigration.apmInstructions.disableInternalCollection.title": "禁用 APM Server 监测指标的内部收集", "xpack.monitoring.metricbeatMigration.apmInstructions.enableMetricbeatModuleDescription": "该模块将默认从 http://localhost:5066 收集 APM Server 监测指标。如果本地 APM Server 有不同的地址,则必须通过 {file} 文件中的 {hosts} 设置进行指定。", "xpack.monitoring.metricbeatMigration.apmInstructions.enableMetricbeatModuleTitle": "在 Metricbeat 中启用并配置 Beat x-pack 模块", - "xpack.monitoring.metricbeatMigration.apmInstructions.fullyMigratedStatusDescription": "我们现在看到来自 Metricbeat 的监测数据传送!", - "xpack.monitoring.metricbeatMigration.apmInstructions.fullyMigratedStatusTitle": "恭喜您!", "xpack.monitoring.metricbeatMigration.apmInstructions.installMetricbeatLinkText": "按照此处的说明执行操作", "xpack.monitoring.metricbeatMigration.apmInstructions.installMetricbeatTitle": "在安装 APM Server 的同一台服务器上安装 Metricbeat", - "xpack.monitoring.metricbeatMigration.apmInstructions.isInternalCollectorStatusTitle": "我们未检测到任何监测数据来自此 APM Server 的 Metricbeat。\n 我们将持续在后台检查。", - "xpack.monitoring.metricbeatMigration.apmInstructions.metricbeatSecuritySetup": "如果已启用安全功能,则可能需要更多的设置。{link}", - "xpack.monitoring.metricbeatMigration.apmInstructions.metricbeatSecuritySetupLinkText": "查看更多信息。", - "xpack.monitoring.metricbeatMigration.apmInstructions.partiallyMigratedStatusDescription": "请注意,检测最多花费 {secondsAgo} 秒,但我们在后台每 {timePeriod} 秒检查一次。", - "xpack.monitoring.metricbeatMigration.apmInstructions.partiallyMigratedStatusTitle": "我们仍看到数据来自此 APM Server 的内部收集。", "xpack.monitoring.metricbeatMigration.apmInstructions.startMetricbeatLinkText": "按照此处的说明执行操作", "xpack.monitoring.metricbeatMigration.apmInstructions.startMetricbeatTitle": "启动 Metricbeat", - "xpack.monitoring.metricbeatMigration.apmInstructions.statusTitle": "迁移状态", "xpack.monitoring.metricbeatMigration.beatsInstructions.configureMetricbeatDescription": "在 {file} 文件中进行这些更改。", "xpack.monitoring.metricbeatMigration.beatsInstructions.configureMetricbeatTitle": "配置 Metricbeat 以发送至监测集群", - "xpack.monitoring.metricbeatMigration.beatsInstructions.disableInternalCollection.checkingStatusButtonLabel": "正在检查......", - "xpack.monitoring.metricbeatMigration.beatsInstructions.disableInternalCollection.checkStatusButtonLabel": "检查", "xpack.monitoring.metricbeatMigration.beatsInstructions.disableInternalCollection.description": "在 {beatType} 的配置文件 ({file}) 中添加以下设置:", - "xpack.monitoring.metricbeatMigration.beatsInstructions.disableInternalCollection.fullyMigratedStatusDescription": "我们未看到任何来自内部收集的文档。迁移完成!", - "xpack.monitoring.metricbeatMigration.beatsInstructions.disableInternalCollection.fullyMigratedStatusTitle": "恭喜您!", "xpack.monitoring.metricbeatMigration.beatsInstructions.disableInternalCollection.note": "进行此更改后,您需要重新启动 {beatType}。", - "xpack.monitoring.metricbeatMigration.beatsInstructions.disableInternalCollection.partiallyMigratedStatusDescription": "上次内部收集发生于 {secondsSinceLastInternalCollectionLabel}前。", - "xpack.monitoring.metricbeatMigration.beatsInstructions.disableInternalCollection.statusDescription": "确认没有文档来自内部收集。", "xpack.monitoring.metricbeatMigration.beatsInstructions.disableInternalCollection.title": "禁用 {beatType} 监测指标的内部收集", "xpack.monitoring.metricbeatMigration.beatsInstructions.enableMetricbeatModuleDescription": "该模块将默认从 http://localhost:5066 收集 {beatType} 监测指标。如果正在监测的 {beatType} 实例有不同的地址,则必须通过 {file} 文件中的 {hosts} 设置进行指定。", "xpack.monitoring.metricbeatMigration.beatsInstructions.enableMetricbeatModuleHttpEnabledDirections": "要使 Metricbeat 从正在运行的 {beatType} 收集指标,需要{link}。", "xpack.monitoring.metricbeatMigration.beatsInstructions.enableMetricbeatModuleHttpEnabledDirectionsLinkText": "为正在监测的 {beatType} 实例启用 HTTP 终端节点", "xpack.monitoring.metricbeatMigration.beatsInstructions.enableMetricbeatModuleTitle": "在 Metricbeat 中启用并配置 Beat x-pack 模块", - "xpack.monitoring.metricbeatMigration.beatsInstructions.fullyMigratedStatusDescription": "我们现在看到来自 Metricbeat 的监测数据传送!", - "xpack.monitoring.metricbeatMigration.beatsInstructions.fullyMigratedStatusTitle": "恭喜您!", "xpack.monitoring.metricbeatMigration.beatsInstructions.installMetricbeatLinkText": "按照此处的说明执行操作", "xpack.monitoring.metricbeatMigration.beatsInstructions.installMetricbeatTitle": "在安装此 {beatType} 的同一台服务器上安装 Metricbeat", - "xpack.monitoring.metricbeatMigration.beatsInstructions.isInternalCollectorStatusTitle": "我们未检测到任何监测数据来自此 Beat 的 Metricbeat。\n 我们将持续在后台检查。", - "xpack.monitoring.metricbeatMigration.beatsInstructions.metricbeatSecuritySetup": "如果已启用安全功能,则可能需要更多的设置。{link}", - "xpack.monitoring.metricbeatMigration.beatsInstructions.metricbeatSecuritySetupLinkText": "查看更多信息。", - "xpack.monitoring.metricbeatMigration.beatsInstructions.partiallyMigratedStatusDescription": "请注意,检测最多花费 {secondsAgo} 秒,但我们在后台每 {timePeriod} 秒检查一次。", - "xpack.monitoring.metricbeatMigration.beatsInstructions.partiallyMigratedStatusTitle": "我们仍看到数据来自此 Beat 的内部收集。", "xpack.monitoring.metricbeatMigration.beatsInstructions.startMetricbeatLinkText": "按照此处的说明执行操作", "xpack.monitoring.metricbeatMigration.beatsInstructions.startMetricbeatTitle": "启动 Metricbeat", - "xpack.monitoring.metricbeatMigration.beatsInstructions.statusTitle": "迁移状态", - "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.statusTitleNewUser": "监测状态", - "xpack.monitoring.metricbeatMigration.flyout.flyoutTitleNewUser": "使用 Metricbeat 监测 {instanceName} {instanceType}", - "xpack.monitoring.metricbeatMigration.flyout.instance": "实例", - "xpack.monitoring.metricbeatMigration.flyout.noClusterUuidCheckboxLabel": "是的,我明白我将需要在独立集群中寻找\n 此 {productName} {typeText}。", - "xpack.monitoring.metricbeatMigration.flyout.noClusterUuidDescription": "此 {productName} {typeText} 未连接到 Elasticsearch 集群,因此完全迁移后,此 {productName} {typeText} 将显示在独立集群中,而非此集群中。{link}", "xpack.monitoring.metricbeatMigration.flyout.noClusterUuidTitle": "未检测到集群", - "xpack.monitoring.metricbeatMigration.flyout.node": "节点", - "xpack.monitoring.metricbeatMigration.kibanaInstructions.statusTitleNewUser": "监测状态", "xpack.monitoring.metricbeatMigration.logstashInstructions.configureMetricbeatDescription": "在 {file} 文件中进行这些更改。", "xpack.monitoring.metricbeatMigration.logstashInstructions.configureMetricbeatTitle": "配置 Metricbeat 以发送至监测集群", - "xpack.monitoring.metricbeatMigration.logstashInstructions.disableInternalCollection.checkingStatusButtonLabel": "正在检查......", - "xpack.monitoring.metricbeatMigration.logstashInstructions.disableInternalCollection.checkStatusButtonLabel": "检查", "xpack.monitoring.metricbeatMigration.logstashInstructions.disableInternalCollection.description": "在 Logstash 配置文件 ({file}) 中添加以下设置:", - "xpack.monitoring.metricbeatMigration.logstashInstructions.disableInternalCollection.fullyMigratedStatusDescription": "我们未看到任何来自内部收集的文档。迁移完成!", - "xpack.monitoring.metricbeatMigration.logstashInstructions.disableInternalCollection.fullyMigratedStatusTitle": "恭喜您!", "xpack.monitoring.metricbeatMigration.logstashInstructions.disableInternalCollection.note": "进行此更改后,您需要重新启动 Logstash。", - "xpack.monitoring.metricbeatMigration.logstashInstructions.disableInternalCollection.partiallyMigratedStatusDescription": "上次内部收集发生于 {secondsSinceLastInternalCollectionLabel}前。", - "xpack.monitoring.metricbeatMigration.logstashInstructions.disableInternalCollection.statusDescription": "确认没有文档来自内部收集。", "xpack.monitoring.metricbeatMigration.logstashInstructions.disableInternalCollection.title": "禁用 Logstash 监测指标的内部收集", "xpack.monitoring.metricbeatMigration.logstashInstructions.enableMetricbeatModuleDescription": "该模块将默认从 http://localhost:9600 收集 Logstash 监测指标。如果本地 Logstash 实例有不同的地址,则必须通过 {file} 文件中的 {hosts} 设置进行指定。", "xpack.monitoring.metricbeatMigration.logstashInstructions.enableMetricbeatModuleTitle": "在 Metricbeat 中启用并配置 Logstash x-pack 模块", - "xpack.monitoring.metricbeatMigration.logstashInstructions.fullyMigratedStatusDescription": "我们现在看到来自 Metricbeat 的监测数据传送!", - "xpack.monitoring.metricbeatMigration.logstashInstructions.fullyMigratedStatusTitle": "恭喜您!", "xpack.monitoring.metricbeatMigration.logstashInstructions.installMetricbeatLinkText": "按照此处的说明执行操作", "xpack.monitoring.metricbeatMigration.logstashInstructions.installMetricbeatTitle": "在安装 Logstash 的同一台服务器上安装 Metricbeat", - "xpack.monitoring.metricbeatMigration.logstashInstructions.isInternalCollectorStatusTitle": "我们未检测到任何监测数据来自此 Logstash 节点的 Metricbeat。\n 我们将持续在后台检查。", - "xpack.monitoring.metricbeatMigration.logstashInstructions.metricbeatSecuritySetup": "如果已启用安全功能,则可能需要更多的设置。{link}", - "xpack.monitoring.metricbeatMigration.logstashInstructions.metricbeatSecuritySetupLinkText": "查看更多信息。", - "xpack.monitoring.metricbeatMigration.logstashInstructions.partiallyMigratedStatusDescription": "请注意,检测最多花费 {secondsAgo} 秒,但我们在后台每 {timePeriod} 秒检查一次。", - "xpack.monitoring.metricbeatMigration.logstashInstructions.partiallyMigratedStatusTitle": "我们仍看到数据来自 Logstash 的内部收集。", "xpack.monitoring.metricbeatMigration.logstashInstructions.startMetricbeatLinkText": "按照此处的说明执行操作", "xpack.monitoring.metricbeatMigration.logstashInstructions.startMetricbeatTitle": "启动 Metricbeat", - "xpack.monitoring.metricbeatMigration.logstashInstructions.statusTitle": "迁移状态", "xpack.monitoring.noData.blurbs.cloudDeploymentDescription": "请返回到您的 ", "xpack.monitoring.noData.blurbs.cloudDeploymentDescriptionMore": "有关在 Elastic Cloud 中监测的详情,请参阅 ", "xpack.monitoring.noData.blurbs.cloudDeploymentTitle": "此处没有您的监测数据。", "xpack.monitoring.noData.explanations.exportersCloudDescription": "在 Elastic Cloud 中,您的监测数据将存储在专用监测集群中。", - "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.isInternalCollectorStatusTitle": "我们未检测到任何监测数据来自此 Elasticsearch 节点的 Metricbeat。\n 我们将持续在后台检查。", - "xpack.monitoring.metricbeatMigration.elasticsearchInstructions.partiallyMigratedStatusDescription": "请注意,检测最多花费 {secondsAgo} 秒,但我们将在后台持续检查。", - "xpack.monitoring.metricbeatMigration.kibanaInstructions.isInternalCollectorStatusTitle": "我们未检测到任何监测数据来自此 Kibana 实例的 Metricbeat。\n 我们将持续在后台检查。", "xpack.remoteClusters.addAction.clusterNameAlreadyExistsErrorMessage": "名为 “{clusterName}” 的集群已存在。", "xpack.remoteClusters.addAction.errorTitle": "添加集群时出错", "xpack.remoteClusters.addAction.failedDefaultErrorMessage": "请求失败,显示 {statusCode} 错误。{message}", From a92d02d340d96b57f7ecbc644560c5c063a6aca9 Mon Sep 17 00:00:00 2001 From: chrisronline Date: Tue, 24 Sep 2019 14:58:30 -0400 Subject: [PATCH 31/43] Update snapshots --- .../no_data/__tests__/__snapshots__/no_data.test.js.snap | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x-pack/legacy/plugins/monitoring/public/components/no_data/__tests__/__snapshots__/no_data.test.js.snap b/x-pack/legacy/plugins/monitoring/public/components/no_data/__tests__/__snapshots__/no_data.test.js.snap index 4242056e2a911..00a8ede81ad02 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/no_data/__tests__/__snapshots__/no_data.test.js.snap +++ b/x-pack/legacy/plugins/monitoring/public/components/no_data/__tests__/__snapshots__/no_data.test.js.snap @@ -68,6 +68,7 @@ exports[`NoData should show a default message if reason is unknown 1`] = ` />

- {this.getDocumentationTitle()} + {/* Remove until we have a why article: https://github.com/elastic/kibana/pull/45799#issuecomment-536778656 */} + {/* {this.getDocumentationTitle()} */} {this.renderActiveStep()} From 3c8875362dc260eb6e866c93381166cfdb71facf Mon Sep 17 00:00:00 2001 From: chrisronline Date: Mon, 30 Sep 2019 21:41:05 -0400 Subject: [PATCH 36/43] Ensure tabs are properly disabled --- .../monitoring/public/components/elasticsearch/nodes/nodes.js | 2 +- .../legacy/plugins/monitoring/public/directives/main/index.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js b/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js index 7137fb73b0137..b2c59150a7ba5 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js +++ b/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js @@ -259,7 +259,7 @@ export function ElasticsearchNodes({ clusterStatus, showCgroupMetricsElasticsear nodes.push(...Object.entries(setupMode.data.byUuid) .reduce((nodes, [nodeUuid, instance]) => { - if (!nodesByUuid[nodeUuid]) { + if (!nodesByUuid[nodeUuid] && instance.node) { nodes.push(instance.node); } return nodes; diff --git a/x-pack/legacy/plugins/monitoring/public/directives/main/index.js b/x-pack/legacy/plugins/monitoring/public/directives/main/index.js index 3a1e146331372..a7aee9ae78058 100644 --- a/x-pack/legacy/plugins/monitoring/public/directives/main/index.js +++ b/x-pack/legacy/plugins/monitoring/public/directives/main/index.js @@ -156,6 +156,10 @@ export class MonitoringMainController { if (data.totalUniqueInstanceCount === 0) { return true; } + if (data.totalUniqueInternallyCollectedCount === 0 + && data.totalUniqueFullyMigratedCount === 0 && data.totalUniquePartiallyMigratedCount === 0) { + return true; + } return false; } } From cf32128b25dcc74d7ebf6fb6b9160d3d7c73cb1c Mon Sep 17 00:00:00 2001 From: chrisronline Date: Tue, 1 Oct 2019 09:21:11 -0400 Subject: [PATCH 37/43] Address issue with the ES nodes callout not working at times --- .../public/components/elasticsearch/nodes/nodes.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js b/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js index b2c59150a7ba5..415b2f7134f4a 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js +++ b/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js @@ -279,9 +279,12 @@ export function ElasticsearchNodes({ clusterStatus, showCgroupMetricsElasticsear componentToRender: null }; - const hasInstances = setupMode.data.totalUniqueInstanceCount > 0 - && setupMode.data.totalUniqueInternallyCollectedCount > 0; - if (!hasInstances) { + const isNetNewUser = setupMode.data.totalUniqueInstanceCount === 0; + const hasNoInstances = setupMode.data.totalUniqueInternallyCollectedCount === 0 + && setupMode.data.totalUniqueFullyMigratedCount === 0 + && setupMode.data.totalUniquePartiallyMigratedCount === 0; + + if (isNetNewUser || hasNoInstances) { customRenderResponse.shouldRender = true; customRenderResponse.componentToRender = ( From 906c2546b6b1289f80cf22ca40ab84ce95d5e05c Mon Sep 17 00:00:00 2001 From: chrisronline Date: Tue, 1 Oct 2019 09:26:48 -0400 Subject: [PATCH 38/43] Ensure we check if setup mode is enabled --- .../monitoring/public/components/apm/instances/instances.js | 2 +- .../monitoring/public/components/elasticsearch/nodes/nodes.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/legacy/plugins/monitoring/public/components/apm/instances/instances.js b/x-pack/legacy/plugins/monitoring/public/components/apm/instances/instances.js index b0ecb0ae5aeb7..1a66093405363 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/apm/instances/instances.js +++ b/x-pack/legacy/plugins/monitoring/public/components/apm/instances/instances.js @@ -123,7 +123,7 @@ export function ApmServerInstances({ apms, setupMode }) { } = apms; let setupModeCallout = null; - if (setupMode.data) { + if (setupMode.enabled && setupMode.data) { setupModeCallout = ( Date: Tue, 1 Oct 2019 13:54:09 -0400 Subject: [PATCH 39/43] Change internal collection to self monitoring, and remove the word 'collection' usage --- .../public/components/elasticsearch/nodes/nodes.js | 4 ++-- .../apm/disable_internal_collection_instructions.js | 2 +- .../beats/disable_internal_collection_instructions.js | 2 +- .../instruction_steps/common_instructions.js | 6 +++--- .../disable_internal_collection_instructions.js | 4 ++-- .../kibana/disable_internal_collection_instructions.js | 2 +- .../disable_internal_collection_instructions.js | 2 +- .../__tests__/__snapshots__/no_data.test.js.snap | 4 ++-- .../monitoring/public/components/no_data/no_data.js | 2 +- .../monitoring/public/components/setup_mode/badge.js | 4 ++-- .../public/components/setup_mode/listing_callout.js | 8 ++++---- .../monitoring/public/components/setup_mode/tooltip.js | 10 +++++----- 12 files changed, 25 insertions(+), 25 deletions(-) diff --git a/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js b/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js index 1bc5ad4b58078..69b2add3c21f4 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js +++ b/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js @@ -322,13 +322,13 @@ export function ElasticsearchNodes({ clusterStatus, showCgroupMetricsElasticsear >

{i18n.translate('xpack.monitoring.elasticsearch.nodes.metricbeatMigration.disableInternalCollectionDescription', { - defaultMessage: `Disable internal collection to finish the migration.` + defaultMessage: `Disable self monitoring to finish the migration.` })}

{i18n.translate( 'xpack.monitoring.elasticsearch.nodes.metricbeatMigration.disableInternalCollectionMigrationButtonLabel', { - defaultMessage: 'Disable internal collection' + defaultMessage: 'Disable self monitoring' } )} diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/disable_internal_collection_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/disable_internal_collection_instructions.js index 9bbe57a1c8c24..1a0926cc5ea27 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/disable_internal_collection_instructions.js +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/disable_internal_collection_instructions.js @@ -17,7 +17,7 @@ import { getDisableStatusStep } from '../common_instructions'; export function getApmInstructionsForDisablingInternalCollection(product, meta) { const disableInternalCollectionStep = { title: i18n.translate('xpack.monitoring.metricbeatMigration.apmInstructions.disableInternalCollection.title', { - defaultMessage: 'Disable internal collection of the APM server\'s monitoring metrics' + defaultMessage: 'Disable self monitoring of the APM server\'s monitoring metrics' }), children: ( diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/disable_internal_collection_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/disable_internal_collection_instructions.js index 0032997959c09..b7400f2a798ca 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/disable_internal_collection_instructions.js +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/disable_internal_collection_instructions.js @@ -19,7 +19,7 @@ export function getBeatsInstructionsForDisablingInternalCollection(product, meta const beatType = product.beatType; const disableInternalCollectionStep = { title: i18n.translate('xpack.monitoring.metricbeatMigration.beatsInstructions.disableInternalCollection.title', { - defaultMessage: 'Disable internal collection of {beatType}\'s monitoring metrics', + defaultMessage: 'Disable self monitoring of {beatType}\'s monitoring metrics', values: { beatType: beatType || UNDETECTED_BEAT_TYPE } diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/common_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/common_instructions.js index 0b55ecabf1fa0..f263837b80cc3 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/common_instructions.js +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/common_instructions.js @@ -114,7 +114,7 @@ export function getDisableStatusStep(product, meta) { lastInternallyCollectedMessage = i18n.translate( 'xpack.monitoring.metricbeatMigration.disableInternalCollection.partiallyMigratedStatusDescription', { - defaultMessage: 'Last internal collection was {secondsSinceLastInternalCollectionLabel} ago.', + defaultMessage: 'Last self monitoring was {secondsSinceLastInternalCollectionLabel} ago.', values: { secondsSinceLastInternalCollectionLabel } @@ -131,7 +131,7 @@ export function getDisableStatusStep(product, meta) { color="warning" title={i18n.translate('xpack.monitoring.metricbeatMigration.partiallyMigratedStatusTitle', { - defaultMessage: `Data is still coming from internal collection` + defaultMessage: `Data is still coming from self monitoring` } )} > @@ -167,7 +167,7 @@ export function getDisableStatusStep(product, meta) { >

{i18n.translate('xpack.monitoring.metricbeatMigration.disableInternalCollection.fullyMigratedStatusDescription', { - defaultMessage: 'We are not seeing any documents from internal collection. Migration complete!' + defaultMessage: 'We are not seeing any documents from self monitoring. Migration complete!' })}

diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/elasticsearch/disable_internal_collection_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/elasticsearch/disable_internal_collection_instructions.js index eb3da8de73e6a..361b1262f4481 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/elasticsearch/disable_internal_collection_instructions.js +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/elasticsearch/disable_internal_collection_instructions.js @@ -17,7 +17,7 @@ import { getDisableStatusStep } from '../common_instructions'; export function getElasticsearchInstructionsForDisablingInternalCollection(product, meta) { const disableInternalCollectionStep = { title: i18n.translate('xpack.monitoring.metricbeatMigration.elasticsearchInstructions.disableInternalCollectionTitle', { - defaultMessage: 'Disable internal collection of Elasticsearch monitoring metrics' + defaultMessage: 'Disable self monitoring of Elasticsearch monitoring metrics' }), children: ( @@ -25,7 +25,7 @@ export function getElasticsearchInstructionsForDisablingInternalCollection(produ

diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/disable_internal_collection_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/disable_internal_collection_instructions.js index 4e94606b01f8d..350a50b973b29 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/disable_internal_collection_instructions.js +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/disable_internal_collection_instructions.js @@ -17,7 +17,7 @@ import { getDisableStatusStep } from '../common_instructions'; export function getLogstashInstructionsForDisablingInternalCollection(product, meta) { const disableInternalCollectionStep = { title: i18n.translate('xpack.monitoring.metricbeatMigration.logstashInstructions.disableInternalCollection.title', { - defaultMessage: 'Disable internal collection of Logstash monitoring metrics' + defaultMessage: 'Disable self monitoring of Logstash monitoring metrics' }), children: ( diff --git a/x-pack/legacy/plugins/monitoring/public/components/no_data/__tests__/__snapshots__/no_data.test.js.snap b/x-pack/legacy/plugins/monitoring/public/components/no_data/__tests__/__snapshots__/no_data.test.js.snap index 6874e22140108..1d0f58b623595 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/no_data/__tests__/__snapshots__/no_data.test.js.snap +++ b/x-pack/legacy/plugins/monitoring/public/components/no_data/__tests__/__snapshots__/no_data.test.js.snap @@ -80,7 +80,7 @@ exports[`NoData should show a default message if reason is unknown 1`] = ` - Or, set up with internal collection + Or, set up with self monitoring @@ -170,7 +170,7 @@ exports[`NoData should show text next to the spinner while checking a setting 1` - Or, set up with internal collection + Or, set up with self monitoring diff --git a/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js b/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js index 462f1a6f294a2..e50e49eec9f6e 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js +++ b/x-pack/legacy/plugins/monitoring/public/components/no_data/no_data.js @@ -133,7 +133,7 @@ export function NoData(props) { diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.js index fe653af357e99..d4dcd2df1fec2 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.js +++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.js @@ -18,7 +18,7 @@ const clickToMonitorWithMetricbeat = i18n.translate('xpack.monitoring.setupMode. }); const clickToDisableInternalCollection = i18n.translate('xpack.monitoring.setupMode.clickToDisableInternalCollection', { - defaultMessage: 'Disable internal collection' + defaultMessage: 'Disable self monitoring' }); const monitoredWithMetricbeat = i18n.translate('xpack.monitoring.setupMode.usingMetricbeatCollection', { @@ -54,7 +54,7 @@ export function SetupModeBadge({ setupMode, productName, status, instance, clust   {i18n.translate('xpack.monitoring.setupMode.monitorAllNodes', { - defaultMessage: 'Some nodes use only internal collection' + defaultMessage: 'Some nodes use only self monitoring' })} diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js index ab0e7a6e7e13a..c13219b9e5ef0 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js +++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js @@ -102,7 +102,7 @@ export function ListingCallOut({ setupModeData, productName, customRenderer = nu {i18n.translate('xpack.monitoring.setupMode.disableInternalCollectionDescription', { defaultMessage: `Metricbeat is now monitoring your {product} {identifier}. - Disable internal collection to finish the migration.`, + Disable self monitoring to finish the migration.`, values: { product: formatProductName(productName), identifier: getIdentifier(productName, true) @@ -134,7 +134,7 @@ export function ListingCallOut({ setupModeData, productName, customRenderer = nu >

{i18n.translate('xpack.monitoring.setupMode.migrateToMetricbeatDescription', { - defaultMessage: `These {product} {identifier} are monitored through internal collection. + defaultMessage: `These {product} {identifier} are monitored through self monitoring. Migrate to monitor with Metricbeat.`, values: { product: formatProductName(productName), @@ -157,7 +157,7 @@ export function ListingCallOut({ setupModeData, productName, customRenderer = nu >

{i18n.translate('xpack.monitoring.setupMode.migrateSomeToMetricbeatDescription', { - defaultMessage: `Some {product} {identifier} are monitored through internal collection. Migrate to monitor with Metricbeat.`, + defaultMessage: `Some {product} {identifier} are monitored through self monitoring. Migrate to monitor with Metricbeat.`, values: { product: formatProductName(productName), identifier: getIdentifier(productName, true) diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js index 07079ce11b169..42180d0bc2ab5 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js +++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js @@ -34,7 +34,7 @@ export function SetupModeTooltip({ setupModeData, badgeClickAction, productName if (totalUniqueInstanceCount === 0) { if (mightExist) { const detectedText = i18n.translate('xpack.monitoring.setupMode.tooltip.detected', { - defaultMessage: 'No collection' + defaultMessage: 'No monitoring' }); tooltip = ( Date: Tue, 1 Oct 2019 14:18:38 -0400 Subject: [PATCH 40/43] Only show Enter setup mode on pages with valid setup mode options --- .../monitoring/public/components/renderers/setup_mode.js | 4 +++- x-pack/legacy/plugins/monitoring/public/lib/setup_mode.js | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/x-pack/legacy/plugins/monitoring/public/components/renderers/setup_mode.js b/x-pack/legacy/plugins/monitoring/public/components/renderers/setup_mode.js index 475aa1ffab310..079a3e7eeae09 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/renderers/setup_mode.js +++ b/x-pack/legacy/plugins/monitoring/public/components/renderers/setup_mode.js @@ -9,7 +9,8 @@ import { initSetupModeState, updateSetupModeData, disableElasticsearchInternalCollection, - toggleSetupMode + toggleSetupMode, + setSetupModeMenuItem } from '../../lib/setup_mode'; import { Flyout } from '../metricbeat_migration/flyout'; import { @@ -61,6 +62,7 @@ export class SetupModeRenderer extends React.Component { this.setState(newState); }); + setSetupModeMenuItem(); } reset() { diff --git a/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.js b/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.js index d0b130bdbf0a5..9bdf9e339ac91 100644 --- a/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.js +++ b/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.js @@ -122,7 +122,6 @@ export const toggleSetupMode = inSetupMode => { setupModeState.enabled = inSetupMode; globalState.inSetupMode = inSetupMode; globalState.save(); - setSetupModeMenuItem(); // eslint-disable-line no-use-before-define notifySetupModeDataChange(); if (inSetupMode) { @@ -131,7 +130,7 @@ export const toggleSetupMode = inSetupMode => { } }; -const setSetupModeMenuItem = () => { +export const setSetupModeMenuItem = () => { checkAngularState(); if (isOnPage('no-data')) { @@ -159,7 +158,6 @@ const setSetupModeMenuItem = () => { export const initSetupModeState = async ($scope, $injector, callback) => { angularState.scope = $scope; angularState.injector = $injector; - setSetupModeMenuItem(); callback && setupModeState.callbacks.push(callback); const globalState = $injector.get('globalState'); From 76f3ae2290681d302cefd75d077b7305764517c2 Mon Sep 17 00:00:00 2001 From: chrisronline Date: Tue, 1 Oct 2019 14:49:48 -0400 Subject: [PATCH 41/43] Copy updates --- .../instruction_steps/apm/enable_metricbeat_instructions.js | 4 ++-- .../beats/enable_metricbeat_instructions.js | 4 ++-- .../kibana/enable_metricbeat_instructions.js | 4 ++-- .../logstash/enable_metricbeat_instructions.js | 4 ++-- .../public/components/setup_mode/listing_callout.js | 4 ++-- .../monitoring/public/components/setup_mode/tooltip.js | 6 +++--- .../plugins/monitoring/public/components/table/eui_table.js | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/enable_metricbeat_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/enable_metricbeat_instructions.js index 973af03c46cc1..eaf7066c92e65 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/enable_metricbeat_instructions.js +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/enable_metricbeat_instructions.js @@ -36,7 +36,7 @@ export function getApmInstructionsForEnablingMetricbeat(product, _meta, { >

@@ -127,7 +127,7 @@ export function getApmInstructionsForEnablingMetricbeat(product, _meta, { >

diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/enable_metricbeat_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/enable_metricbeat_instructions.js index af883e6e68c41..f36fb49521a1e 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/enable_metricbeat_instructions.js +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/enable_metricbeat_instructions.js @@ -42,7 +42,7 @@ export function getBeatsInstructionsForEnablingMetricbeat(product, _meta, { >

@@ -169,7 +169,7 @@ export function getBeatsInstructionsForEnablingMetricbeat(product, _meta, { >

diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/enable_metricbeat_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/enable_metricbeat_instructions.js index bd192cfd176b0..be4bdf9f2ac1d 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/enable_metricbeat_instructions.js +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/enable_metricbeat_instructions.js @@ -36,7 +36,7 @@ export function getKibanaInstructionsForEnablingMetricbeat(product, _meta, { >

@@ -127,7 +127,7 @@ export function getKibanaInstructionsForEnablingMetricbeat(product, _meta, { >

diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/enable_metricbeat_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/enable_metricbeat_instructions.js index c1df6c0f4b5ae..875ab89c99454 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/enable_metricbeat_instructions.js +++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/enable_metricbeat_instructions.js @@ -36,7 +36,7 @@ export function getLogstashInstructionsForEnablingMetricbeat(product, _meta, { >

@@ -127,7 +127,7 @@ export function getLogstashInstructionsForEnablingMetricbeat(product, _meta, { >

diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js index c13219b9e5ef0..425addc760273 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js +++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js @@ -60,7 +60,7 @@ export function ListingCallOut({ setupModeData, productName, customRenderer = nu {i18n.translate('xpack.monitoring.setupMode.migrateToMetricbeatDescription', { defaultMessage: `These {product} {identifier} are monitored through self monitoring. - Migrate to monitor with Metricbeat.`, + Click 'Monitor with Metricbeat' to migrate.`, values: { product: formatProductName(productName), identifier: getIdentifier(productName, true) diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js index 42180d0bc2ab5..ae06c7c89c969 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js +++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js @@ -40,7 +40,7 @@ export function SetupModeTooltip({ setupModeData, badgeClickAction, productName @@ -77,7 +77,7 @@ export function SetupModeTooltip({ setupModeData, badgeClickAction, productName setupMode.openFlyout({}, true)}> {i18n.translate('xpack.monitoring.euiTable.setupNewButtonLabel', { - defaultMessage: 'Set up monitoring for another {identifier}', + defaultMessage: 'Set up monitoring for new {identifier}', values: { identifier: getIdentifier(productName) } From 997de3e87da038d93ed26cd7ccb3cf0ba7b01685 Mon Sep 17 00:00:00 2001 From: chrisronline Date: Wed, 2 Oct 2019 10:46:50 -0400 Subject: [PATCH 42/43] Copy updates --- .../public/components/setup_mode/listing_callout.js | 2 +- .../monitoring/public/components/setup_mode/tooltip.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js index 425addc760273..adede59d384d6 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js +++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.js @@ -134,7 +134,7 @@ export function ListingCallOut({ setupModeData, productName, customRenderer = nu >

{i18n.translate('xpack.monitoring.setupMode.migrateToMetricbeatDescription', { - defaultMessage: `These {product} {identifier} are monitored through self monitoring. + defaultMessage: `These {product} {identifier} are self monitored. Click 'Monitor with Metricbeat' to migrate.`, values: { product: formatProductName(productName), diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js index ae06c7c89c969..cc73a4d29536c 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js +++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/tooltip.js @@ -40,7 +40,7 @@ export function SetupModeTooltip({ setupModeData, badgeClickAction, productName @@ -58,7 +58,10 @@ export function SetupModeTooltip({ setupModeData, badgeClickAction, productName From ed2725183d4df6fc7100e1dbffec44f26b6a0c75 Mon Sep 17 00:00:00 2001 From: chrisronline Date: Wed, 2 Oct 2019 11:10:19 -0400 Subject: [PATCH 43/43] Ensure we update the top nav item when we toggle setup mode on or off --- x-pack/legacy/plugins/monitoring/public/lib/setup_mode.js | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.js b/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.js index 9bdf9e339ac91..3e7d182f1514c 100644 --- a/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.js +++ b/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.js @@ -122,6 +122,7 @@ export const toggleSetupMode = inSetupMode => { setupModeState.enabled = inSetupMode; globalState.inSetupMode = inSetupMode; globalState.save(); + setSetupModeMenuItem(); // eslint-disable-line no-use-before-define notifySetupModeDataChange(); if (inSetupMode) {