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 555e437622f93..e54a8f6ebd3ef 100644
--- a/x-pack/legacy/plugins/monitoring/public/directives/main/index.js
+++ b/x-pack/legacy/plugins/monitoring/public/directives/main/index.js
@@ -17,6 +17,7 @@ import { uiModules } from 'ui/modules';
import template from './index.html';
import { shortenPipelineHash } from '../../../common/formatting';
import 'ui/directives/kbn_href';
+import { getSetupModeState } from '../../lib/setup_mode';
const setOptions = (controller) => {
if (!controller.pipelineVersions || !controller.pipelineVersions.length || !controller.pipelineDropdownElement) {
@@ -118,6 +119,19 @@ export class MonitoringMainController {
isMlSupported() {
return this._licenseService.mlIsSupported();
}
+
+ isDisabledTab(product) {
+ const setupMode = getSetupModeState();
+ if (!setupMode.enabled || !setupMode.data) {
+ return false;
+ }
+
+ const data = setupMode.data[product] || {};
+ if (data.totalUniqueInstanceCount === 0) {
+ return true;
+ }
+ return false;
+ }
}
const uiModule = uiModules.get('plugins/monitoring/directives', []);
diff --git a/x-pack/legacy/plugins/monitoring/public/lib/get_cluster_from_clusters.js b/x-pack/legacy/plugins/monitoring/public/lib/get_cluster_from_clusters.js
new file mode 100644
index 0000000000000..ba1873853193d
--- /dev/null
+++ b/x-pack/legacy/plugins/monitoring/public/lib/get_cluster_from_clusters.js
@@ -0,0 +1,28 @@
+/*
+ * 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 _ from 'lodash';
+
+export function getClusterFromClusters(clusters, globalState) {
+ const cluster = (() => {
+ const existingCurrent = _.find(clusters, { cluster_uuid: globalState.cluster_uuid });
+ if (existingCurrent) { return existingCurrent; }
+
+ const firstCluster = _.first(clusters);
+ if (firstCluster && firstCluster.cluster_uuid) { return firstCluster; }
+
+ return null;
+ })();
+
+ if (cluster && cluster.license) {
+ globalState.cluster_uuid = cluster.cluster_uuid;
+ globalState.ccs = cluster.ccs;
+ globalState.save();
+ return cluster;
+ }
+
+ return null;
+}
diff --git a/x-pack/legacy/plugins/monitoring/public/lib/route_init.js b/x-pack/legacy/plugins/monitoring/public/lib/route_init.js
index a5c53740fb88f..803542da7b2fa 100644
--- a/x-pack/legacy/plugins/monitoring/public/lib/route_init.js
+++ b/x-pack/legacy/plugins/monitoring/public/lib/route_init.js
@@ -6,6 +6,8 @@
import _ from 'lodash';
import { ajaxErrorHandlersProvider } from 'plugins/monitoring/lib/ajax_error_handler';
+import { getSetupModeState } from './setup_mode';
+import { getClusterFromClusters } from './get_cluster_from_clusters';
export function routeInitProvider(Private, monitoringClusters, globalState, license, kbnUrl) {
const ajaxErrorHandlers = Private(ajaxErrorHandlersProvider);
@@ -24,34 +26,24 @@ export function routeInitProvider(Private, monitoringClusters, globalState, lice
return monitoringClusters()
// Set the clusters collection and current cluster in globalState
.then((clusters) => {
- const cluster = (() => {
- const existingCurrent = _.find(clusters, { cluster_uuid: globalState.cluster_uuid });
- if (existingCurrent) { return existingCurrent; }
-
- const firstCluster = _.first(clusters);
- if (firstCluster && firstCluster.cluster_uuid) { return firstCluster; }
-
- return null;
- })();
-
- if (cluster && cluster.license) {
- globalState.cluster_uuid = cluster.cluster_uuid;
- globalState.ccs = cluster.ccs;
- globalState.save();
- } else {
+ const inSetupMode = getSetupModeState().enabled;
+ const cluster = getClusterFromClusters(clusters, globalState);
+ if (!cluster && !inSetupMode) {
return kbnUrl.redirect('/no-data');
}
- license.setLicense(cluster.license);
+ if (cluster) {
+ license.setLicense(cluster.license);
- // check if we need to redirect because of license problems
- if (!(isOnPage('license') || isOnPage('home')) && license.isExpired()) {
- return kbnUrl.redirect('/license');
- }
+ // check if we need to redirect because of license problems
+ if (!(isOnPage('license') || isOnPage('home')) && license.isExpired()) {
+ return kbnUrl.redirect('/license');
+ }
- // check if we need to redirect because of attempt at unsupported multi-cluster monitoring
- if (!isOnPage('home') && !cluster.isSupported) {
- return kbnUrl.redirect('/home');
+ // check if we need to redirect because of attempt at unsupported multi-cluster monitoring
+ if (!isOnPage('home') && !cluster.isSupported) {
+ return kbnUrl.redirect('/home');
+ }
}
return clusters;
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 e458012860547..95018cdf96dcf 100644
--- a/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.js
+++ b/x-pack/legacy/plugins/monitoring/public/lib/setup_mode.js
@@ -11,14 +11,10 @@ const angularState = {
scope: null,
};
-export const setAngularState = ($scope, $injector) => {
- angularState.scope = $scope;
- angularState.injector = $injector;
-};
const checkAngularState = () => {
if (!angularState.injector || !angularState.scope) {
throw 'Unable to interact with setup mode because the angular injector was not previously set.'
- + ' This needs to be set by calling `setAngularState`.';
+ + ' This needs to be set by calling `initSetupModeState`.';
}
};
@@ -30,6 +26,16 @@ const setupModeState = {
export const getSetupModeState = () => setupModeState;
+export const setNewlyDiscoveredClusterUuid = clusterUuid => {
+ const globalState = angularState.injector.get('globalState');
+ const executor = angularState.injector.get('$executor');
+ angularState.scope.$apply(() => {
+ globalState.cluster_uuid = clusterUuid;
+ globalState.save();
+ });
+ executor.run();
+};
+
export const fetchCollectionData = async () => {
checkAngularState();
@@ -64,10 +70,14 @@ export const updateSetupModeData = async () => {
};
export const toggleSetupMode = inSetupMode => {
- checkAngularState();
+ return new Promise(async (resolve, reject) => {
+ try {
+ checkAngularState();
+ } catch (err) {
+ return reject(err);
+ }
- const globalState = angularState.injector.get('globalState');
- angularState.scope.$evalAsync(async () => {
+ const globalState = angularState.injector.get('globalState');
setupModeState.enabled = inSetupMode;
globalState.inSetupMode = inSetupMode;
globalState.save();
@@ -77,6 +87,8 @@ export const toggleSetupMode = inSetupMode => {
if (inSetupMode) {
await updateSetupModeData();
}
+
+ resolve();
});
};
@@ -114,8 +126,9 @@ const setSetupModeMenuItem = () => {
// angularState.scope.topNavMenu = [...navItems];
};
-export const initSetupModeState = (callback) => {
- checkAngularState();
+export const initSetupModeState = ($scope, $injector, callback) => {
+ angularState.scope = $scope;
+ angularState.injector = $injector;
setSetupModeMenuItem();
callback && setupModeState.callbacks.push(callback);
diff --git a/x-pack/legacy/plugins/monitoring/public/views/all.js b/x-pack/legacy/plugins/monitoring/public/views/all.js
index 51dcce751863c..ded378b050c2d 100644
--- a/x-pack/legacy/plugins/monitoring/public/views/all.js
+++ b/x-pack/legacy/plugins/monitoring/public/views/all.js
@@ -4,6 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
+import './loading';
import './no_data';
import './access_denied';
import './alerts';
diff --git a/x-pack/legacy/plugins/monitoring/public/views/cluster/overview/index.js b/x-pack/legacy/plugins/monitoring/public/views/cluster/overview/index.js
index 9c854f61fc8b1..af80412c769e6 100644
--- a/x-pack/legacy/plugins/monitoring/public/views/cluster/overview/index.js
+++ b/x-pack/legacy/plugins/monitoring/public/views/cluster/overview/index.js
@@ -3,7 +3,7 @@
* 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 React, { Fragment } from 'react';
import { i18n } from '@kbn/i18n';
import uiRoutes from 'ui/routes';
import { routeInitProvider } from 'plugins/monitoring/lib/route_init';
@@ -11,6 +11,7 @@ import template from './index.html';
import { MonitoringViewBaseController } from '../../';
import { Overview } from 'plugins/monitoring/components/cluster/overview';
import { I18nContext } from 'ui/i18n';
+import { SetupModeRenderer } from '../../../components/renderers';
uiRoutes.when('/overview', {
template,
@@ -50,10 +51,20 @@ uiRoutes.when('/overview', {
$scope.$watch(() => this.data, data => {
this.renderReact(
- (
+
+ {flyoutComponent}
+
+
+ )}
/>
);
diff --git a/x-pack/legacy/plugins/monitoring/public/views/elasticsearch/nodes/index.js b/x-pack/legacy/plugins/monitoring/public/views/elasticsearch/nodes/index.js
index cda04d24b8203..07a4dd16bfbaf 100644
--- a/x-pack/legacy/plugins/monitoring/public/views/elasticsearch/nodes/index.js
+++ b/x-pack/legacy/plugins/monitoring/public/views/elasticsearch/nodes/index.js
@@ -8,11 +8,13 @@ import React, { Fragment } from 'react';
import { i18n } from '@kbn/i18n';
import { find } from 'lodash';
import uiRoutes from 'ui/routes';
+import { timefilter } from 'ui/timefilter';
import template from './index.html';
import { routeInitProvider } from 'plugins/monitoring/lib/route_init';
import { MonitoringViewBaseEuiTableController } from '../../';
import { ElasticsearchNodes } from '../../../components';
import { I18nContext } from 'ui/i18n';
+import { ajaxErrorHandlersProvider } from '../../../lib/ajax_error_handler';
import { SetupModeRenderer } from '../../../components/renderers';
uiRoutes.when('/elasticsearch/nodes', {
@@ -32,25 +34,47 @@ uiRoutes.when('/elasticsearch/nodes', {
$scope.cluster = find($route.current.locals.clusters, {
cluster_uuid: globalState.cluster_uuid
- });
+ }) || {};
+
+ const getPageData = ($injector) => {
+ const $http = $injector.get('$http');
+ const globalState = $injector.get('globalState');
+ const timeBounds = timefilter.getBounds();
+
+ const getNodes = (clusterUuid = globalState.cluster_uuid) => $http
+ .post(`../api/monitoring/v1/clusters/${clusterUuid}/elasticsearch/nodes`, {
+ ccs: globalState.ccs,
+ timeRange: {
+ min: timeBounds.min.toISOString(),
+ max: timeBounds.max.toISOString()
+ }
+ });
+
+ const promise = globalState.cluster_uuid ? getNodes() : new Promise(resolve => resolve({}));
+ return promise
+ .then(response => response.data)
+ .catch(err => {
+ const Private = $injector.get('Private');
+ const ajaxErrorHandlers = Private(ajaxErrorHandlersProvider);
+ return ajaxErrorHandlers(err);
+ });
+ };
super({
title: i18n.translate('xpack.monitoring.elasticsearch.nodes.routeTitle', {
defaultMessage: 'Elasticsearch - Nodes'
}),
storageKey: 'elasticsearch.nodes',
- api: `../api/monitoring/v1/clusters/${globalState.cluster_uuid}/elasticsearch/nodes`,
reactNodeId: 'elasticsearchNodesReact',
defaultData: {},
+ getPageData,
$scope,
$injector
});
this.isCcrEnabled = $scope.cluster.isCcrEnabled;
- $scope.$watch(() => this.data, data => {
- this.renderReact(data);
- });
+ $scope.$watch(() => this.data, () => this.renderReact(this.data || {}));
this.renderReact = ({ clusterStatus, nodes }) => {
super.renderReact(
diff --git a/x-pack/legacy/plugins/monitoring/public/views/loading/index.html b/x-pack/legacy/plugins/monitoring/public/views/loading/index.html
new file mode 100644
index 0000000000000..11da26a0ceed2
--- /dev/null
+++ b/x-pack/legacy/plugins/monitoring/public/views/loading/index.html
@@ -0,0 +1,5 @@
+
+
+
diff --git a/x-pack/legacy/plugins/monitoring/public/views/loading/index.js b/x-pack/legacy/plugins/monitoring/public/views/loading/index.js
new file mode 100644
index 0000000000000..423a5cc23896e
--- /dev/null
+++ b/x-pack/legacy/plugins/monitoring/public/views/loading/index.js
@@ -0,0 +1,68 @@
+/*
+ * 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 { render, unmountComponentAtNode } from 'react-dom';
+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';
+
+const REACT_DOM_ID = 'monitoringLoadingReactApp';
+
+uiRoutes
+ .when('/loading', {
+ template,
+ controller: class {
+ constructor($injector, $scope) {
+ 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,
+ // we will remove this check.
+ if (!setupMode.enabled) {
+ kbnUrl.changePath('/no-data');
+ return;
+ }
+
+ $scope.$on('$destroy', () => {
+ unmountComponentAtNode(document.getElementById(REACT_DOM_ID));
+ });
+
+ $scope.$$postDigest(() => {
+ this.renderReact();
+ });
+
+ monitoringClusters()
+ .then(clusters => {
+ if (clusters && clusters.length) {
+ kbnUrl.changePath('/home');
+ return;
+ }
+ initSetupModeState($scope, $injector);
+ return toggleSetupMode(true)
+ .then(() => {
+ kbnUrl.changePath('/elasticsearch/nodes');
+ $scope.$apply();
+ });
+ });
+ }
+
+ renderReact() {
+ render(
+
+
+ ,
+ document.getElementById(REACT_DOM_ID)
+ );
+ }
+ },
+ });
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/nodes/get_nodes/get_live_nodes.js b/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/nodes/get_nodes/get_live_nodes.js
new file mode 100644
index 0000000000000..415ff18c9f341
--- /dev/null
+++ b/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/nodes/get_nodes/get_live_nodes.js
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+export async function getLivesNodes(req) {
+ const params = {
+ path: '/_nodes',
+ method: 'GET',
+ };
+
+ const { callWithRequest } = req.server.plugins.elasticsearch.getCluster('data');
+ const { nodes } = await callWithRequest(req, 'transport.request', params);
+ return Object.keys(nodes).map(nodeId => ({
+ ...nodes[nodeId],
+ id: nodeId,
+ resolver: nodeId, // Maintain parity for UI
+ }));
+}
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 4f6352074333c..9bdcc584a8f84 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
@@ -7,6 +7,8 @@
import { get, uniq } from 'lodash';
import { METRICBEAT_INDEX_NAME_UNIQUE_TOKEN, ELASTICSEARCH_CUSTOM_ID } from '../../../../common/constants';
import { KIBANA_SYSTEM_ID, BEATS_SYSTEM_ID, LOGSTASH_SYSTEM_ID } from '../../../../../telemetry/common/constants';
+import { getLivesNodes } from '../../elasticsearch/nodes/get_nodes/get_live_nodes';
+import { KIBANA_STATS_TYPE } from '../../../../../../../../src/legacy/server/status/constants';
const NUMBER_OF_SECONDS_AGO_TO_LOOK = 30;
const APM_CUSTOM_ID = 'apm';
@@ -223,9 +225,30 @@ function shouldSkipBucket(product, bucket) {
return false;
}
+async function getLiveKibanaInstance(req) {
+ const { collectorSet } = req.server.usage;
+ const kibanaStatsCollector = collectorSet.getCollectorByType(KIBANA_STATS_TYPE);
+ if (!await kibanaStatsCollector.isReady()) {
+ return null;
+ }
+ return collectorSet.toApiFieldNames(await kibanaStatsCollector.fetch());
+}
+
+async function getLiveElasticsearchClusterUuid(req) {
+ const params = {
+ path: '/_cluster/state/cluster_uuid',
+ method: 'GET',
+ };
+
+ const { callWithRequest } = req.server.plugins.elasticsearch.getCluster('data');
+ const { cluster_uuid: clusterUuid } = await callWithRequest(req, 'transport.request', params);
+ return clusterUuid;
+}
+
/**
* This function will scan all monitoring documents within the past 30s (or a custom time range is supported too)
- * and determine which products fall into one of three states:
+ * and determine which products fall into one of four states:
+ * - isNetNewUser: This means we have detected this instance without monitoring and know that monitoring isn't connected to it. This is really only applicable to ES nodes from the same cluster Kibana is talking to.
* - isPartiallyMigrated: This means we are seeing some monitoring documents from MB and some from internal collection
* - isFullyMigrated: This means we are only seeing monitoring documents from MB
* - isInternalCollector: This means we are only seeing monitoring documents from internal collection
@@ -246,7 +269,7 @@ function shouldSkipBucket(product, bucket) {
* @param {*} indexPatterns Map of index patterns to search against (will be all .monitoring-* indices)
* @param {*} clusterUuid Optional and will be used to filter down the query if used
*/
-export const getCollectionStatus = async (req, indexPatterns, clusterUuid) => {
+export const getCollectionStatus = async (req, indexPatterns, clusterUuid, skipLiveData) => {
const config = req.server.config();
const kibanaUuid = config.get('server.uuid');
@@ -266,6 +289,9 @@ export const getCollectionStatus = async (req, indexPatterns, clusterUuid) => {
await detectProducts(req)
]);
+ const liveClusterUuid = skipLiveData ? null : await getLiveElasticsearchClusterUuid(req);
+ const liveEsNodes = skipLiveData ? [] : await getLivesNodes(req);
+ const liveKibanaInstance = skipLiveData ? {} : await getLiveKibanaInstance(req);
const indicesBuckets = get(recentDocuments, 'aggregations.indices.buckets', []);
const status = PRODUCTS.reduce((products, product) => {
@@ -285,6 +311,28 @@ export const getCollectionStatus = async (req, indexPatterns, clusterUuid) => {
const internalCollectorsUuidsMap = {};
const partiallyMigratedUuidsMap = {};
+ if (product.name === ELASTICSEARCH_CUSTOM_ID && liveEsNodes.length) {
+ productStatus.byUuid = liveEsNodes.reduce((accum, esNode) => ({
+ ...accum,
+ [esNode.id]: {
+ node: esNode,
+ isNetNewUser: true
+ },
+ }), {});
+ }
+
+ if (product.name === KIBANA_SYSTEM_ID && liveKibanaInstance) {
+ const kibanaLiveUuid = get(liveKibanaInstance, 'kibana.uuid');
+ if (kibanaLiveUuid) {
+ productStatus.byUuid = {
+ [kibanaLiveUuid]: {
+ instance: liveKibanaInstance,
+ isNetNewUser: true
+ }
+ };
+ }
+ }
+
// If there is no data, then they are a net new user
if (!indexBuckets || indexBuckets.length === 0) {
productStatus.totalUniqueInstanceCount = 0;
@@ -313,17 +361,33 @@ export const getCollectionStatus = async (req, indexPatterns, clusterUuid) => {
productStatus.totalUniquePartiallyMigratedCount = Object.keys(partiallyMigratedUuidsMap).length;
productStatus.totalUniqueFullyMigratedCount = Object.keys(fullyMigratedUuidsMap).length;
productStatus.byUuid = {
+ ...productStatus.byUuid,
...Object.keys(internalCollectorsUuidsMap).reduce((accum, uuid) => ({
...accum,
- [uuid]: { isInternalCollector: true, ...internalCollectorsUuidsMap[uuid] }
+ [uuid]: {
+ ...internalCollectorsUuidsMap[uuid],
+ ...productStatus.byUuid[uuid],
+ isInternalCollector: true,
+ isNetNewUser: false,
+ }
}), {}),
...Object.keys(partiallyMigratedUuidsMap).reduce((accum, uuid) => ({
...accum,
- [uuid]: { isPartiallyMigrated: true, ...partiallyMigratedUuidsMap[uuid] }
+ [uuid]: {
+ ...partiallyMigratedUuidsMap[uuid],
+ ...productStatus.byUuid[uuid],
+ isPartiallyMigrated: true,
+ isNetNewUser: false,
+ }
}), {}),
...Object.keys(fullyMigratedUuidsMap).reduce((accum, uuid) => ({
...accum,
- [uuid]: { isFullyMigrated: true, ...fullyMigratedUuidsMap[uuid] }
+ [uuid]: {
+ ...fullyMigratedUuidsMap[uuid],
+ ...productStatus.byUuid[uuid],
+ isFullyMigrated: true,
+ isNetNewUser: false,
+ }
}), {}),
};
}
@@ -368,26 +432,33 @@ export const getCollectionStatus = async (req, indexPatterns, clusterUuid) => {
productStatus.totalUniquePartiallyMigratedCount = Object.keys(partiallyMigratedUuidsMap).length;
productStatus.totalUniqueFullyMigratedCount = Object.keys(fullyMigratedUuidsMap).length;
productStatus.byUuid = {
+ ...productStatus.byUuid,
...Object.keys(internalCollectorsUuidsMap).reduce((accum, uuid) => ({
...accum,
[uuid]: {
+ ...internalCollectorsUuidsMap[uuid],
+ ...productStatus.byUuid[uuid],
isInternalCollector: true,
- ...internalCollectorsUuidsMap[uuid]
+ isNetNewUser: false,
}
}), {}),
...Object.keys(partiallyMigratedUuidsMap).reduce((accum, uuid) => ({
...accum,
[uuid]: {
+ ...partiallyMigratedUuidsMap[uuid],
+ ...productStatus.byUuid[uuid],
isPartiallyMigrated: true,
lastInternallyCollectedTimestamp: internalTimestamps[0],
- ...partiallyMigratedUuidsMap[uuid]
+ isNetNewUser: false,
}
}), {}),
...Object.keys(fullyMigratedUuidsMap).reduce((accum, uuid) => ({
...accum,
[uuid]: {
+ ...fullyMigratedUuidsMap[uuid],
+ ...productStatus.byUuid[uuid],
isFullyMigrated: true,
- ...fullyMigratedUuidsMap[uuid]
+ isNetNewUser: false
}
}), {}),
};
@@ -401,6 +472,7 @@ export const getCollectionStatus = async (req, indexPatterns, clusterUuid) => {
status._meta = {
secondsAgo: NUMBER_OF_SECONDS_AGO_TO_LOOK,
+ clusterUuid: liveClusterUuid,
};
return status;
diff --git a/x-pack/legacy/plugins/monitoring/server/routes/api/v1/setup/cluster_setup_status.js b/x-pack/legacy/plugins/monitoring/server/routes/api/v1/setup/cluster_setup_status.js
index 639fa2bd86f4f..2e2588c329b70 100644
--- a/x-pack/legacy/plugins/monitoring/server/routes/api/v1/setup/cluster_setup_status.js
+++ b/x-pack/legacy/plugins/monitoring/server/routes/api/v1/setup/cluster_setup_status.js
@@ -22,6 +22,17 @@ export function clusterSetupStatusRoute(server) {
params: Joi.object({
clusterUuid: Joi.string().required()
}),
+ query: Joi.object({
+ // This flag is not intended to be used in production. It was introduced
+ // as a way to ensure consistent API testing - the typical data source
+ // for API tests are archived data, where the cluster configuration and data
+ // are consistent from environment to environment. However, this endpoint
+ // also attempts to retrieve data from the running stack products (ES and Kibana)
+ // which will vary from environment to environment making it difficult
+ // to write tests against. Therefore, this flag exists and should only be used
+ // in our testing environment.
+ skipLiveData: Joi.boolean().default(false)
+ }),
payload: Joi.object({
timeRange: Joi.object({
min: Joi.date().required(),
@@ -39,7 +50,7 @@ export function clusterSetupStatusRoute(server) {
try {
await verifyMonitoringAuth(req);
const indexPatterns = getIndexPatterns(server);
- status = await getCollectionStatus(req, indexPatterns, req.params.clusterUuid);
+ status = await getCollectionStatus(req, indexPatterns, req.params.clusterUuid, req.query.skipLiveData);
} catch (err) {
throw handleError(err, req);
}
diff --git a/x-pack/legacy/plugins/monitoring/server/routes/api/v1/setup/clusters_setup_status.js b/x-pack/legacy/plugins/monitoring/server/routes/api/v1/setup/clusters_setup_status.js
index c1f8a9d1a804c..034acc3aa34b8 100644
--- a/x-pack/legacy/plugins/monitoring/server/routes/api/v1/setup/clusters_setup_status.js
+++ b/x-pack/legacy/plugins/monitoring/server/routes/api/v1/setup/clusters_setup_status.js
@@ -19,6 +19,17 @@ export function clustersSetupStatusRoute(server) {
path: '/api/monitoring/v1/setup/collection',
config: {
validate: {
+ query: Joi.object({
+ // This flag is not intended to be used in production. It was introduced
+ // as a way to ensure consistent API testing - the typical data source
+ // for API tests are archived data, where the cluster configuration and data
+ // are consistent from environment to environment. However, this endpoint
+ // also attempts to retrieve data from the running stack products (ES and Kibana)
+ // which will vary from environment to environment making it difficult
+ // to write tests against. Therefore, this flag exists and should only be used
+ // in our testing environment.
+ skipLiveData: Joi.boolean().default(false)
+ }),
payload: Joi.object({
timeRange: Joi.object({
min: Joi.date().required(),
@@ -36,7 +47,7 @@ export function clustersSetupStatusRoute(server) {
try {
await verifyMonitoringAuth(req);
const indexPatterns = getIndexPatterns(server);
- status = await getCollectionStatus(req, indexPatterns);
+ status = await getCollectionStatus(req, indexPatterns, null, req.query.skipLiveData);
} catch (err) {
throw handleError(err, req);
}
diff --git a/x-pack/legacy/plugins/monitoring/server/routes/api/v1/ui.js b/x-pack/legacy/plugins/monitoring/server/routes/api/v1/ui.js
index 418fbabeae442..302cdafc72561 100644
--- a/x-pack/legacy/plugins/monitoring/server/routes/api/v1/ui.js
+++ b/x-pack/legacy/plugins/monitoring/server/routes/api/v1/ui.js
@@ -28,7 +28,7 @@ export {
esOverviewRoute,
mlJobRoute,
ccrRoute,
- ccrShardRoute
+ ccrShardRoute,
} from './elasticsearch';
export {
clusterSettingsCheckRoute,
diff --git a/x-pack/test/api_integration/apis/monitoring/setup/collection/detect_apm.js b/x-pack/test/api_integration/apis/monitoring/setup/collection/detect_apm.js
index 36d5416494770..1f11e3c457644 100644
--- a/x-pack/test/api_integration/apis/monitoring/setup/collection/detect_apm.js
+++ b/x-pack/test/api_integration/apis/monitoring/setup/collection/detect_apm.js
@@ -7,6 +7,7 @@
import expect from '@kbn/expect';
import fixture from './fixtures/detect_apm';
+
export default function ({ getService }) {
const supertest = getService('supertest');
const esArchiver = getService('esArchiver');
@@ -28,11 +29,12 @@ export default function ({ getService }) {
it('should get collection status', async () => {
const { body } = await supertest
- .post('/api/monitoring/v1/setup/collection')
+ .post('/api/monitoring/v1/setup/collection?skipLiveData=true')
.set('kbn-xsrf', 'xxx')
.send({ timeRange })
.expect(200);
+
expect(body).to.eql(fixture);
});
});
diff --git a/x-pack/test/api_integration/apis/monitoring/setup/collection/detect_beats.js b/x-pack/test/api_integration/apis/monitoring/setup/collection/detect_beats.js
index c79db11891ac5..30e263a1a81d7 100644
--- a/x-pack/test/api_integration/apis/monitoring/setup/collection/detect_beats.js
+++ b/x-pack/test/api_integration/apis/monitoring/setup/collection/detect_beats.js
@@ -7,6 +7,7 @@
import expect from '@kbn/expect';
import fixture from './fixtures/detect_beats';
+
export default function ({ getService }) {
const supertest = getService('supertest');
const esArchiver = getService('esArchiver');
@@ -28,11 +29,12 @@ export default function ({ getService }) {
it('should get collection status', async () => {
const { body } = await supertest
- .post('/api/monitoring/v1/setup/collection')
+ .post('/api/monitoring/v1/setup/collection?skipLiveData=true')
.set('kbn-xsrf', 'xxx')
.send({ timeRange })
.expect(200);
+
expect(body).to.eql(fixture);
});
});
diff --git a/x-pack/test/api_integration/apis/monitoring/setup/collection/detect_beats_management.js b/x-pack/test/api_integration/apis/monitoring/setup/collection/detect_beats_management.js
index 4594f5a6b287b..64008f27ff8f8 100644
--- a/x-pack/test/api_integration/apis/monitoring/setup/collection/detect_beats_management.js
+++ b/x-pack/test/api_integration/apis/monitoring/setup/collection/detect_beats_management.js
@@ -7,6 +7,7 @@
import expect from '@kbn/expect';
import fixture from './fixtures/detect_beats_management';
+
export default function ({ getService }) {
const supertest = getService('supertest');
const esArchiver = getService('esArchiver');
@@ -28,10 +29,12 @@ export default function ({ getService }) {
it('should get collection status', async () => {
const { body } = await supertest
- .post('/api/monitoring/v1/setup/collection')
+ .post('/api/monitoring/v1/setup/collection?skipLiveData=true')
.set('kbn-xsrf', 'xxx')
.send({ timeRange })
.expect(200);
+
+
expect(body).to.eql(fixture);
});
});
diff --git a/x-pack/test/api_integration/apis/monitoring/setup/collection/detect_logstash.js b/x-pack/test/api_integration/apis/monitoring/setup/collection/detect_logstash.js
index cbe6ec6a27371..dcf5df172ea1b 100644
--- a/x-pack/test/api_integration/apis/monitoring/setup/collection/detect_logstash.js
+++ b/x-pack/test/api_integration/apis/monitoring/setup/collection/detect_logstash.js
@@ -7,6 +7,7 @@
import expect from '@kbn/expect';
import fixture from './fixtures/detect_logstash';
+
export default function ({ getService }) {
const supertest = getService('supertest');
const esArchiver = getService('esArchiver');
@@ -28,10 +29,12 @@ export default function ({ getService }) {
it('should get collection status', async () => {
const { body } = await supertest
- .post('/api/monitoring/v1/setup/collection')
+ .post('/api/monitoring/v1/setup/collection?skipLiveData=true')
.set('kbn-xsrf', 'xxx')
.send({ timeRange })
.expect(200);
+
+
expect(body).to.eql(fixture);
});
});
diff --git a/x-pack/test/api_integration/apis/monitoring/setup/collection/detect_logstash_management.js b/x-pack/test/api_integration/apis/monitoring/setup/collection/detect_logstash_management.js
index ae098a78ddb3b..86cfcbddd80c2 100644
--- a/x-pack/test/api_integration/apis/monitoring/setup/collection/detect_logstash_management.js
+++ b/x-pack/test/api_integration/apis/monitoring/setup/collection/detect_logstash_management.js
@@ -7,6 +7,7 @@
import expect from '@kbn/expect';
import fixture from './fixtures/detect_logstash_management';
+
export default function ({ getService }) {
const supertest = getService('supertest');
const esArchiver = getService('esArchiver');
@@ -28,10 +29,12 @@ export default function ({ getService }) {
it('should get collection status', async () => {
const { body } = await supertest
- .post('/api/monitoring/v1/setup/collection')
+ .post('/api/monitoring/v1/setup/collection?skipLiveData=true')
.set('kbn-xsrf', 'xxx')
.send({ timeRange })
.expect(200);
+
+
expect(body).to.eql(fixture);
});
});
diff --git a/x-pack/test/api_integration/apis/monitoring/setup/collection/es_and_kibana_exclusive_mb.js b/x-pack/test/api_integration/apis/monitoring/setup/collection/es_and_kibana_exclusive_mb.js
index 0f10f0d21afc7..f9980fea605c9 100644
--- a/x-pack/test/api_integration/apis/monitoring/setup/collection/es_and_kibana_exclusive_mb.js
+++ b/x-pack/test/api_integration/apis/monitoring/setup/collection/es_and_kibana_exclusive_mb.js
@@ -7,6 +7,7 @@
import expect from '@kbn/expect';
import fixture from './fixtures/es_and_kibana_exclusive_mb';
+
export default function ({ getService }) {
const supertest = getService('supertest');
const esArchiver = getService('esArchiver');
@@ -28,11 +29,12 @@ export default function ({ getService }) {
it('should get collection status', async () => {
const { body } = await supertest
- .post('/api/monitoring/v1/setup/collection')
+ .post('/api/monitoring/v1/setup/collection?skipLiveData=true')
.set('kbn-xsrf', 'xxx')
.send({ timeRange })
.expect(200);
+
expect(body).to.eql(fixture);
});
});
diff --git a/x-pack/test/api_integration/apis/monitoring/setup/collection/es_and_kibana_mb.js b/x-pack/test/api_integration/apis/monitoring/setup/collection/es_and_kibana_mb.js
index 3c91cb9917b12..7a5c4a2d35eb4 100644
--- a/x-pack/test/api_integration/apis/monitoring/setup/collection/es_and_kibana_mb.js
+++ b/x-pack/test/api_integration/apis/monitoring/setup/collection/es_and_kibana_mb.js
@@ -7,6 +7,7 @@
import expect from '@kbn/expect';
import fixture from './fixtures/es_and_kibana_mb';
+
export default function ({ getService }) {
const supertest = getService('supertest');
const esArchiver = getService('esArchiver');
@@ -28,11 +29,12 @@ export default function ({ getService }) {
it('should get collection status', async () => {
const { body } = await supertest
- .post('/api/monitoring/v1/setup/collection')
+ .post('/api/monitoring/v1/setup/collection?skipLiveData=true')
.set('kbn-xsrf', 'xxx')
.send({ timeRange })
.expect(200);
+
expect(body).to.eql(fixture);
});
});
diff --git a/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/detect_apm.json b/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/detect_apm.json
index 67c36c322c931..2989a28229a88 100644
--- a/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/detect_apm.json
+++ b/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/detect_apm.json
@@ -1,7 +1,4 @@
{
- "_meta": {
- "secondsAgo": 30
- },
"kibana": {
"totalUniqueInstanceCount": 0,
"totalUniqueFullyMigratedCount": 0,
@@ -46,5 +43,9 @@
"doesExist": true
},
"byUuid": {}
+ },
+ "_meta": {
+ "secondsAgo": 30,
+ "clusterUuid": null
}
}
diff --git a/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/detect_beats.json b/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/detect_beats.json
index 2d6526289cd5d..1759b681fc1c5 100644
--- a/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/detect_beats.json
+++ b/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/detect_beats.json
@@ -1,7 +1,4 @@
{
- "_meta": {
- "secondsAgo": 30
- },
"kibana": {
"totalUniqueInstanceCount": 1,
"totalUniqueFullyMigratedCount": 1,
@@ -9,9 +6,10 @@
"detected": null,
"byUuid": {
"5b2de169-2785-441b-ae8c-186a1936b17d": {
- "isFullyMigrated": true,
+ "lastTimestamp": 1554841069921,
"isPrimary": true,
- "lastTimestamp": 1554841069921
+ "isNetNewUser": false,
+ "isFullyMigrated": true
}
}
},
@@ -24,7 +22,7 @@
},
"byUuid": {}
},
- "apm": {
+ "logstash": {
"totalUniqueInstanceCount": 0,
"totalUniqueFullyMigratedCount": 0,
"totalUniquePartiallyMigratedCount": 0,
@@ -33,7 +31,7 @@
},
"byUuid": {}
},
- "logstash": {
+ "apm": {
"totalUniqueInstanceCount": 0,
"totalUniqueFullyMigratedCount": 0,
"totalUniquePartiallyMigratedCount": 0,
@@ -50,8 +48,13 @@
"byUuid": {
"agI8JhXhShasvuDgq0VxRg": {
"isPartiallyMigrated": true,
- "lastInternallyCollectedTimestamp": 1554841077638
+ "lastInternallyCollectedTimestamp": 1554841077638,
+ "isNetNewUser": false
}
}
+ },
+ "_meta": {
+ "secondsAgo": 30,
+ "clusterUuid": null
}
}
diff --git a/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/detect_beats_management.json b/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/detect_beats_management.json
index 6f5e55e8c244b..b3498f09dd487 100644
--- a/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/detect_beats_management.json
+++ b/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/detect_beats_management.json
@@ -1,7 +1,4 @@
{
- "_meta": {
- "secondsAgo": 30
- },
"kibana": {
"totalUniqueInstanceCount": 0,
"totalUniqueFullyMigratedCount": 0,
@@ -46,5 +43,9 @@
"doesExist": true
},
"byUuid": {}
+ },
+ "_meta": {
+ "secondsAgo": 30,
+ "clusterUuid": null
}
}
diff --git a/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/detect_logstash.json b/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/detect_logstash.json
index e84bb8765e322..f22ca7d8eb433 100644
--- a/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/detect_logstash.json
+++ b/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/detect_logstash.json
@@ -1,7 +1,4 @@
{
- "_meta": {
- "secondsAgo": 30
- },
"kibana": {
"totalUniqueInstanceCount": 0,
"totalUniqueFullyMigratedCount": 0,
@@ -46,5 +43,9 @@
"doesExist": true
},
"byUuid": {}
+ },
+ "_meta": {
+ "secondsAgo": 30,
+ "clusterUuid": null
}
}
diff --git a/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/detect_logstash_management.json b/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/detect_logstash_management.json
index e84bb8765e322..f22ca7d8eb433 100644
--- a/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/detect_logstash_management.json
+++ b/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/detect_logstash_management.json
@@ -1,7 +1,4 @@
{
- "_meta": {
- "secondsAgo": 30
- },
"kibana": {
"totalUniqueInstanceCount": 0,
"totalUniqueFullyMigratedCount": 0,
@@ -46,5 +43,9 @@
"doesExist": true
},
"byUuid": {}
+ },
+ "_meta": {
+ "secondsAgo": 30,
+ "clusterUuid": null
}
}
diff --git a/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/es_and_kibana_exclusive_mb.json b/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/es_and_kibana_exclusive_mb.json
index 00cd1c225d0a9..6a6711cfd14dd 100644
--- a/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/es_and_kibana_exclusive_mb.json
+++ b/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/es_and_kibana_exclusive_mb.json
@@ -1,7 +1,4 @@
{
- "_meta": {
- "secondsAgo": 30
- },
"kibana": {
"totalUniqueInstanceCount": 1,
"totalUniqueFullyMigratedCount": 1,
@@ -9,9 +6,10 @@
"detected": null,
"byUuid": {
"5b2de169-2785-441b-ae8c-186a1936b17d": {
- "isFullyMigrated": true,
+ "lastTimestamp": 1554821587077,
"isPrimary": true,
- "lastTimestamp": 1554821587077
+ "isNetNewUser": false,
+ "isFullyMigrated": true
}
}
},
@@ -22,18 +20,12 @@
"detected": null,
"byUuid": {
"8eba4902-df80-43b0-b6c2-ed8ca290984e": {
+ "lastTimestamp": 1554821586714,
"isInternalCollector": true,
- "lastTimestamp": 1554821586714
+ "isNetNewUser": false
}
}
},
- "apm": {
- "totalUniqueInstanceCount": 0,
- "totalUniqueFullyMigratedCount": 0,
- "totalUniquePartiallyMigratedCount": 0,
- "detected": null,
- "byUuid": {}
- },
"logstash": {
"totalUniqueInstanceCount": 1,
"totalUniqueFullyMigratedCount": 0,
@@ -41,11 +33,19 @@
"detected": null,
"byUuid": {
"4134a00e-89e4-4896-a3d4-c3a9aa03a594": {
+ "lastTimestamp": 1554821579833,
"isInternalCollector": true,
- "lastTimestamp": 1554821579833
+ "isNetNewUser": false
}
}
},
+ "apm": {
+ "totalUniqueInstanceCount": 0,
+ "totalUniqueFullyMigratedCount": 0,
+ "totalUniquePartiallyMigratedCount": 0,
+ "detected": null,
+ "byUuid": {}
+ },
"elasticsearch": {
"totalUniqueInstanceCount": 1,
"totalUniqueFullyMigratedCount": 1,
@@ -53,9 +53,14 @@
"detected": null,
"byUuid": {
"agI8JhXhShasvuDgq0VxRg": {
+ "lastTimestamp": 1554821579822,
"isFullyMigrated": true,
- "lastTimestamp": 1554821579822
+ "isNetNewUser": false
}
}
+ },
+ "_meta": {
+ "secondsAgo": 30,
+ "clusterUuid": null
}
}
diff --git a/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/es_and_kibana_mb.json b/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/es_and_kibana_mb.json
index 0133ae505bdd7..a25fa1cc9031d 100644
--- a/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/es_and_kibana_mb.json
+++ b/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/es_and_kibana_mb.json
@@ -1,7 +1,4 @@
{
- "_meta": {
- "secondsAgo": 30
- },
"kibana": {
"totalUniqueInstanceCount": 1,
"totalUniqueFullyMigratedCount": 0,
@@ -9,8 +6,9 @@
"detected": null,
"byUuid": {
"5b2de169-2785-441b-ae8c-186a1936b17d": {
- "isPartiallyMigrated": true,
"isPrimary": true,
+ "isNetNewUser": false,
+ "isPartiallyMigrated": true,
"lastInternallyCollectedTimestamp": 1554821412725
}
}
@@ -22,18 +20,12 @@
"detected": null,
"byUuid": {
"8eba4902-df80-43b0-b6c2-ed8ca290984e": {
+ "lastTimestamp": 1554821406717,
"isInternalCollector": true,
- "lastTimestamp": 1554821406717
+ "isNetNewUser": false
}
}
},
- "apm": {
- "totalUniqueInstanceCount": 0,
- "totalUniqueFullyMigratedCount": 0,
- "totalUniquePartiallyMigratedCount": 0,
- "detected": null,
- "byUuid": {}
- },
"logstash": {
"totalUniqueInstanceCount": 1,
"totalUniqueFullyMigratedCount": 0,
@@ -41,11 +33,19 @@
"detected": null,
"byUuid": {
"4134a00e-89e4-4896-a3d4-c3a9aa03a594": {
+ "lastTimestamp": 1554821409656,
"isInternalCollector": true,
- "lastTimestamp": 1554821409656
+ "isNetNewUser": false
}
}
},
+ "apm": {
+ "totalUniqueInstanceCount": 0,
+ "totalUniqueFullyMigratedCount": 0,
+ "totalUniquePartiallyMigratedCount": 0,
+ "detected": null,
+ "byUuid": {}
+ },
"elasticsearch": {
"totalUniqueInstanceCount": 1,
"totalUniqueFullyMigratedCount": 0,
@@ -54,8 +54,13 @@
"byUuid": {
"agI8JhXhShasvuDgq0VxRg": {
"isPartiallyMigrated": true,
- "lastInternallyCollectedTimestamp": 1554821411520
+ "lastInternallyCollectedTimestamp": 1554821411520,
+ "isNetNewUser": false
}
}
+ },
+ "_meta": {
+ "secondsAgo": 30,
+ "clusterUuid": null
}
}
diff --git a/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/kibana_exclusive_mb.json b/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/kibana_exclusive_mb.json
index be239b5098245..2b24e8feade4b 100644
--- a/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/kibana_exclusive_mb.json
+++ b/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/kibana_exclusive_mb.json
@@ -1,7 +1,4 @@
{
- "_meta": {
- "secondsAgo": 30
- },
"kibana": {
"totalUniqueInstanceCount": 1,
"totalUniqueFullyMigratedCount": 1,
@@ -9,9 +6,10 @@
"detected": null,
"byUuid": {
"5b2de169-2785-441b-ae8c-186a1936b17d": {
- "isFullyMigrated": true,
+ "lastTimestamp": 1554821537079,
"isPrimary": true,
- "lastTimestamp": 1554821537079
+ "isNetNewUser": false,
+ "isFullyMigrated": true
}
}
},
@@ -22,18 +20,12 @@
"detected": null,
"byUuid": {
"8eba4902-df80-43b0-b6c2-ed8ca290984e": {
+ "lastTimestamp": 1554821536716,
"isInternalCollector": true,
- "lastTimestamp": 1554821536716
+ "isNetNewUser": false
}
}
},
- "apm": {
- "totalUniqueInstanceCount": 0,
- "totalUniqueFullyMigratedCount": 0,
- "totalUniquePartiallyMigratedCount": 0,
- "detected": null,
- "byUuid": {}
- },
"logstash": {
"totalUniqueInstanceCount": 1,
"totalUniqueFullyMigratedCount": 0,
@@ -41,11 +33,19 @@
"detected": null,
"byUuid": {
"4134a00e-89e4-4896-a3d4-c3a9aa03a594": {
+ "lastTimestamp": 1554821539784,
"isInternalCollector": true,
- "lastTimestamp": 1554821539784
+ "isNetNewUser": false
}
}
},
+ "apm": {
+ "totalUniqueInstanceCount": 0,
+ "totalUniqueFullyMigratedCount": 0,
+ "totalUniquePartiallyMigratedCount": 0,
+ "detected": null,
+ "byUuid": {}
+ },
"elasticsearch": {
"totalUniqueInstanceCount": 1,
"totalUniqueFullyMigratedCount": 0,
@@ -54,8 +54,13 @@
"byUuid": {
"agI8JhXhShasvuDgq0VxRg": {
"isPartiallyMigrated": true,
- "lastInternallyCollectedTimestamp": 1554821531545
+ "lastInternallyCollectedTimestamp": 1554821531545,
+ "isNetNewUser": false
}
}
+ },
+ "_meta": {
+ "secondsAgo": 30,
+ "clusterUuid": null
}
}
diff --git a/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/kibana_mb.json b/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/kibana_mb.json
index 3da9fe55e8a29..eaca5cab53a86 100644
--- a/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/kibana_mb.json
+++ b/x-pack/test/api_integration/apis/monitoring/setup/collection/fixtures/kibana_mb.json
@@ -1,7 +1,4 @@
{
- "_meta": {
- "secondsAgo": 30
- },
"kibana": {
"totalUniqueInstanceCount": 1,
"totalUniqueFullyMigratedCount": 0,
@@ -9,8 +6,9 @@
"detected": null,
"byUuid": {
"5b2de169-2785-441b-ae8c-186a1936b17d": {
- "isPartiallyMigrated": true,
"isPrimary": true,
+ "isNetNewUser": false,
+ "isPartiallyMigrated": true,
"lastInternallyCollectedTimestamp": 1554821352739
}
}
@@ -22,18 +20,12 @@
"detected": null,
"byUuid": {
"8eba4902-df80-43b0-b6c2-ed8ca290984e": {
+ "lastTimestamp": 1554821354041,
"isInternalCollector": true,
- "lastTimestamp": 1554821354041
+ "isNetNewUser": false
}
}
},
- "apm": {
- "totalUniqueInstanceCount": 0,
- "totalUniqueFullyMigratedCount": 0,
- "totalUniquePartiallyMigratedCount": 0,
- "detected": null,
- "byUuid": {}
- },
"logstash": {
"totalUniqueInstanceCount": 1,
"totalUniqueFullyMigratedCount": 0,
@@ -41,11 +33,19 @@
"detected": null,
"byUuid": {
"4134a00e-89e4-4896-a3d4-c3a9aa03a594": {
+ "lastTimestamp": 1554821359616,
"isInternalCollector": true,
- "lastTimestamp": 1554821359616
+ "isNetNewUser": false
}
}
},
+ "apm": {
+ "totalUniqueInstanceCount": 0,
+ "totalUniqueFullyMigratedCount": 0,
+ "totalUniquePartiallyMigratedCount": 0,
+ "detected": null,
+ "byUuid": {}
+ },
"elasticsearch": {
"totalUniqueInstanceCount": 1,
"totalUniqueFullyMigratedCount": 0,
@@ -53,9 +53,14 @@
"detected": null,
"byUuid": {
"agI8JhXhShasvuDgq0VxRg": {
+ "lastTimestamp": 1554821351499,
"isInternalCollector": true,
- "lastTimestamp": 1554821351499
+ "isNetNewUser": false
}
}
+ },
+ "_meta": {
+ "secondsAgo": 30,
+ "clusterUuid": null
}
}
diff --git a/x-pack/test/api_integration/apis/monitoring/setup/collection/kibana_exclusive_mb.js b/x-pack/test/api_integration/apis/monitoring/setup/collection/kibana_exclusive_mb.js
index 4bf69dffed109..3540cb050909d 100644
--- a/x-pack/test/api_integration/apis/monitoring/setup/collection/kibana_exclusive_mb.js
+++ b/x-pack/test/api_integration/apis/monitoring/setup/collection/kibana_exclusive_mb.js
@@ -28,7 +28,7 @@ export default function ({ getService }) {
it('should get collection status', async () => {
const { body } = await supertest
- .post('/api/monitoring/v1/setup/collection')
+ .post('/api/monitoring/v1/setup/collection?skipLiveData=true')
.set('kbn-xsrf', 'xxx')
.send({ timeRange })
.expect(200);
diff --git a/x-pack/test/api_integration/apis/monitoring/setup/collection/kibana_mb.js b/x-pack/test/api_integration/apis/monitoring/setup/collection/kibana_mb.js
index 960c66f3d87b5..e7cfd0df94162 100644
--- a/x-pack/test/api_integration/apis/monitoring/setup/collection/kibana_mb.js
+++ b/x-pack/test/api_integration/apis/monitoring/setup/collection/kibana_mb.js
@@ -28,7 +28,7 @@ export default function ({ getService }) {
it('should get collection status', async () => {
const { body } = await supertest
- .post('/api/monitoring/v1/setup/collection')
+ .post('/api/monitoring/v1/setup/collection?skipLiveData=true')
.set('kbn-xsrf', 'xxx')
.send({ timeRange })
.expect(200);