From bc664253765b343b37f2c2ef1f3f5150d4c36ce7 Mon Sep 17 00:00:00 2001
From: chrisronline
Date: Tue, 6 Aug 2019 16:28:41 -0400
Subject: [PATCH 01/52] 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/52] 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/52] 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/52] 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/52] 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/52] 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/52] 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/52] 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) {
- {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.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.`
- })}
-
+ {i18n.translate('xpack.monitoring.elasticsearch.nodes.metricbeatMigration.disableInternalCollectionDescription', {
+ defaultMessage: `Metricbeat is now monitoring your Elasticsearch servers.
+ Disable internal collection to finish the migration.`
+ })}
+
);
}
},
@@ -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.`
- })}
-
- {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
>
+
+ 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 = (
- {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.`
- })}
-
-
- )
- };
- }
+ 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: (
-
-
+
+ )
+ };
+ }
+
+ 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
+ }
+ })}
+
+ {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: (
-
-
-
- )
- };
- }
+ 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: (
-
-
+ ,
+ "title": "Start Metricbeat",
+ },
+ Object {
+ "children": ,
+ "status": "incomplete",
+ "title": "Migration status",
+ },
+ ]
+ }
+ />
+
+`;
+
+exports[`Flyout should render a consistent completion state for all products 1`] = `
+Object {
+ "children":
+
+ Metricbeat is shipping monitoring data.
+
+ ,
+ "status": "complete",
+ "title": "Migration status",
+}
+`;
+
+exports[`Flyout should render the beat type for beats 1`] = `
+
+
+
+
+
+
+
+ ,
+ "title": "Install Metricbeat on the same server as this filebeat",
+ },
+ Object {
+ "children":
+
+ metricbeat modules enable beat-xpack
+
+
+
+
+ It can take up to 30 seconds to detect data, and we’ll continue checking.
+
+
+ Last internal collection was 0 seconds ago.
+
+ ,
+ "status": "incomplete",
+ "title": "Migration status",
+ },
+ ]
+ }
+ />
+
+`;
+
+exports[`Flyout should render the beat type for beats for the enabling metricbeat step 1`] = `
+
+
+
+
+
+
+
+ ,
+ "title": "Install Metricbeat on the same server as this filebeat",
+ },
+ Object {
+ "children":
+
+ metricbeat modules enable beat-xpack
+
+
+
+
+ It can take up to 30 seconds to detect data, and we’ll continue checking.
+
+
+ Last internal collection was 0 seconds ago.
+
+ ,
+ "status": "incomplete",
+ "title": "Migration status",
+ },
+ ]
+ }
+ />
+
+`;
diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/flyout/flyout.test.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/flyout/flyout.test.js
new file mode 100644
index 0000000000000..4a05d18aa312f
--- /dev/null
+++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/flyout/flyout.test.js
@@ -0,0 +1,178 @@
+/*
+ * 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 { shallow } from 'enzyme';
+import { Flyout } from './flyout';
+import { INSTRUCTION_STEP_ENABLE_METRICBEAT } from '../constants';
+import {
+ ELASTICSEARCH_SYSTEM_ID,
+ KIBANA_SYSTEM_ID,
+ BEATS_SYSTEM_ID,
+ APM_SYSTEM_ID,
+ LOGSTASH_SYSTEM_ID
+} from '../../../../common/constants';
+
+jest.mock('ui/documentation_links', () => ({
+ ELASTIC_WEBSITE_URL: 'https://www.elastic.co/',
+ DOC_LINK_VERSION: 'current'
+}));
+
+const PRODUCTS = [
+ {
+ name: ELASTICSEARCH_SYSTEM_ID
+ },
+ {
+ name: KIBANA_SYSTEM_ID
+ },
+ {
+ name: LOGSTASH_SYSTEM_ID
+ },
+ {
+ name: BEATS_SYSTEM_ID
+ },
+ {
+ name: APM_SYSTEM_ID
+ }
+];
+
+describe('Flyout', () => {
+ for (const { name } of PRODUCTS) {
+ describe(`${name}`, () => {
+ describe('part one', () => {
+ it('should render normally', () => {
+ const component = shallow(
+ {}}
+ product={{}}
+ productName={name}
+ />
+ );
+ expect(component).toMatchSnapshot();
+ });
+ });
+
+ describe('part two', () => {
+ it('should show instructions to migrate to metricbeat', () => {
+ const component = shallow(
+ {}}
+ product={{
+ isInternalCollector: true
+ }}
+ productName={name}
+ />
+ );
+ component.find('EuiButton').simulate('click');
+ component.update();
+ expect(component.find('EuiFlyoutBody')).toMatchSnapshot();
+ });
+
+ it('should show instructions to disable internal collection', () => {
+ const component = shallow(
+ {}}
+ product={{
+ isPartiallyMigrated: true
+ }}
+ meta={{
+ secondsAgo: 30
+ }}
+ productName={name}
+ />
+ );
+ component.find('EuiButton').simulate('click');
+ component.update();
+ expect(component.find('EuiFlyoutBody')).toMatchSnapshot();
+ });
+ });
+ });
+ }
+
+ it('should render a consistent completion state for all products', () => {
+ let template = null;
+ for (const { name } of PRODUCTS) {
+ const component = shallow(
+ {}}
+ product={{
+ isPartiallyMigrated: true
+ }}
+ meta={{
+ secondsAgo: 10
+ }}
+ productName={name}
+ />
+ );
+ component.setState({
+ activeStep: INSTRUCTION_STEP_ENABLE_METRICBEAT,
+ });
+ component.update();
+ const steps = component.find('EuiSteps').prop('steps');
+ const step = steps[steps.length - 1];
+ if (!template) {
+ template = step;
+ expect(template).toMatchSnapshot();
+ } else {
+ expect(template).toEqual(step);
+ }
+ }
+ });
+
+ it('should render the beat type for beats for the enabling metricbeat step', () => {
+ const component = shallow(
+ {}}
+ product={{
+ isInternalCollector: true,
+ beatType: 'filebeat'
+ }}
+ productName={BEATS_SYSTEM_ID}
+ />
+ );
+ component.find('EuiButton').simulate('click');
+ component.update();
+ expect(component.find('EuiFlyoutBody')).toMatchSnapshot();
+ });
+
+ it('should render the beat type for beats for the disabling internal collection step', () => {
+ const component = shallow(
+ {}}
+ product={{
+ isPartiallyMigrated: true,
+ beatType: 'filebeat'
+ }}
+ meta={{
+ secondsAgo: 30
+ }}
+ productName={BEATS_SYSTEM_ID}
+ />
+ );
+ component.find('EuiButton').simulate('click');
+ component.update();
+ expect(component.find('EuiFlyoutBody')).toMatchSnapshot();
+ });
+
+ it('should show a restart warning for restarting the primary Kibana', () => {
+ const component = shallow(
+ {}}
+ product={{
+ isPartiallyMigrated: true,
+ isPrimary: true
+ }}
+ meta={{
+ secondsAgo: 30
+ }}
+ productName={KIBANA_SYSTEM_ID}
+ />
+ );
+ component.find('EuiButton').simulate('click');
+ component.update();
+ expect(component.find('EuiFlyoutBody')).toMatchSnapshot();
+ });
+});
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..5c2b8c160d74a 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
@@ -123,7 +123,7 @@ export class SetupModeRenderer extends React.Component {
-
+
diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/__snapshots__/badge.test.js.snap b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/__snapshots__/badge.test.js.snap
new file mode 100644
index 0000000000000..18fa8c15a410b
--- /dev/null
+++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/__snapshots__/badge.test.js.snap
@@ -0,0 +1,67 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`setupMode SetupModeBadge internal collection should render each product consistently 1`] = `
+
+ Monitor with Metricbeat
+
+`;
+
+exports[`setupMode SetupModeBadge metricbeat collection should render each product consistently 1`] = `
+
+ Monitored with Metricbeat
+
+`;
+
+exports[`setupMode SetupModeBadge net new user should render each product consistently 1`] = `
+
+ Monitor with Metricbeat
+
+`;
+
+exports[`setupMode SetupModeBadge partially migrated should render each product consistently 1`] = `
+
+ Disable internal collection
+
+`;
+
+exports[`setupMode SetupModeBadge should use a text status if internal collection cannot be disabled yet for elasticsearch 1`] = `
+
+
+
+
+ Monitor all nodes with Metricbeat
+
+
+`;
+
+exports[`setupMode SetupModeBadge unknown should render each product consistently 1`] = `
+
+ N/A
+
+`;
diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/__snapshots__/formatting.test.js.snap b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/__snapshots__/formatting.test.js.snap
new file mode 100644
index 0000000000000..6ec8575a2ab39
--- /dev/null
+++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/__snapshots__/formatting.test.js.snap
@@ -0,0 +1,31 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`setupMode formatting formatProductName should format the product name for apm 1`] = `"APM"`;
+
+exports[`setupMode formatting formatProductName should format the product name for beats 1`] = `"Beats"`;
+
+exports[`setupMode formatting formatProductName should format the product name for elasticsearch 1`] = `"Elasticsearch"`;
+
+exports[`setupMode formatting formatProductName should format the product name for kibana 1`] = `"Kibana"`;
+
+exports[`setupMode formatting formatProductName should format the product name for logstash 1`] = `"Logstash"`;
+
+exports[`setupMode formatting getIdentifier should get the plural identifier for apm 1`] = `"servers"`;
+
+exports[`setupMode formatting getIdentifier should get the plural identifier for beats 1`] = `"instances"`;
+
+exports[`setupMode formatting getIdentifier should get the plural identifier for elasticsearch 1`] = `"nodes"`;
+
+exports[`setupMode formatting getIdentifier should get the plural identifier for kibana 1`] = `"instances"`;
+
+exports[`setupMode formatting getIdentifier should get the plural identifier for logstash 1`] = `"nodes"`;
+
+exports[`setupMode formatting getIdentifier should get the singular identifier for apm 1`] = `"server"`;
+
+exports[`setupMode formatting getIdentifier should get the singular identifier for beats 1`] = `"instance"`;
+
+exports[`setupMode formatting getIdentifier should get the singular identifier for elasticsearch 1`] = `"node"`;
+
+exports[`setupMode formatting getIdentifier should get the singular identifier for kibana 1`] = `"instance"`;
+
+exports[`setupMode formatting getIdentifier should get the singular identifier for logstash 1`] = `"node"`;
diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/__snapshots__/listing_callout.test.js.snap b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/__snapshots__/listing_callout.test.js.snap
new file mode 100644
index 0000000000000..62b6bfcdef7b0
--- /dev/null
+++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/__snapshots__/listing_callout.test.js.snap
@@ -0,0 +1,431 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`setupMode ListingCallOut all internally collected should render for apm 1`] = `
+
+
+
+ These APM servers are monitored through internal collection. Migrate to monitor with Metricbeat.
+
+
+
+
+`;
+
+exports[`setupMode ListingCallOut all internally collected should render for beats 1`] = `
+
+
+
+ These Beats instances are monitored through internal collection. Migrate to monitor with Metricbeat.
+
+
+
+
+`;
+
+exports[`setupMode ListingCallOut all internally collected should render for elasticsearch 1`] = `
+
+
+
+ These Elasticsearch nodes are monitored through internal collection. Migrate to monitor with Metricbeat.
+
+
+
+
+`;
+
+exports[`setupMode ListingCallOut all internally collected should render for kibana 1`] = `
+
+
+
+ These Kibana instances are monitored through internal collection. Migrate to monitor with Metricbeat.
+
+
+
+
+`;
+
+exports[`setupMode ListingCallOut all internally collected should render for logstash 1`] = `
+
+
+
+ These Logstash nodes are monitored through internal collection. Migrate to monitor with Metricbeat.
+
+
+
+
+`;
+
+exports[`setupMode ListingCallOut all migrated should render for apm 1`] = `
+
+
+
+
+`;
+
+exports[`setupMode ListingCallOut all migrated should render for beats 1`] = `
+
+
+
+
+`;
+
+exports[`setupMode ListingCallOut all migrated should render for elasticsearch 1`] = `
+
+
+
+
+`;
+
+exports[`setupMode ListingCallOut all migrated should render for kibana 1`] = `
+
+
+
+
+`;
+
+exports[`setupMode ListingCallOut all migrated should render for logstash 1`] = `
+
+
+
+
+`;
+
+exports[`setupMode ListingCallOut all partially migrated should render for apm 1`] = `
+
+
+
+ Metricbeat is now monitoring your APM servers. Disable internal collection to finish the migration.
+
+
+
+
+`;
+
+exports[`setupMode ListingCallOut all partially migrated should render for beats 1`] = `
+
+
+
+ Metricbeat is now monitoring your Beats instances. Disable internal collection to finish the migration.
+
+
+
+
+`;
+
+exports[`setupMode ListingCallOut all partially migrated should render for elasticsearch 1`] = `
+
+
+
+ Metricbeat is now monitoring your Elasticsearch nodes. Disable internal collection to finish the migration.
+
+
+
+
+`;
+
+exports[`setupMode ListingCallOut all partially migrated should render for kibana 1`] = `
+
+
+
+ Metricbeat is now monitoring your Kibana instances. Disable internal collection to finish the migration.
+
+
+
+
+`;
+
+exports[`setupMode ListingCallOut all partially migrated should render for logstash 1`] = `
+
+
+
+ Metricbeat is now monitoring your Logstash nodes. Disable internal collection to finish the migration.
+
+
+
+
+`;
+
+exports[`setupMode ListingCallOut no detectable instances should render for apm 1`] = `
+
+
+
+ If you have APM servers, click 'Set up monitoring' below to monitor with Metricbeat.
+
+
+
+
+`;
+
+exports[`setupMode ListingCallOut no detectable instances should render for beats 1`] = `
+
+
+
+ If you have Beats instances, click 'Set up monitoring' below to monitor with Metricbeat.
+
+
+
+
+`;
+
+exports[`setupMode ListingCallOut no detectable instances should render for elasticsearch 1`] = `
+
+
+
+ If you have Elasticsearch nodes, click 'Set up monitoring' below to monitor with Metricbeat.
+
+
+
+
+`;
+
+exports[`setupMode ListingCallOut no detectable instances should render for kibana 1`] = `
+
+
+
+ If you have Kibana instances, click 'Set up monitoring' below to monitor with Metricbeat.
+
+
+
+
+`;
+
+exports[`setupMode ListingCallOut no detectable instances should render for logstash 1`] = `
+
+
+
+ If you have Logstash nodes, click 'Set up monitoring' below to monitor with Metricbeat.
+
+
+
+
+`;
+
+exports[`setupMode ListingCallOut only detectable instances should render for apm 1`] = `
+
+
+
+ Based on your indices, we think you might have a APM server. Click 'Set up monitoring' below to start monitoring this server.
+
+
+
+
+`;
+
+exports[`setupMode ListingCallOut only detectable instances should render for beats 1`] = `
+
+
+
+ Based on your indices, we think you might have a Beats instance. Click 'Set up monitoring' below to start monitoring this instance.
+
+
+
+
+`;
+
+exports[`setupMode ListingCallOut only detectable instances should render for elasticsearch 1`] = `
+
+
+
+ Based on your indices, we think you might have a Elasticsearch node. Click 'Set up monitoring' below to start monitoring this node.
+
+
+
+
+`;
+
+exports[`setupMode ListingCallOut only detectable instances should render for kibana 1`] = `
+
+
+
+ Based on your indices, we think you might have a Kibana instance. Click 'Set up monitoring' below to start monitoring this instance.
+
+
+
+
+`;
+
+exports[`setupMode ListingCallOut only detectable instances should render for logstash 1`] = `
+
+
+
+ Based on your indices, we think you might have a Logstash node. Click 'Set up monitoring' below to start monitoring this node.
+
+
+
+
+`;
diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/__snapshots__/tooltip.test.js.snap b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/__snapshots__/tooltip.test.js.snap
new file mode 100644
index 0000000000000..59322a3050952
--- /dev/null
+++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/__snapshots__/tooltip.test.js.snap
@@ -0,0 +1,531 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`setupMode SetupModeTooltip allInternalCollection should render for apm 1`] = `
+
+
+
+ Internal collection
+
+
+
+`;
+
+exports[`setupMode SetupModeTooltip allInternalCollection should render for beats 1`] = `
+
+
+
+ Internal collection
+
+
+
+`;
+
+exports[`setupMode SetupModeTooltip allInternalCollection should render for elasticsearch 1`] = `
+
+
+
+ Internal collection
+
+
+
+`;
+
+exports[`setupMode SetupModeTooltip allInternalCollection should render for kibana 1`] = `
+
+
+
+ Internal collection
+
+
+
+`;
+
+exports[`setupMode SetupModeTooltip allInternalCollection should render for logstash 1`] = `
+
+
+
+ Internal collection
+
+
+
+`;
+
+exports[`setupMode SetupModeTooltip allMonitoredByMetricbeat should render for apm 1`] = `
+
+
+
+ Metricbeat collection
+
+
+
+`;
+
+exports[`setupMode SetupModeTooltip allMonitoredByMetricbeat should render for beats 1`] = `
+
+
+
+ Metricbeat collection
+
+
+
+`;
+
+exports[`setupMode SetupModeTooltip allMonitoredByMetricbeat should render for elasticsearch 1`] = `
+
+
+
+ Metricbeat collection
+
+
+
+`;
+
+exports[`setupMode SetupModeTooltip allMonitoredByMetricbeat should render for kibana 1`] = `
+
+
+
+ Metricbeat collection
+
+
+
+`;
+
+exports[`setupMode SetupModeTooltip allMonitoredByMetricbeat should render for logstash 1`] = `
+
+
+
+ Metricbeat collection
+
+
+
+`;
+
+exports[`setupMode SetupModeTooltip internalCollectionOn should render for apm 1`] = `
+
+
+
+ Internal collection and Metricbeat collection
+
+
+
+`;
+
+exports[`setupMode SetupModeTooltip internalCollectionOn should render for beats 1`] = `
+
+
+
+ Internal collection and Metricbeat collection
+
+
+
+`;
+
+exports[`setupMode SetupModeTooltip internalCollectionOn should render for elasticsearch 1`] = `
+
+
+
+ Internal collection and Metricbeat collection
+
+
+
+`;
+
+exports[`setupMode SetupModeTooltip internalCollectionOn should render for kibana 1`] = `
+
+
+
+ Internal collection and Metricbeat collection
+
+
+
+`;
+
+exports[`setupMode SetupModeTooltip internalCollectionOn should render for logstash 1`] = `
+
+
+
+ Internal collection and Metricbeat collection
+
+
+
+`;
+
+exports[`setupMode SetupModeTooltip no detectable instances should render for apm 1`] = `
+
+
+
+ No monitoring
+
+
+
+`;
+
+exports[`setupMode SetupModeTooltip no detectable instances should render for beats 1`] = `
+
+
+
+ No monitoring
+
+
+
+`;
+
+exports[`setupMode SetupModeTooltip no detectable instances should render for elasticsearch 1`] = `
+
+
+
+ No monitoring
+
+
+
+`;
+
+exports[`setupMode SetupModeTooltip no detectable instances should render for kibana 1`] = `
+
+
+
+ No monitoring
+
+
+
+`;
+
+exports[`setupMode SetupModeTooltip no detectable instances should render for logstash 1`] = `
+
+
+
+ No monitoring
+
+
+
+`;
+
+exports[`setupMode SetupModeTooltip only detectable instances should render for apm 1`] = `
+
+
+
+ Detected
+
+
+
+`;
+
+exports[`setupMode SetupModeTooltip only detectable instances should render for beats 1`] = `
+
+
+
+ Detected
+
+
+
+`;
+
+exports[`setupMode SetupModeTooltip only detectable instances should render for elasticsearch 1`] = `
+
+
+
+ Detected
+
+
+
+`;
+
+exports[`setupMode SetupModeTooltip only detectable instances should render for kibana 1`] = `
+
+
+
+ Detected
+
+
+
+`;
+
+exports[`setupMode SetupModeTooltip only detectable instances should render for logstash 1`] = `
+
+
+
+ Detected
+
+
+
+`;
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..8c3156a997f42 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
@@ -114,7 +114,7 @@ export function SetupModeBadge({ setupMode, productName, status, instance, clust
badgeProps.onClickAriaLabel = customText || unknown;
}
statusText = (
-
+
{customText || unknown}
);
diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.test.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.test.js
new file mode 100644
index 0000000000000..55cc9eebb9531
--- /dev/null
+++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/badge.test.js
@@ -0,0 +1,168 @@
+/*
+ * 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 { shallow } from 'enzyme';
+import { SetupModeBadge } from './badge';
+import {
+ ELASTICSEARCH_SYSTEM_ID,
+ KIBANA_SYSTEM_ID,
+ BEATS_SYSTEM_ID,
+ APM_SYSTEM_ID,
+ LOGSTASH_SYSTEM_ID
+} from '../../../common/constants';
+
+const STATUSES = [
+ {
+ name: 'internal collection',
+ status: {
+ isInternalCollector: true
+ }
+ },
+ {
+ name: 'partially migrated',
+ status: {
+ isPartiallyMigrated: true
+ }
+ },
+ {
+ name: 'metricbeat collection',
+ status: {
+ isFullyMigrated: true
+ }
+ },
+ {
+ name: 'net new user',
+ status: {
+ isNetNewUser: true
+ }
+ },
+ {
+ name: 'unknown',
+ status: {}
+ }
+];
+
+const PRODUCTS = [
+ {
+ name: ELASTICSEARCH_SYSTEM_ID
+ },
+ {
+ name: KIBANA_SYSTEM_ID
+ },
+ {
+ name: LOGSTASH_SYSTEM_ID
+ },
+ {
+ name: BEATS_SYSTEM_ID
+ },
+ {
+ name: APM_SYSTEM_ID
+ }
+];
+
+describe('setupMode SetupModeBadge', () => {
+ for (const status of STATUSES) {
+ describe(`${status.name}`, () => {
+ it('should render each product consistently', () => {
+ let template = null;
+ for (const { name } of PRODUCTS) {
+ const component = shallow(
+
+ );
+ if (!template) {
+ template = component;
+ expect(component).toMatchSnapshot();
+ } else {
+ expect(template.debug()).toEqual(component.debug());
+ }
+ }
+ });
+ });
+ }
+
+ it('should call openFlyout when clicked', () => {
+ const openFlyout = jest.fn();
+ const instance = {
+ id: 1
+ };
+ const component = shallow(
+
+ );
+
+ component.find('EuiBadge').simulate('click');
+ expect(openFlyout).toHaveBeenCalledWith(instance);
+ });
+
+ it('should use a custom action for the live elasticsearch cluster', () => {
+ const shortcutToFinishMigration = jest.fn();
+ const component = shallow(
+
+ );
+ component.find('EuiBadge').simulate('click');
+ expect(shortcutToFinishMigration).toHaveBeenCalled();
+ });
+
+ it('should use a text status if internal collection cannot be disabled yet for elasticsearch', () => {
+ const component = shallow(
+
+ );
+
+ expect(component).toMatchSnapshot();
+ });
+});
diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/formatting.test.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/formatting.test.js
new file mode 100644
index 0000000000000..06d72bdb0665e
--- /dev/null
+++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/formatting.test.js
@@ -0,0 +1,52 @@
+/*
+ * 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 { formatProductName, getIdentifier } from './formatting';
+import {
+ ELASTICSEARCH_SYSTEM_ID,
+ KIBANA_SYSTEM_ID,
+ BEATS_SYSTEM_ID,
+ APM_SYSTEM_ID,
+ LOGSTASH_SYSTEM_ID
+} from '../../../common/constants';
+
+const PRODUCTS = [
+ {
+ name: ELASTICSEARCH_SYSTEM_ID
+ },
+ {
+ name: KIBANA_SYSTEM_ID
+ },
+ {
+ name: LOGSTASH_SYSTEM_ID
+ },
+ {
+ name: BEATS_SYSTEM_ID
+ },
+ {
+ name: APM_SYSTEM_ID
+ }
+];
+
+describe('setupMode formatting', () => {
+ describe('formatProductName', () => {
+ for (const { name } of PRODUCTS) {
+ it(`should format the product name for ${name}`, () => {
+ expect(formatProductName(name)).toMatchSnapshot();
+ });
+ }
+ });
+ describe('getIdentifier', () => {
+ for (const { name } of PRODUCTS) {
+ it(`should get the singular identifier for ${name}`, () => {
+ expect(getIdentifier(name)).toMatchSnapshot();
+ });
+ it(`should get the plural identifier for ${name}`, () => {
+ expect(getIdentifier(name, true)).toMatchSnapshot();
+ });
+ }
+ });
+});
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..a204c525951e5 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,8 +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}.`,
+ defaultMessage: `Based on your indices, we think you might have a {product} {identifier}. Click 'Set up monitoring' below to start monitoring this {identifier}.`, // eslint-disable-line max-len
values: {
product: formatProductName(productName),
identifier: getIdentifier(productName)
@@ -111,8 +110,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.`,
+ defaultMessage: `Metricbeat is now monitoring your {product} {identifier}. Disable internal collection to finish the migration.`, // eslint-disable-line max-len
values: {
product: formatProductName(productName),
identifier: getIdentifier(productName, true)
diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.test.js b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.test.js
new file mode 100644
index 0000000000000..5eb223a071965
--- /dev/null
+++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/listing_callout.test.js
@@ -0,0 +1,110 @@
+/*
+ * 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 { shallow } from 'enzyme';
+import { ListingCallOut } from './listing_callout';
+import {
+ ELASTICSEARCH_SYSTEM_ID,
+ KIBANA_SYSTEM_ID,
+ BEATS_SYSTEM_ID,
+ APM_SYSTEM_ID,
+ LOGSTASH_SYSTEM_ID
+} from '../../../common/constants';
+
+const SCENARIOS = [
+ {
+ name: 'no detectable instances',
+ data: {
+ totalUniqueInstanceCount: 0,
+ detected: {
+ mightExist: false
+ }
+ }
+ },
+ {
+ name: 'only detectable instances',
+ data: {
+ totalUniqueInstanceCount: 0,
+ detected: {
+ mightExist: true
+ }
+ }
+ },
+ {
+ name: 'all migrated',
+ data: {
+ totalUniqueInstanceCount: 1,
+ totalUniqueFullyMigratedCount: 1
+ }
+ },
+ {
+ name: 'all partially migrated',
+ data: {
+ totalUniqueInstanceCount: 1,
+ totalUniquePartiallyMigratedCount: 1
+ }
+ },
+ {
+ name: 'all internally collected',
+ data: {
+ totalUniqueInstanceCount: 1,
+ totalUniquePartiallyMigratedCount: 0,
+ totalUniqueFullyMigratedCount: 0
+ }
+ },
+];
+
+const PRODUCTS = [
+ {
+ name: ELASTICSEARCH_SYSTEM_ID
+ },
+ {
+ name: KIBANA_SYSTEM_ID
+ },
+ {
+ name: LOGSTASH_SYSTEM_ID
+ },
+ {
+ name: BEATS_SYSTEM_ID
+ },
+ {
+ name: APM_SYSTEM_ID
+ }
+];
+
+describe('setupMode ListingCallOut', () => {
+ for (const scenario of SCENARIOS) {
+ describe(`${scenario.name}`, () => {
+ for (const { name } of PRODUCTS) {
+ it(`should render for ${name}`, () => {
+ const component = shallow(
+
+ );
+ expect(component).toMatchSnapshot();
+ });
+ }
+ });
+ }
+
+ it('should render a custom renderer', () => {
+ const MyComponent =
Hi
;
+ const component = shallow(
+ ({
+ shouldRender: true,
+ componentToRender: MyComponent
+ })}
+ />
+ );
+ expect(component.equals(MyComponent)).toBe(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 336086abc1569..d4ce2a84159d1 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
@@ -77,8 +77,7 @@ export function SetupModeTooltip({ setupModeData, badgeClickAction, productName
{
+ for (const scenario of SCENARIOS) {
+ describe(`${scenario.name}`, () => {
+ for (const { name } of PRODUCTS) {
+ it(`should render for ${name}`, () => {
+ const component = shallow(
+ {}}
+ />
+ );
+ expect(component).toMatchSnapshot();
+ });
+ }
+ });
+ }
+});
From e252fc25562d49b5ec1bfdc65cd2dbf5815bbe3a Mon Sep 17 00:00:00 2001
From: chrisronline
Date: Thu, 12 Sep 2019 13:03:38 -0400
Subject: [PATCH 14/52] Set up mode renderer tests
---
.../__snapshots__/setup_mode.test.js.snap | 195 ++++++++++++++++
.../components/renderers/setup_mode.test.js | 217 ++++++++++++++++++
2 files changed, 412 insertions(+)
create mode 100644 x-pack/legacy/plugins/monitoring/public/components/renderers/__snapshots__/setup_mode.test.js.snap
create mode 100644 x-pack/legacy/plugins/monitoring/public/components/renderers/setup_mode.test.js
diff --git a/x-pack/legacy/plugins/monitoring/public/components/renderers/__snapshots__/setup_mode.test.js.snap b/x-pack/legacy/plugins/monitoring/public/components/renderers/__snapshots__/setup_mode.test.js.snap
new file mode 100644
index 0000000000000..d53dec4ed18d1
--- /dev/null
+++ b/x-pack/legacy/plugins/monitoring/public/components/renderers/__snapshots__/setup_mode.test.js.snap
@@ -0,0 +1,195 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`SetupModeRenderer should render the flyout open 1`] = `
+
+
+
+
+
+
+
+
+
+
+ ,
+ }
+ }
+ />
+
+
+
+
+
+
+
+
+ Exit set up mode
+
+
+
+
+
+
+
+`;
+
+exports[`SetupModeRenderer should render with setup mode disabled 1`] = `
+
+
+
+`;
+
+exports[`SetupModeRenderer should render with setup mode enabled 1`] = `
+
+
+
+
+
+
+
+
+
+ ,
+ }
+ }
+ />
+
+
+
+
+
+
+
+
+ Exit set up mode
+
+
+
+
+
+
+
+`;
diff --git a/x-pack/legacy/plugins/monitoring/public/components/renderers/setup_mode.test.js b/x-pack/legacy/plugins/monitoring/public/components/renderers/setup_mode.test.js
new file mode 100644
index 0000000000000..f767d10b7b590
--- /dev/null
+++ b/x-pack/legacy/plugins/monitoring/public/components/renderers/setup_mode.test.js
@@ -0,0 +1,217 @@
+/*
+ * 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 { shallow } from 'enzyme';
+import { ELASTICSEARCH_SYSTEM_ID } from '../../../common/constants';
+
+describe('SetupModeRenderer', () => {
+ beforeEach(() => jest.resetModules());
+
+ it('should render with setup mode disabled', () => {
+ jest.doMock('../../lib/setup_mode', () => ({
+ getSetupModeState: () => ({
+ enabled: false
+ }),
+ initSetupModeState: () => {},
+ updateSetupModeData: () => {},
+ }));
+ const SetupModeRenderer = require('./setup_mode').SetupModeRenderer;
+
+ const ChildComponent = () =>
- ,
- "title": "Install Metricbeat on the same server as this filebeat",
- },
- Object {
- "children":
-
- metricbeat modules enable beat-xpack
-
-
-
-
+ {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 24/52] 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.`,
+ })}
+
{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'
})}
- {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 31/52] 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 32/52] 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)
- }
})}
@@ -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 46/52] 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 b30c856c0eab16e5c5c6e9dfb84557cc6879ba22 Mon Sep 17 00:00:00 2001
From: chrisronline
Date: Wed, 2 Oct 2019 11:05:51 -0400
Subject: [PATCH 47/52] Fix up some tests
---
.../flyout/__snapshots__/flyout.test.js.snap | 171 ++++++------------
.../__snapshots__/setup_mode.test.js.snap | 20 +-
.../components/renderers/setup_mode.test.js | 60 ++++++
.../__snapshots__/badge.test.js.snap | 6 +-
.../listing_callout.test.js.snap | 105 ++++-------
.../__snapshots__/tooltip.test.js.snap | 115 ++++++------
.../monitoring/public/lib/setup_mode.test.js | 9 +-
7 files changed, 228 insertions(+), 258 deletions(-)
diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/flyout/__snapshots__/flyout.test.js.snap b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/flyout/__snapshots__/flyout.test.js.snap
index 03fad2acf34da..47c98a64740db 100644
--- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/flyout/__snapshots__/flyout.test.js.snap
+++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/flyout/__snapshots__/flyout.test.js.snap
@@ -27,6 +27,7 @@ exports[`Flyout apm part one should render normally 1`] = `
Close
@@ -72,13 +70,11 @@ exports[`Flyout apm part one should render normally 1`] = `
grow={false}
>
Next
@@ -133,19 +129,19 @@ exports[`Flyout apm part two should show instructions to disable internal collec
,
- "title": "Disable internal collection of the APM server's monitoring metrics",
+ "title": "Disable self monitoring of the APM server's monitoring metrics",
},
Object {
"children":
- It can take up to 30 seconds to detect data, and we’ll continue checking.
+ It can take up to 30 seconds to detect data.
- Last internal collection was 0 seconds ago.
+ Last self monitoring was 0 seconds ago.
,
"status": "incomplete",
@@ -172,7 +168,7 @@ exports[`Flyout apm part two should show instructions to migrate to metricbeat 1
type="button"
>
@@ -217,11 +213,10 @@ exports[`Flyout apm part two should show instructions to migrate to metricbeat 1
@@ -381,6 +375,7 @@ exports[`Flyout beats part one should render normally 1`] = `
Close
@@ -426,13 +418,11 @@ exports[`Flyout beats part one should render normally 1`] = `
grow={false}
>
Next
@@ -492,19 +482,19 @@ exports[`Flyout beats part two should show instructions to disable internal coll
,
- "title": "Disable internal collection of beat's monitoring metrics",
+ "title": "Disable self monitoring of beat's monitoring metrics",
},
Object {
"children":
- It can take up to 30 seconds to detect data, and we’ll continue checking.
+ It can take up to 30 seconds to detect data.
- Last internal collection was 0 seconds ago.
+ Last self monitoring was 0 seconds ago.
,
"status": "incomplete",
@@ -531,7 +521,7 @@ exports[`Flyout beats part two should show instructions to migrate to metricbeat
type="button"
>
@@ -576,7 +566,6 @@ exports[`Flyout beats part two should show instructions to migrate to metricbeat
@@ -616,11 +605,10 @@ exports[`Flyout beats part two should show instructions to migrate to metricbeat
@@ -775,23 +762,12 @@ exports[`Flyout elasticsearch part one should render normally 1`] = `
Monitor \`Elasticsearch\` node with Metricbeat
-
-
- Learn about this migration.
-
-
Close
@@ -837,13 +810,11 @@ exports[`Flyout elasticsearch part one should render normally 1`] = `
grow={false}
>
Next
@@ -864,7 +835,7 @@ exports[`Flyout elasticsearch part two should show instructions to disable inter
- It can take up to 30 seconds to detect data, and we’ll continue checking.
+ It can take up to 30 seconds to detect data.
- Last internal collection was 0 seconds ago.
+ Last self monitoring was -0 seconds ago.
,
"status": "incomplete",
@@ -984,11 +955,10 @@ exports[`Flyout elasticsearch part two should show instructions to migrate to me
-
-
- Learn about this migration.
-
-
Close
@@ -1205,13 +1160,11 @@ exports[`Flyout kibana part one should render normally 1`] = `
grow={false}
>
Next
@@ -1275,19 +1228,19 @@ exports[`Flyout kibana part two should show instructions to disable internal col
- It can take up to 30 seconds to detect data, and we’ll continue checking.
+ It can take up to 30 seconds to detect data.
- Last internal collection was 0 seconds ago.
+ Last self monitoring was 0 seconds ago.
,
"status": "incomplete",
@@ -1314,7 +1267,7 @@ exports[`Flyout kibana part two should show instructions to migrate to metricbea
type="button"
>
@@ -1359,11 +1312,10 @@ exports[`Flyout kibana part two should show instructions to migrate to metricbea
@@ -1523,6 +1474,7 @@ exports[`Flyout logstash part one should render normally 1`] = `
Close
@@ -1568,13 +1517,11 @@ exports[`Flyout logstash part one should render normally 1`] = `
grow={false}
>
Next
@@ -1629,19 +1576,19 @@ exports[`Flyout logstash part two should show instructions to disable internal c
- It can take up to 30 seconds to detect data, and we’ll continue checking.
+ It can take up to 30 seconds to detect data.
- Last internal collection was 0 seconds ago.
+ Last self monitoring was 0 seconds ago.
,
"status": "incomplete",
@@ -1668,7 +1615,7 @@ exports[`Flyout logstash part two should show instructions to migrate to metricb
type="button"
>
@@ -1713,11 +1660,10 @@ exports[`Flyout logstash part two should show instructions to migrate to metricb
@@ -1916,19 +1861,19 @@ exports[`Flyout should render the beat type for beats for the disabling internal
,
- "title": "Disable internal collection of filebeat's monitoring metrics",
+ "title": "Disable self monitoring of filebeat's monitoring metrics",
},
Object {
"children":
- It can take up to 30 seconds to detect data, and we’ll continue checking.
+ It can take up to 30 seconds to detect data.
- Last internal collection was 0 seconds ago.
+ Last self monitoring was 0 seconds ago.
,
"status": "incomplete",
@@ -1955,7 +1900,7 @@ exports[`Flyout should render the beat type for beats for the enabling metricbea
type="button"
>
@@ -2000,7 +1945,6 @@ exports[`Flyout should render the beat type for beats for the enabling metricbea
@@ -2040,11 +1984,10 @@ exports[`Flyout should render the beat type for beats for the enabling metricbea
@@ -2236,7 +2178,6 @@ exports[`Flyout should show a restart warning for restarting the primary Kibana
@@ -2251,19 +2192,19 @@ exports[`Flyout should show a restart warning for restarting the primary Kibana
,
- "title": "Disable internal collection of Kibana monitoring metrics",
+ "title": "Disable self monitoring of Kibana monitoring metrics",
},
Object {
"children":
- It can take up to 30 seconds to detect data, and we’ll continue checking.
+ It can take up to 30 seconds to detect data.
- Last internal collection was 0 seconds ago.
+ Last self monitoring was 0 seconds ago.
,
"status": "incomplete",
diff --git a/x-pack/legacy/plugins/monitoring/public/components/renderers/__snapshots__/setup_mode.test.js.snap b/x-pack/legacy/plugins/monitoring/public/components/renderers/__snapshots__/setup_mode.test.js.snap
index f6329eb7c6bd9..12b82be333703 100644
--- a/x-pack/legacy/plugins/monitoring/public/components/renderers/__snapshots__/setup_mode.test.js.snap
+++ b/x-pack/legacy/plugins/monitoring/public/components/renderers/__snapshots__/setup_mode.test.js.snap
@@ -32,11 +32,9 @@ exports[`SetupModeRenderer should render the flyout open 1`] = `
}
/>
-
+
Exit setup mode
;
+ const scope = {};
+ const injector = {};
+ const component = shallow(
+ (
+
+ {flyoutComponent}
+
+ {bottomBarComponent}
+
+ )}
+ />
+ );
+
+ component.setState({ isFlyoutOpen: true });
+ component.update();
+ expect(setSetupModeMenuItem).toHaveBeenCalled();
+ });
});
diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/__snapshots__/badge.test.js.snap b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/__snapshots__/badge.test.js.snap
index 18fa8c15a410b..7094a9f29c974 100644
--- a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/__snapshots__/badge.test.js.snap
+++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/__snapshots__/badge.test.js.snap
@@ -36,9 +36,9 @@ exports[`setupMode SetupModeBadge partially migrated should render each product
color="warning"
iconType="flag"
onClick={[Function]}
- onClickAriaLabel="Disable internal collection"
+ onClickAriaLabel="Disable self monitoring"
>
- Disable internal collection
+ Disable self monitoring
`;
@@ -52,7 +52,7 @@ exports[`setupMode SetupModeBadge should use a text status if internal collectio
color="warning"
size="xs"
>
- Monitor all nodes with Metricbeat
+ Some nodes use only self monitoring
`;
diff --git a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/__snapshots__/listing_callout.test.js.snap b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/__snapshots__/listing_callout.test.js.snap
index 62b6bfcdef7b0..6f6861a53bf3f 100644
--- a/x-pack/legacy/plugins/monitoring/public/components/setup_mode/__snapshots__/listing_callout.test.js.snap
+++ b/x-pack/legacy/plugins/monitoring/public/components/setup_mode/__snapshots__/listing_callout.test.js.snap
@@ -5,11 +5,11 @@ exports[`setupMode ListingCallOut all internally collected should render for apm
- These APM servers are monitored through internal collection. Migrate to monitor with Metricbeat.
+ These APM servers are self monitored.
+ Click 'Monitor with Metricbeat' to migrate.
- These Beats instances are monitored through internal collection. Migrate to monitor with Metricbeat.
+ These Beats instances are self monitored.
+ Click 'Monitor with Metricbeat' to migrate.
- These Elasticsearch nodes are monitored through internal collection. Migrate to monitor with Metricbeat.
+ These Elasticsearch nodes are self monitored.
+ Click 'Monitor with Metricbeat' to migrate.
- These Kibana instances are monitored through internal collection. Migrate to monitor with Metricbeat.
+ These Kibana instances are self monitored.
+ Click 'Monitor with Metricbeat' to migrate.
- These Logstash nodes are monitored through internal collection. Migrate to monitor with Metricbeat.
+ These Logstash nodes are self monitored.
+ Click 'Monitor with Metricbeat' to migrate.
- Metricbeat is now monitoring your APM servers. Disable internal collection to finish the migration.
+ Metricbeat is now monitoring your APM servers. Disable self monitoring to finish the migration.
- Metricbeat is now monitoring your Beats instances. Disable internal collection to finish the migration.
+ Metricbeat is now monitoring your Beats instances. Disable self monitoring to finish the migration.
- Metricbeat is now monitoring your Elasticsearch nodes. Disable internal collection to finish the migration.
+ Metricbeat is now monitoring your Elasticsearch nodes. Disable self monitoring to finish the migration.
- Metricbeat is now monitoring your Kibana instances. Disable internal collection to finish the migration.
+ Metricbeat is now monitoring your Kibana instances. Disable self monitoring to finish the migration.
- Metricbeat is now monitoring your Logstash nodes. Disable internal collection to finish the migration.
+ Metricbeat is now monitoring your Logstash nodes. Disable self monitoring to finish the migration.
- If you have APM servers, click 'Set up monitoring' below to monitor with Metricbeat.
+ Click 'Set up monitoring' to start monitoring with Metricbeat.
- If you have Beats instances, click 'Set up monitoring' below to monitor with Metricbeat.
+ Click 'Set up monitoring' to start monitoring with Metricbeat.
- If you have Elasticsearch nodes, click 'Set up monitoring' below to monitor with Metricbeat.
+ Click 'Set up monitoring' to start monitoring with Metricbeat.
- If you have Kibana instances, click 'Set up monitoring' below to monitor with Metricbeat.
+ Click 'Set up monitoring' to start monitoring with Metricbeat.
- If you have Logstash nodes, click 'Set up monitoring' below to monitor with Metricbeat.
+ Click 'Set up monitoring' to start monitoring with Metricbeat.
- Based on your indices, we think you might have a APM server. Click 'Set up monitoring' below to start monitoring this server.
+ Click 'Set up monitoring' below to start monitoring this server.
- Based on your indices, we think you might have a Beats instance. Click 'Set up monitoring' below to start monitoring this instance.
+ Click 'Set up monitoring' below to start monitoring this instance.
- Based on your indices, we think you might have a Elasticsearch node. Click 'Set up monitoring' below to start monitoring this node.
+ Click 'Set up monitoring' below to start monitoring this node.
- Based on your indices, we think you might have a Kibana instance. Click 'Set up monitoring' below to start monitoring this instance.
+ Click 'Set up monitoring' below to start monitoring this instance.
- Based on your indices, we think you might have a Logstash node. Click 'Set up monitoring' below to start monitoring this node.
+ Click 'Set up monitoring' below to start monitoring this node.
@@ -13,9 +13,9 @@ exports[`setupMode SetupModeTooltip allInternalCollection should render for apm
color="danger"
iconType="flag"
onClick={[Function]}
- onClickAriaLabel="Internal collection"
+ onClickAriaLabel="Self monitoring"
>
- Internal collection
+ Self monitoring
@@ -26,7 +26,7 @@ exports[`setupMode SetupModeTooltip allInternalCollection should render for beat
grow={false}
>
@@ -34,9 +34,9 @@ exports[`setupMode SetupModeTooltip allInternalCollection should render for beat
color="danger"
iconType="flag"
onClick={[Function]}
- onClickAriaLabel="Internal collection"
+ onClickAriaLabel="Self monitoring"
>
- Internal collection
+ Self monitoring
@@ -47,7 +47,7 @@ exports[`setupMode SetupModeTooltip allInternalCollection should render for elas
grow={false}
>
@@ -55,9 +55,9 @@ exports[`setupMode SetupModeTooltip allInternalCollection should render for elas
color="danger"
iconType="flag"
onClick={[Function]}
- onClickAriaLabel="Internal collection"
+ onClickAriaLabel="Self monitoring"
>
- Internal collection
+ Self monitoring
@@ -68,7 +68,7 @@ exports[`setupMode SetupModeTooltip allInternalCollection should render for kiba
grow={false}
>
@@ -76,9 +76,9 @@ exports[`setupMode SetupModeTooltip allInternalCollection should render for kiba
color="danger"
iconType="flag"
onClick={[Function]}
- onClickAriaLabel="Internal collection"
+ onClickAriaLabel="Self monitoring"
>
- Internal collection
+ Self monitoring
@@ -89,7 +89,7 @@ exports[`setupMode SetupModeTooltip allInternalCollection should render for logs
grow={false}
>
@@ -97,9 +97,9 @@ exports[`setupMode SetupModeTooltip allInternalCollection should render for logs
color="danger"
iconType="flag"
onClick={[Function]}
- onClickAriaLabel="Internal collection"
+ onClickAriaLabel="Self monitoring"
>
- Internal collection
+ Self monitoring
@@ -118,9 +118,9 @@ exports[`setupMode SetupModeTooltip allMonitoredByMetricbeat should render for a
color="secondary"
iconType="flag"
onClick={[Function]}
- onClickAriaLabel="Metricbeat collection"
+ onClickAriaLabel="Metricbeat monitoring"
>
- Metricbeat collection
+ Metricbeat monitoring
@@ -139,9 +139,9 @@ exports[`setupMode SetupModeTooltip allMonitoredByMetricbeat should render for b
color="secondary"
iconType="flag"
onClick={[Function]}
- onClickAriaLabel="Metricbeat collection"
+ onClickAriaLabel="Metricbeat monitoring"
>
- Metricbeat collection
+ Metricbeat monitoring
@@ -160,9 +160,9 @@ exports[`setupMode SetupModeTooltip allMonitoredByMetricbeat should render for e
color="secondary"
iconType="flag"
onClick={[Function]}
- onClickAriaLabel="Metricbeat collection"
+ onClickAriaLabel="Metricbeat monitoring"
>
- Metricbeat collection
+ Metricbeat monitoring
@@ -181,9 +181,9 @@ exports[`setupMode SetupModeTooltip allMonitoredByMetricbeat should render for k
color="secondary"
iconType="flag"
onClick={[Function]}
- onClickAriaLabel="Metricbeat collection"
+ onClickAriaLabel="Metricbeat monitoring"
>
- Metricbeat collection
+ Metricbeat monitoring
@@ -202,9 +202,9 @@ exports[`setupMode SetupModeTooltip allMonitoredByMetricbeat should render for l
color="secondary"
iconType="flag"
onClick={[Function]}
- onClickAriaLabel="Metricbeat collection"
+ onClickAriaLabel="Metricbeat monitoring"
>
- Metricbeat collection
+ Metricbeat monitoring
@@ -215,8 +215,7 @@ exports[`setupMode SetupModeTooltip internalCollectionOn should render for apm 1
grow={false}
>
@@ -224,9 +223,9 @@ exports[`setupMode SetupModeTooltip internalCollectionOn should render for apm 1
color="warning"
iconType="flag"
onClick={[Function]}
- onClickAriaLabel="Internal collection is on"
+ onClickAriaLabel="Self monitoring is on"
>
- Internal collection is on
+ Self monitoring is on
@@ -237,8 +236,7 @@ exports[`setupMode SetupModeTooltip internalCollectionOn should render for beats
grow={false}
>
@@ -246,9 +244,9 @@ exports[`setupMode SetupModeTooltip internalCollectionOn should render for beats
color="warning"
iconType="flag"
onClick={[Function]}
- onClickAriaLabel="Internal collection is on"
+ onClickAriaLabel="Self monitoring is on"
>
- Internal collection is on
+ Self monitoring is on
@@ -259,8 +257,7 @@ exports[`setupMode SetupModeTooltip internalCollectionOn should render for elast
grow={false}
>
@@ -268,9 +265,9 @@ exports[`setupMode SetupModeTooltip internalCollectionOn should render for elast
color="warning"
iconType="flag"
onClick={[Function]}
- onClickAriaLabel="Internal collection is on"
+ onClickAriaLabel="Self monitoring is on"
>
- Internal collection is on
+ Self monitoring is on
@@ -281,8 +278,7 @@ exports[`setupMode SetupModeTooltip internalCollectionOn should render for kiban
grow={false}
>
@@ -290,9 +286,9 @@ exports[`setupMode SetupModeTooltip internalCollectionOn should render for kiban
color="warning"
iconType="flag"
onClick={[Function]}
- onClickAriaLabel="Internal collection is on"
+ onClickAriaLabel="Self monitoring is on"
>
- Internal collection is on
+ Self monitoring is on
@@ -303,8 +299,7 @@ exports[`setupMode SetupModeTooltip internalCollectionOn should render for logst
grow={false}
>
@@ -312,9 +307,9 @@ exports[`setupMode SetupModeTooltip internalCollectionOn should render for logst
color="warning"
iconType="flag"
onClick={[Function]}
- onClickAriaLabel="Internal collection is on"
+ onClickAriaLabel="Self monitoring is on"
>
- Internal collection is on
+ Self monitoring is on
@@ -325,7 +320,7 @@ exports[`setupMode SetupModeTooltip no detectable instances should render for ap
grow={false}
>
@@ -346,7 +341,7 @@ exports[`setupMode SetupModeTooltip no detectable instances should render for be
grow={false}
>
@@ -367,7 +362,7 @@ exports[`setupMode SetupModeTooltip no detectable instances should render for el
grow={false}
>
@@ -388,7 +383,7 @@ exports[`setupMode SetupModeTooltip no detectable instances should render for ki
grow={false}
>
@@ -409,7 +404,7 @@ exports[`setupMode SetupModeTooltip no detectable instances should render for lo
grow={false}
>
@@ -438,9 +433,9 @@ exports[`setupMode SetupModeTooltip only detectable instances should render for
color="warning"
iconType="flag"
onClick={[Function]}
- onClickAriaLabel="No collection"
+ onClickAriaLabel="No monitoring"
>
- No collection
+ No monitoring
@@ -459,9 +454,9 @@ exports[`setupMode SetupModeTooltip only detectable instances should render for
color="warning"
iconType="flag"
onClick={[Function]}
- onClickAriaLabel="No collection"
+ onClickAriaLabel="No monitoring"
>
- No collection
+ No monitoring
@@ -480,9 +475,9 @@ exports[`setupMode SetupModeTooltip only detectable instances should render for
color="warning"
iconType="flag"
onClick={[Function]}
- onClickAriaLabel="No collection"
+ onClickAriaLabel="No monitoring"
>
- No collection
+ No monitoring
@@ -501,9 +496,9 @@ exports[`setupMode SetupModeTooltip only detectable instances should render for
color="warning"
iconType="flag"
onClick={[Function]}
- onClickAriaLabel="No collection"
+ onClickAriaLabel="No monitoring"
>
- No collection
+ No monitoring
@@ -522,9 +517,9 @@ exports[`setupMode SetupModeTooltip only detectable instances should render for
color="warning"
iconType="flag"
onClick={[Function]}
- onClickAriaLabel="No collection"
+ onClickAriaLabel="No monitoring"
>
- No collection
+ No monitoring
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
index efc988fca2450..b5878c7ec5181 100644
--- a/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.test.js
+++ b/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.test.js
@@ -4,7 +4,13 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { toggleSetupMode, initSetupModeState, getSetupModeState, updateSetupModeData } from './setup_mode';
+import {
+ toggleSetupMode,
+ initSetupModeState,
+ getSetupModeState,
+ updateSetupModeData,
+ setSetupModeMenuItem
+} from './setup_mode';
jest.mock('./ajax_error_handler', () => ({
ajaxErrorHandlersProvider: err => {
@@ -83,6 +89,7 @@ describe('setup_mode', () => {
it('should set top nav config', async () => {
initSetupModeState(angularStateMock.scope, angularStateMock.injector);
+ setSetupModeMenuItem();
expect(angularStateMock.scope.topNavMenu.length).toBe(1);
await toggleSetupMode(true);
expect(angularStateMock.scope.topNavMenu.length).toBe(0);
From ed2725183d4df6fc7100e1dbffec44f26b6a0c75 Mon Sep 17 00:00:00 2001
From: chrisronline
Date: Wed, 2 Oct 2019 11:10:19 -0400
Subject: [PATCH 48/52] 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) {
From 29a0a8eaab61422b3f2409bc6eb444f2188a3f10 Mon Sep 17 00:00:00 2001
From: chrisronline
Date: Wed, 2 Oct 2019 11:16:35 -0400
Subject: [PATCH 49/52] Update snapshot
---
.../flyout/__snapshots__/flyout.test.js.snap | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/flyout/__snapshots__/flyout.test.js.snap b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/flyout/__snapshots__/flyout.test.js.snap
index 47c98a64740db..eec24b23c6e23 100644
--- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/flyout/__snapshots__/flyout.test.js.snap
+++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/flyout/__snapshots__/flyout.test.js.snap
@@ -875,7 +875,7 @@ exports[`Flyout elasticsearch part two should show instructions to disable inter
It can take up to 30 seconds to detect data.
- Last self monitoring was -0 seconds ago.
+ Last self monitoring was 0 seconds ago.