Skip to content

Commit

Permalink
Stack monitoring - update standalone cluster query for metricbeat 8.0 (
Browse files Browse the repository at this point in the history
…#122007)

* 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>
  • Loading branch information
klacabane and kibanamachine authored Jan 3, 2022
1 parent c93a4a6 commit 5817a51
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 23,686 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
},
},
],
Expand Down
23 changes: 23 additions & 0 deletions x-pack/test/functional/apps/monitoring/cluster/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
39 changes: 39 additions & 0 deletions x-pack/test/functional/apps/monitoring/cluster/list_mb.js
Original file line number Diff line number Diff line change
@@ -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);
});
});
});
}
1 change: 1 addition & 0 deletions x-pack/test/functional/apps/monitoring/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'));

Expand Down
Binary file not shown.
Loading

0 comments on commit 5817a51

Please sign in to comment.