Stack monitoring - update standalone cluster query for metricbeat 8.0 (#122007) (#122219)

* use event.dataset property as filter for standalone query

* add standalone cluster listing functional test

* add metricbeat standalone cluster listing functional test

* lint

* lint

* update logstash datasets for standalone query

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kevin Lacabane <klacabane@gmail.com>
This commit is contained in:
Kibana Machine 2022-01-03 12:24:47 -05:00 committed by GitHub
parent 336963cebf
commit ebc78ca55f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 67 additions and 23686 deletions

View file

@ -28,7 +28,7 @@ export async function hasStandaloneClusters(req: LegacyRequest, indexPatterns: s
},
{
terms: {
'metricset.name': ['logstash_stats', 'logstash_state', 'beats_stats', 'beats_state'],
'event.dataset': ['logstash.node.stats', 'logstash.node', 'beat.stats', 'beat.state'],
},
},
],

View file

@ -75,6 +75,29 @@ export default function ({ getService, getPageObjects }) {
});
});
describe('with standalone cluster', () => {
const { setup, tearDown } = getLifecycleMethods(getService, getPageObjects);
before(async () => {
await setup('x-pack/test/functional/es_archives/monitoring/standalone_cluster', {
from: 'Feb 4, 2019 @ 17:50:00.000',
to: 'Feb 4, 2019 @ 17:52:00.000',
});
await clusterList.closeAlertsModal();
await clusterList.assertDefaults();
});
after(async () => {
await tearDown();
});
it('displays a standalone cluster', async () => {
expect(await clusterList.hasCluster('__standalone_cluster__')).to.be(true);
expect(await clusterList.hasCluster('lfhHkgqfTy2Vy3SvlPSvXg')).to.be(true);
});
});
describe('with all basic license clusters', () => {
const { setup, tearDown } = getLifecycleMethods(getService, getPageObjects);

View file

@ -0,0 +1,39 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import expect from '@kbn/expect';
import { getLifecycleMethods } from '../_get_lifecycle_methods';
export default function ({ getService, getPageObjects }) {
const clusterList = getService('monitoringClusterList');
describe('Cluster listing mb', () => {
describe('with standalone cluster', () => {
const { setup, tearDown } = getLifecycleMethods(getService, getPageObjects);
before(async () => {
await setup('x-pack/test/functional/es_archives/monitoring/standalone_cluster_mb', {
from: 'Feb 4, 2019 @ 17:50:00.000',
to: 'Feb 4, 2019 @ 17:52:00.000',
useCreate: true,
});
await clusterList.closeAlertsModal();
await clusterList.assertDefaults();
});
after(async () => {
await tearDown();
});
it('displays a standalone cluster', async () => {
expect(await clusterList.hasCluster('__standalone_cluster__')).to.be(true);
expect(await clusterList.hasCluster('lfhHkgqfTy2Vy3SvlPSvXg')).to.be(true);
});
});
});
}

View file

@ -11,6 +11,7 @@ export default function ({ loadTestFile }) {
loadTestFile(require.resolve('./feature_controls'));
loadTestFile(require.resolve('./cluster/list'));
loadTestFile(require.resolve('./cluster/list_mb'));
loadTestFile(require.resolve('./cluster/overview'));
// loadTestFile(require.resolve('./cluster/license'));

View file

@ -81,5 +81,8 @@ export function MonitoringClusterListProvider({ getService, getPageObjects }) {
`${SUBJ_CLUSTER_ROW_PREFIX}${clusterUuid} > clusterLicense`
);
}
hasCluster(clusterUuid) {
return testSubjects.exists(`${SUBJ_CLUSTER_ROW_PREFIX}${clusterUuid}`);
}
})();
}