mirror of
https://github.com/elastic/kibana.git
synced 2025-06-28 11:05:39 -04:00
[Stack Monitoring] implement baseline elasticsearch api tests for package and metricbeat data (#149161)
### Summary Part of https://github.com/elastic/kibana/issues/148303 Closes https://github.com/elastic/kibana/issues/146067 Closes https://github.com/elastic/kibana/issues/146068 I investigated the failing tests but couldn't get to the root cause quickly enough so I took the opportunity to port the tests to the [monitoring_api_integration](https://github.com/elastic/kibana/tree/main/x-pack/test/monitoring_api_integration) suite. This reimplements all the existing tests (plus missing ones for the `ml_jobs` api) with fresh data. By using the new testing approach we can remove the archived mappings which greatly reduce execution times. ### Testing - The suite was executed against by the [flaky test runner](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1804) multiple times with no failures - Test data is bundled in two archives (one for metricbeat and one for package data) and can be loaded to verify their content: `node scripts/es_archiver.js load x-pack/test/monitoring_api_integration/archives/elasticsearch/single_node/(package|metricbeat) --es-url=http://elastic:changeme@localhost:9200 --kibana-url=http://elastic:changeme@localhost:5601` --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
c4ea96e5ce
commit
d9adcca543
32 changed files with 342 additions and 22101 deletions
|
@ -8,20 +8,12 @@
|
||||||
export default function ({ loadTestFile }) {
|
export default function ({ loadTestFile }) {
|
||||||
describe('Elasticsearch', () => {
|
describe('Elasticsearch', () => {
|
||||||
loadTestFile(require.resolve('./overview'));
|
loadTestFile(require.resolve('./overview'));
|
||||||
loadTestFile(require.resolve('./overview_mb'));
|
|
||||||
loadTestFile(require.resolve('./nodes'));
|
loadTestFile(require.resolve('./nodes'));
|
||||||
loadTestFile(require.resolve('./nodes_mb'));
|
|
||||||
loadTestFile(require.resolve('./node_detail'));
|
loadTestFile(require.resolve('./node_detail'));
|
||||||
loadTestFile(require.resolve('./node_detail_mb'));
|
|
||||||
loadTestFile(require.resolve('./node_detail_advanced'));
|
loadTestFile(require.resolve('./node_detail_advanced'));
|
||||||
loadTestFile(require.resolve('./node_detail_advanced_mb'));
|
|
||||||
loadTestFile(require.resolve('./indices'));
|
loadTestFile(require.resolve('./indices'));
|
||||||
loadTestFile(require.resolve('./indices_mb'));
|
|
||||||
loadTestFile(require.resolve('./index_detail'));
|
loadTestFile(require.resolve('./index_detail'));
|
||||||
loadTestFile(require.resolve('./index_detail_mb'));
|
|
||||||
loadTestFile(require.resolve('./ccr'));
|
loadTestFile(require.resolve('./ccr'));
|
||||||
loadTestFile(require.resolve('./ccr_mb'));
|
|
||||||
loadTestFile(require.resolve('./ccr_shard'));
|
loadTestFile(require.resolve('./ccr_shard'));
|
||||||
loadTestFile(require.resolve('./ccr_shard_mb'));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,104 +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
|
|
||||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
|
||||||
* 2.0.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import expect from '@kbn/expect';
|
|
||||||
import relocatingShardsFixture from './fixtures/indices_shards_relocating.json';
|
|
||||||
import relocationShardsAllFixture from './fixtures/indices_shards_relocating_all.json';
|
|
||||||
import indicesRedClusterFixture from './fixtures/indices_red_cluster.json';
|
|
||||||
import indicesRedClusterAllFixture from './fixtures/indices_red_cluster_all.json';
|
|
||||||
import { getLifecycleMethods } from '../data_stream';
|
|
||||||
|
|
||||||
export default function ({ getService }) {
|
|
||||||
const supertest = getService('supertest');
|
|
||||||
const { setup, tearDown } = getLifecycleMethods(getService);
|
|
||||||
|
|
||||||
// Failing: See https://github.com/elastic/kibana/issues/146068
|
|
||||||
// Failing: See https://github.com/elastic/kibana/issues/146067
|
|
||||||
describe.skip('indices - metricbeat and package', () => {
|
|
||||||
['mb', 'package'].forEach((source) => {
|
|
||||||
describe(`indices ${source}`, () => {
|
|
||||||
describe('shard-relocation', () => {
|
|
||||||
const archive = `x-pack/test/functional/es_archives/monitoring/singlecluster_three_nodes_shard_relocation_${source}`;
|
|
||||||
const timeRange = {
|
|
||||||
min: '2017-10-05T20:31:48.000Z',
|
|
||||||
max: '2017-10-05T20:35:12.000Z',
|
|
||||||
};
|
|
||||||
|
|
||||||
before('load archive', () => {
|
|
||||||
return setup(archive);
|
|
||||||
});
|
|
||||||
|
|
||||||
after('unload archive', () => {
|
|
||||||
return tearDown(archive);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should summarize the non-system indices with stats', async () => {
|
|
||||||
const { body } = await supertest
|
|
||||||
.post(
|
|
||||||
'/api/monitoring/v1/clusters/YCxj-RAgSZCP6GuOQ8M1EQ/elasticsearch/indices?show_system_indices=false'
|
|
||||||
)
|
|
||||||
.set('kbn-xsrf', 'xxx')
|
|
||||||
.send({ timeRange })
|
|
||||||
.expect(200);
|
|
||||||
expect(body).to.eql(relocatingShardsFixture);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should summarize all indices with stats', async () => {
|
|
||||||
const { body } = await supertest
|
|
||||||
.post(
|
|
||||||
'/api/monitoring/v1/clusters/YCxj-RAgSZCP6GuOQ8M1EQ/elasticsearch/indices?show_system_indices=true'
|
|
||||||
)
|
|
||||||
.set('kbn-xsrf', 'xxx')
|
|
||||||
.send({ timeRange })
|
|
||||||
.expect(200);
|
|
||||||
|
|
||||||
expect(body).to.eql(relocationShardsAllFixture);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('health-red', () => {
|
|
||||||
const archive = `x-pack/test/functional/es_archives/monitoring/singlecluster_red_platinum_${source}`;
|
|
||||||
const timeRange = {
|
|
||||||
min: '2017-10-06T19:53:06.000Z',
|
|
||||||
max: '2017-10-06T20:15:30.000Z',
|
|
||||||
};
|
|
||||||
|
|
||||||
before('load clusters archive', () => {
|
|
||||||
return setup(archive);
|
|
||||||
});
|
|
||||||
|
|
||||||
after('unload clusters archive', () => {
|
|
||||||
return tearDown(archive);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should summarize the non-system indices with stats', async () => {
|
|
||||||
const { body } = await supertest
|
|
||||||
.post(
|
|
||||||
'/api/monitoring/v1/clusters/1LYuyvCCQFS3FAO_h65PQw/elasticsearch/indices?show_system_indices=false'
|
|
||||||
)
|
|
||||||
.set('kbn-xsrf', 'xxx')
|
|
||||||
.send({ timeRange })
|
|
||||||
.expect(200);
|
|
||||||
expect(body).to.eql(indicesRedClusterFixture);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should summarize all indices with stats', async () => {
|
|
||||||
const { body } = await supertest
|
|
||||||
.post(
|
|
||||||
'/api/monitoring/v1/clusters/1LYuyvCCQFS3FAO_h65PQw/elasticsearch/indices?show_system_indices=true'
|
|
||||||
)
|
|
||||||
.set('kbn-xsrf', 'xxx')
|
|
||||||
.send({ timeRange })
|
|
||||||
.expect(200);
|
|
||||||
|
|
||||||
expect(body).to.eql(indicesRedClusterAllFixture);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load diff
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load diff
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,63 @@
|
||||||
|
/*
|
||||||
|
* 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 { FtrProviderContext } from '../../../api_integration/ftr_provider_context';
|
||||||
|
import { getTestRunner } from '../../utils/test_runner';
|
||||||
|
|
||||||
|
import ccrResponse from '../../fixtures/elasticsearch/ccr.json';
|
||||||
|
import ccrShardResponse from '../../fixtures/elasticsearch/ccr_shard.json';
|
||||||
|
|
||||||
|
export default function ({ getService }: FtrProviderContext) {
|
||||||
|
const supertest = getService('supertest');
|
||||||
|
|
||||||
|
const testRunner = getTestRunner({
|
||||||
|
testName: 'CCR',
|
||||||
|
archiveRoot: 'x-pack/test/monitoring_api_integration/archives/elasticsearch/single_node',
|
||||||
|
getService,
|
||||||
|
});
|
||||||
|
|
||||||
|
const timeRange = {
|
||||||
|
min: '2023-01-24T15:45:30.000Z',
|
||||||
|
max: '2023-01-24T15:51:30.000Z',
|
||||||
|
};
|
||||||
|
|
||||||
|
testRunner(() => {
|
||||||
|
it('should return all followers and a grouping of stats by follower index', async () => {
|
||||||
|
const { body } = await supertest
|
||||||
|
.post('/api/monitoring/v1/clusters/-8HHufEtS72rt344JzYofg/elasticsearch/ccr')
|
||||||
|
.set('kbn-xsrf', 'xxx')
|
||||||
|
.send({ timeRange })
|
||||||
|
.expect(200);
|
||||||
|
|
||||||
|
expect(body).to.eql(ccrResponse);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return an empty list of followers if the cluster_uuid does not have any match', async () => {
|
||||||
|
const { body } = await supertest
|
||||||
|
.post('/api/monitoring/v1/clusters/random_uuid/elasticsearch/ccr')
|
||||||
|
.set('kbn-xsrf', 'xxx')
|
||||||
|
.send({ timeRange })
|
||||||
|
.expect(200);
|
||||||
|
|
||||||
|
expect(body).to.eql([]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return specific shard details', async () => {
|
||||||
|
const { body } = await supertest
|
||||||
|
.post(
|
||||||
|
'/api/monitoring/v1/clusters/-8HHufEtS72rt344JzYofg/elasticsearch/ccr/foo-follower/shard/0'
|
||||||
|
)
|
||||||
|
.set('kbn-xsrf', 'xxx')
|
||||||
|
.send({ timeRange })
|
||||||
|
.expect(200);
|
||||||
|
|
||||||
|
expect(body).to.eql(ccrShardResponse);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
/*
|
||||||
|
* 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 { FtrProviderContext } from '../../../api_integration/ftr_provider_context';
|
||||||
|
|
||||||
|
export default function ({ loadTestFile }: FtrProviderContext) {
|
||||||
|
describe('Elasticsearch', () => {
|
||||||
|
loadTestFile(require.resolve('./ccr'));
|
||||||
|
loadTestFile(require.resolve('./indices'));
|
||||||
|
loadTestFile(require.resolve('./ml_jobs'));
|
||||||
|
loadTestFile(require.resolve('./nodes'));
|
||||||
|
loadTestFile(require.resolve('./overview'));
|
||||||
|
});
|
||||||
|
}
|
|
@ -0,0 +1,87 @@
|
||||||
|
/*
|
||||||
|
* 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 { FtrProviderContext } from '../../../api_integration/ftr_provider_context';
|
||||||
|
import { getTestRunner } from '../../utils/test_runner';
|
||||||
|
|
||||||
|
import nonSystemIndicesResponse from '../../fixtures/elasticsearch/indices_no_system.json';
|
||||||
|
import allIndicesResponse from '../../fixtures/elasticsearch/indices_all.json';
|
||||||
|
import indexDetailResponse from '../../fixtures/elasticsearch/index_detail.json';
|
||||||
|
import indexDetailAdvancedResponse from '../../fixtures/elasticsearch/index_detail_advanced.json';
|
||||||
|
|
||||||
|
export default function ({ getService }: FtrProviderContext) {
|
||||||
|
const supertest = getService('supertest');
|
||||||
|
|
||||||
|
const testRunner = getTestRunner({
|
||||||
|
testName: 'Indices',
|
||||||
|
archiveRoot: 'x-pack/test/monitoring_api_integration/archives/elasticsearch/single_node',
|
||||||
|
getService,
|
||||||
|
});
|
||||||
|
|
||||||
|
const timeRange = {
|
||||||
|
min: '2023-01-24T15:45:30.000Z',
|
||||||
|
max: '2023-01-24T15:51:30.000Z',
|
||||||
|
};
|
||||||
|
|
||||||
|
testRunner(() => {
|
||||||
|
it('should summarize the non-system indices with stats', async () => {
|
||||||
|
const { body } = await supertest
|
||||||
|
.post(
|
||||||
|
'/api/monitoring/v1/clusters/-8HHufEtS72rt344JzYofg/elasticsearch/indices?show_system_indices=false'
|
||||||
|
)
|
||||||
|
.set('kbn-xsrf', 'xxx')
|
||||||
|
.send({ timeRange })
|
||||||
|
.expect(200);
|
||||||
|
|
||||||
|
expect(body).to.eql(nonSystemIndicesResponse);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should summarize all indices with stats', async () => {
|
||||||
|
const { body } = await supertest
|
||||||
|
.post(
|
||||||
|
'/api/monitoring/v1/clusters/-8HHufEtS72rt344JzYofg/elasticsearch/indices?show_system_indices=true'
|
||||||
|
)
|
||||||
|
.set('kbn-xsrf', 'xxx')
|
||||||
|
.send({ timeRange })
|
||||||
|
.expect(200);
|
||||||
|
|
||||||
|
expect(body).to.eql(allIndicesResponse);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should summarize index with chart metrics data for the non-advanced view', async () => {
|
||||||
|
const { body } = await supertest
|
||||||
|
.post(
|
||||||
|
'/api/monitoring/v1/clusters/-8HHufEtS72rt344JzYofg/elasticsearch/indices/.ds-metrics-elasticsearch.stack_monitoring.cluster_stats-default-2023.01.24-000001'
|
||||||
|
)
|
||||||
|
.set('kbn-xsrf', 'xxx')
|
||||||
|
.send({
|
||||||
|
timeRange,
|
||||||
|
is_advanced: false,
|
||||||
|
})
|
||||||
|
.expect(200);
|
||||||
|
|
||||||
|
expect(body).to.eql(indexDetailResponse);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should summarize index with chart metrics data for the advanced view', async () => {
|
||||||
|
const { body } = await supertest
|
||||||
|
.post(
|
||||||
|
'/api/monitoring/v1/clusters/-8HHufEtS72rt344JzYofg/elasticsearch/indices/.ds-metrics-elasticsearch.stack_monitoring.cluster_stats-default-2023.01.24-000001'
|
||||||
|
)
|
||||||
|
.set('kbn-xsrf', 'xxx')
|
||||||
|
.send({
|
||||||
|
timeRange,
|
||||||
|
is_advanced: true,
|
||||||
|
})
|
||||||
|
.expect(200);
|
||||||
|
|
||||||
|
expect(body).to.eql(indexDetailAdvancedResponse);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
|
@ -0,0 +1,40 @@
|
||||||
|
/*
|
||||||
|
* 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 { FtrProviderContext } from '../../../api_integration/ftr_provider_context';
|
||||||
|
import { getTestRunner } from '../../utils/test_runner';
|
||||||
|
|
||||||
|
import mlResponse from '../../fixtures/elasticsearch/ml_jobs.json';
|
||||||
|
|
||||||
|
export default function ({ getService }: FtrProviderContext) {
|
||||||
|
const supertest = getService('supertest');
|
||||||
|
|
||||||
|
const testRunner = getTestRunner({
|
||||||
|
testName: 'ML jobs',
|
||||||
|
archiveRoot: 'x-pack/test/monitoring_api_integration/archives/elasticsearch/single_node',
|
||||||
|
getService,
|
||||||
|
});
|
||||||
|
|
||||||
|
const timeRange = {
|
||||||
|
min: '2023-01-24T15:45:30.000Z',
|
||||||
|
max: '2023-01-24T15:51:30.000Z',
|
||||||
|
};
|
||||||
|
|
||||||
|
testRunner(() => {
|
||||||
|
it('should list ml jobs', async () => {
|
||||||
|
const { body } = await supertest
|
||||||
|
.post('/api/monitoring/v1/clusters/-8HHufEtS72rt344JzYofg/elasticsearch/ml_jobs')
|
||||||
|
.set('kbn-xsrf', 'xxx')
|
||||||
|
.send({ timeRange })
|
||||||
|
.expect(200);
|
||||||
|
|
||||||
|
expect(body).to.eql(mlResponse);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
|
@ -0,0 +1,79 @@
|
||||||
|
/*
|
||||||
|
* 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 { FtrProviderContext } from '../../../api_integration/ftr_provider_context';
|
||||||
|
import { getTestRunner } from '../../utils/test_runner';
|
||||||
|
|
||||||
|
import nodesResponse from '../../fixtures/elasticsearch/nodes.json';
|
||||||
|
import nodeDetailResponse from '../../fixtures/elasticsearch/node_detail.json';
|
||||||
|
import nodeDetailAdvancedResponse from '../../fixtures/elasticsearch/node_detail_advanced.json';
|
||||||
|
|
||||||
|
export default function ({ getService }: FtrProviderContext) {
|
||||||
|
const supertest = getService('supertest');
|
||||||
|
|
||||||
|
const testRunner = getTestRunner({
|
||||||
|
testName: 'Nodes',
|
||||||
|
archiveRoot: 'x-pack/test/monitoring_api_integration/archives/elasticsearch/single_node',
|
||||||
|
getService,
|
||||||
|
});
|
||||||
|
|
||||||
|
const timeRange = {
|
||||||
|
min: '2023-01-24T15:45:30.000Z',
|
||||||
|
max: '2023-01-24T15:51:30.000Z',
|
||||||
|
};
|
||||||
|
|
||||||
|
testRunner(() => {
|
||||||
|
it('should list nodes', async () => {
|
||||||
|
const { body } = await supertest
|
||||||
|
.post('/api/monitoring/v1/clusters/-8HHufEtS72rt344JzYofg/elasticsearch/nodes')
|
||||||
|
.set('kbn-xsrf', 'xxx')
|
||||||
|
.send({
|
||||||
|
pagination: { size: 20, index: 0 },
|
||||||
|
sort: { field: 'name', direction: 'asc' },
|
||||||
|
queryText: '',
|
||||||
|
timeRange,
|
||||||
|
})
|
||||||
|
.expect(200);
|
||||||
|
|
||||||
|
expect(body).to.eql(nodesResponse);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should summarize node with metrics', async () => {
|
||||||
|
const { body } = await supertest
|
||||||
|
.post(
|
||||||
|
'/api/monitoring/v1/clusters/-8HHufEtS72rt344JzYofg/elasticsearch/nodes/1ksGajLvSW-OwnAYH-X3Sg'
|
||||||
|
)
|
||||||
|
.set('kbn-xsrf', 'xxx')
|
||||||
|
.send({
|
||||||
|
timeRange,
|
||||||
|
is_advanced: false,
|
||||||
|
showSystemIndices: false,
|
||||||
|
})
|
||||||
|
.expect(200);
|
||||||
|
|
||||||
|
expect(body).to.eql(nodeDetailResponse);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should summarize node with advanced metrics', async () => {
|
||||||
|
const { body } = await supertest
|
||||||
|
.post(
|
||||||
|
'/api/monitoring/v1/clusters/-8HHufEtS72rt344JzYofg/elasticsearch/nodes/1ksGajLvSW-OwnAYH-X3Sg'
|
||||||
|
)
|
||||||
|
.set('kbn-xsrf', 'xxx')
|
||||||
|
.send({
|
||||||
|
timeRange,
|
||||||
|
is_advanced: true,
|
||||||
|
showSystemIndices: false,
|
||||||
|
})
|
||||||
|
.expect(200);
|
||||||
|
|
||||||
|
expect(body).to.eql(nodeDetailAdvancedResponse);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
|
@ -0,0 +1,42 @@
|
||||||
|
/*
|
||||||
|
* 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 { FtrProviderContext } from '../../../api_integration/ftr_provider_context';
|
||||||
|
import { getTestRunner } from '../../utils/test_runner';
|
||||||
|
|
||||||
|
import overviewResponse from '../../fixtures/elasticsearch/overview.json';
|
||||||
|
|
||||||
|
export default function ({ getService }: FtrProviderContext) {
|
||||||
|
const supertest = getService('supertest');
|
||||||
|
|
||||||
|
const testRunner = getTestRunner({
|
||||||
|
testName: 'Overview',
|
||||||
|
archiveRoot: 'x-pack/test/monitoring_api_integration/archives/elasticsearch/single_node',
|
||||||
|
getService,
|
||||||
|
});
|
||||||
|
|
||||||
|
const timeRange = {
|
||||||
|
min: '2023-01-24T15:45:30.000Z',
|
||||||
|
max: '2023-01-24T15:51:30.000Z',
|
||||||
|
};
|
||||||
|
|
||||||
|
testRunner(() => {
|
||||||
|
it('should summarize elasticsearch with metrics', async () => {
|
||||||
|
const { body } = await supertest
|
||||||
|
.post('/api/monitoring/v1/clusters/-8HHufEtS72rt344JzYofg/elasticsearch')
|
||||||
|
.set('kbn-xsrf', 'xxx')
|
||||||
|
.send({
|
||||||
|
timeRange,
|
||||||
|
})
|
||||||
|
.expect(200);
|
||||||
|
|
||||||
|
expect(body).to.eql(overviewResponse);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
|
@ -11,6 +11,7 @@ export default function ({ loadTestFile }: FtrProviderContext) {
|
||||||
describe('Monitoring Endpoints', function () {
|
describe('Monitoring Endpoints', function () {
|
||||||
loadTestFile(require.resolve('./apm'));
|
loadTestFile(require.resolve('./apm'));
|
||||||
loadTestFile(require.resolve('./beats'));
|
loadTestFile(require.resolve('./beats'));
|
||||||
|
loadTestFile(require.resolve('./elasticsearch'));
|
||||||
loadTestFile(require.resolve('./enterprisesearch'));
|
loadTestFile(require.resolve('./enterprisesearch'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1 @@
|
||||||
|
[{"id":"foo-follower","index":"foo-follower","follows":"foo-leader","shards":[{"shardId":0,"error":null,"opsSynced":0,"syncLagTime":47748,"syncLagOps":0,"syncLagOpsLeader":0,"syncLagOpsFollower":0}],"opsSynced":0,"syncLagTime":47748,"syncLagOps":0}]
|
|
@ -0,0 +1 @@
|
||||||
|
{"metrics":{"ccr_sync_lag_time":[{"bucket_size":"10 seconds","timeRange":{"min":1674575130000,"max":1674575490000},"metric":{"app":"elasticsearch","field":"ccr_stats.time_since_last_read_millis","metricAgg":"max","label":"Fetch delay","title":"Fetch delay","description":"The amount of time the follower index is lagging behind the leader.","units":"s","format":"0.[00]","hasCalculation":true,"isDerivative":false},"data":[[1674575140000,0],[1674575150000,0],[1674575160000,0],[1674575170000,0],[1674575180000,0],[1674575190000,0],[1674575200000,0],[1674575210000,0],[1674575220000,0],[1674575230000,0],[1674575240000,0],[1674575250000,0],[1674575260000,0],[1674575270000,0],[1674575280000,0],[1674575290000,0],[1674575300000,0]]}],"ccr_sync_lag_ops":[{"bucket_size":"10 seconds","timeRange":{"min":1674575130000,"max":1674575490000},"metric":{"app":"elasticsearch","field":"","metricAgg":"sum","label":"Ops delay","title":"Ops delay","description":"The number of operations the follower index is lagging behind the leader.","units":"","format":"0,0.[00]","hasCalculation":true,"isDerivative":false},"data":[[1674575140000,0],[1674575150000,0],[1674575160000,0],[1674575170000,0],[1674575180000,0],[1674575190000,0],[1674575200000,0],[1674575210000,0],[1674575220000,0],[1674575230000,0],[1674575240000,0],[1674575250000,0],[1674575260000,0],[1674575270000,0],[1674575280000,0],[1674575290000,0],[1674575300000,0]]}]},"stat":{"leader":{"index":"foo-leader","max_seq_no":83,"global_checkpoint":83},"follower":{"operations":{"read":{"count":82}},"time_since_last_read":{"ms":47748},"index":"foo-follower","settings_version":1,"shard":{"number":0},"aliases_version":1,"max_seq_no":83,"global_checkpoint":83,"operations_written":82},"read_exceptions":[],"bytes_read":7462,"auto_follow":{"success":{"follow_indices":{"count":0}},"failed":{"follow_indices":{"count":0},"remote_cluster_state_requests":{"count":0}}},"requests":{"outstanding":{"read":{"count":1},"write":{"count":0}},"failed":{"read":{"count":0},"write":{"count":0}},"successful":{"read":{"count":72},"write":{"count":72}}},"total_time":{"read":{"ms":195322,"remote_exec":{"ms":194799}},"write":{"ms":156}},"write_buffer":{"size":{"bytes":0},"operation":{"count":0}}},"formattedLeader":"foo-leader","timestamp":"2023-01-24T15:48:26.038Z","oldestStat":{"follower":{"operations_written":82},"requests":{"failed":{"read":{"count":0}}}}}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
||||||
|
{"clusterStatus":{"status":"yellow","indicesCount":47,"documentCount":39688,"dataSize":33007934,"nodesCount":1,"upTime":779257,"version":["8.7.0"],"memUsed":586378752,"memMax":1073741824,"unassignedShards":28,"totalShards":75},"indices":[{"name":"kibana_sample_data_ecommerce","status":"green","doc_count":4675,"data_size":4274251,"index_rate":0,"search_rate":0,"unassigned_shards":0,"status_sort":1},{"name":"kibana_sample_data_flights","status":"green","doc_count":13059,"data_size":5982692,"index_rate":0,"search_rate":0,"unassigned_shards":0,"status_sort":1}]}
|
|
@ -0,0 +1 @@
|
||||||
|
{"clusterStatus":{"status":"yellow","indicesCount":47,"documentCount":39688,"dataSize":33007934,"nodesCount":1,"upTime":779257,"version":["8.7.0"],"memUsed":586378752,"memMax":1073741824,"unassignedShards":28,"totalShards":75},"rows":[{"ml":{"job":{"data_counts":{"processed_record_count":44},"id":"high_mean_cpu_iowait_ecs","state":"closed","forecasts_stats":{"total":0}}},"node":{}},{"ml":{"job":{"data_counts":{"processed_record_count":8},"id":"max_disk_utilization_ecs","state":"closed","forecasts_stats":{"total":0}}},"node":{}},{"ml":{"job":{"data_counts":{"processed_record_count":1029},"id":"metricbeat_outages_ecs","state":"closed","forecasts_stats":{"total":0}}},"node":{}}]}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
||||||
|
{"clusterStatus":{"status":"yellow","indicesCount":47,"documentCount":39688,"dataSize":33007934,"nodesCount":1,"upTime":779257,"version":["8.7.0"],"memUsed":586378752,"memMax":1073741824,"unassignedShards":28,"totalShards":75},"nodes":[{"name":"712a47f7f7df","uuid":"1ksGajLvSW-OwnAYH-X3Sg","isOnline":true,"shardCount":47,"node_cgroup_quota":{"metric":{"app":"elasticsearch","field":"node_stats.process.cpu.percent","metricAgg":"max","label":"Cgroup CPU Utilization","title":"CPU Utilization","description":"CPU Usage time compared to the CPU quota shown in percentage. If CPU quotas are not set, then no data will be shown.","units":"%","format":"0,0.[00]","hasCalculation":true,"isDerivative":true},"summary":{"minVal":6.193957314606742,"maxVal":17.655557410526317,"lastVal":17.655557410526317,"slope":-1}},"node_cgroup_throttled":{"metric":{"app":"elasticsearch","field":"node_stats.os.cgroup.cpu.stat.time_throttled_nanos","metricAgg":"max","label":"Cgroup Throttling","title":"Cgroup CPU Performance","description":"The amount of throttled time, reported in nanoseconds, of the cgroup.","units":"ns","format":"0,0.[0]a","hasCalculation":false,"isDerivative":true},"summary":{"minVal":0,"maxVal":61011551272,"lastVal":0,"slope":-1}},"node_cpu_utilization":{"metric":{"app":"elasticsearch","field":"node_stats.process.cpu.percent","metricAgg":"max","label":"CPU Utilization","description":"Percentage of CPU usage for the Elasticsearch process.","units":"%","format":"0,0.[00]","hasCalculation":false,"isDerivative":false},"summary":{"minVal":4,"maxVal":15,"lastVal":15,"slope":-1}},"node_load_average":{"metric":{"app":"elasticsearch","field":"node_stats.os.cpu.load_average.1m","metricAgg":"max","label":"1m","title":"System Load","description":"Load average over the last minute.","units":"","format":"0,0.[00]","hasCalculation":false,"isDerivative":false},"summary":{"minVal":0.5498046875,"maxVal":1.5,"lastVal":0.6298828125,"slope":-1}},"node_jvm_mem_percent":{"metric":{"app":"elasticsearch","field":"node_stats.jvm.mem.heap_used_percent","metricAgg":"max","label":"Used Heap","title":"JVM Heap","description":"Total heap used by Elasticsearch running in the JVM.","units":"%","format":"0,0.[00]","hasCalculation":false,"isDerivative":false},"summary":{"minVal":18,"maxVal":73,"lastVal":54,"slope":1}},"node_free_space":{"metric":{"app":"elasticsearch","field":"node_stats.fs.total.available_in_bytes","metricAgg":"max","label":"Disk Free Space","description":"Free disk space available on the node.","units":"","format":"0.0 b","hasCalculation":false,"isDerivative":false},"summary":{"minVal":37494857728,"maxVal":37521543168,"lastVal":37511475200,"slope":1}},"transport_address":"https://elasticsearch:9200","type":"master","nodeTypeLabel":"Master Node","nodeTypeClass":"starFilled","resolver":"1ksGajLvSW-OwnAYH-X3Sg"}],"totalNodeCount":1}
|
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -9,6 +9,7 @@ import path from 'path';
|
||||||
|
|
||||||
const PACKAGES = [
|
const PACKAGES = [
|
||||||
{ name: 'beat', version: '0.0.1' },
|
{ name: 'beat', version: '0.0.1' },
|
||||||
|
{ name: 'elasticsearch', version: '1.2.0' },
|
||||||
{ name: 'enterprisesearch', version: '1.0.0' },
|
{ name: 'enterprisesearch', version: '1.0.0' },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue