mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Stack Monitoring] baseline kibana api tests for package and metricbeat data (#153184)
## Summary Part of https://github.com/elastic/kibana/issues/148303 Port kibana api 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 with fresh data. See [flaky test run](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2002)
This commit is contained in:
parent
a062e0be01
commit
e1579c8f4a
25 changed files with 115 additions and 15092 deletions
|
@ -8,12 +8,7 @@
|
|||
export default function ({ loadTestFile }) {
|
||||
describe('Kibana', () => {
|
||||
loadTestFile(require.resolve('./overview'));
|
||||
loadTestFile(require.resolve('./overview_mb'));
|
||||
loadTestFile(require.resolve('./listing'));
|
||||
loadTestFile(require.resolve('./listing_mb'));
|
||||
loadTestFile(require.resolve('./instance'));
|
||||
loadTestFile(require.resolve('./instance_mb'));
|
||||
|
||||
loadTestFile(require.resolve('./rules_and_actions'));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,51 +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 { normalizeDataTypeDifferences } from '../normalize_data_type_differences';
|
||||
import { setIndicesFound } from '../set_indices_found';
|
||||
import instanceFixture from './fixtures/instance.json';
|
||||
import { getLifecycleMethods } from '../data_stream';
|
||||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const { setup, tearDown } = getLifecycleMethods(getService);
|
||||
|
||||
describe('instance detail - metricbeat and package', () => {
|
||||
['mb', 'package'].forEach((source) => {
|
||||
describe(`instance detail ${source}`, () => {
|
||||
const archive = `x-pack/test/functional/es_archives/monitoring/singlecluster_yellow_platinum_${source}`;
|
||||
const timeRange = {
|
||||
min: '2017-08-29T17:24:17.000Z',
|
||||
max: '2017-08-29T17:26:08.000Z',
|
||||
};
|
||||
|
||||
before('load archive', () => {
|
||||
return setup(archive);
|
||||
});
|
||||
|
||||
after('unload archive', () => {
|
||||
return tearDown(archive);
|
||||
});
|
||||
|
||||
it('should summarize single kibana instance with metrics', async () => {
|
||||
const { body } = await supertest
|
||||
.post(
|
||||
'/api/monitoring/v1/clusters/DFDDUmKHR0Ge0mkdYW2bew/kibana/de3b8f2a-7bb9-4931-9bf3-997ba7824cf9'
|
||||
)
|
||||
.set('kbn-xsrf', 'xxx')
|
||||
.send({ timeRange })
|
||||
.expect(200);
|
||||
|
||||
body.metrics = normalizeDataTypeDifferences(body.metrics, instanceFixture);
|
||||
instanceFixture.metrics = setIndicesFound(instanceFixture.metrics, true);
|
||||
expect(body).to.eql(instanceFixture);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
|
@ -1,51 +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 listingFixture from './fixtures/listing.json';
|
||||
import { getLifecycleMethods } from '../data_stream';
|
||||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const { setup, tearDown } = getLifecycleMethods(getService);
|
||||
|
||||
describe('listing - metricbeat and package', () => {
|
||||
['mb', 'package'].forEach((source) => {
|
||||
describe(`listing ${source}`, () => {
|
||||
const archive = `x-pack/test/functional/es_archives/monitoring/singlecluster_yellow_platinum_${source}`;
|
||||
const timeRange = {
|
||||
min: '2017-08-29T17:24:17.000Z',
|
||||
max: '2017-08-29T17:26:08.000Z',
|
||||
};
|
||||
|
||||
before('load archive', () => {
|
||||
return setup(archive);
|
||||
});
|
||||
|
||||
after('unload archive', () => {
|
||||
return tearDown(archive);
|
||||
});
|
||||
|
||||
it('should summarize list of kibana instances with stats', async () => {
|
||||
const { body } = await supertest
|
||||
.post('/api/monitoring/v1/clusters/DFDDUmKHR0Ge0mkdYW2bew/kibana/instances')
|
||||
.set('kbn-xsrf', 'xxx')
|
||||
.send({ timeRange })
|
||||
.expect(200);
|
||||
|
||||
// Fixture is shared between internal and Metricbeat collection tests
|
||||
// But timestamps of documents differ by a few miliseconds
|
||||
const lastSeenTimestamp = body.kibanas[0].lastSeenTimestamp;
|
||||
delete body.kibanas[0].lastSeenTimestamp;
|
||||
|
||||
expect(body).to.eql(listingFixture);
|
||||
expect(lastSeenTimestamp).to.eql('2017-08-29T17:25:43.192Z');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
|
@ -1,49 +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 { normalizeDataTypeDifferences } from '../normalize_data_type_differences';
|
||||
import { setIndicesFound } from '../set_indices_found';
|
||||
import overviewFixture from './fixtures/overview.json';
|
||||
import { getLifecycleMethods } from '../data_stream';
|
||||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const { setup, tearDown } = getLifecycleMethods(getService);
|
||||
|
||||
describe('overview - metricbeat and package', () => {
|
||||
['mb', 'package'].forEach((source) => {
|
||||
describe(`overview ${source}`, () => {
|
||||
const archive = `x-pack/test/functional/es_archives/monitoring/singlecluster_yellow_platinum_${source}`;
|
||||
const timeRange = {
|
||||
min: '2017-08-29T17:24:17.000Z',
|
||||
max: '2017-08-29T17:26:08.000Z',
|
||||
};
|
||||
|
||||
before('load archive', () => {
|
||||
return setup(archive);
|
||||
});
|
||||
|
||||
after('unload archive', () => {
|
||||
return tearDown(archive);
|
||||
});
|
||||
|
||||
it('should summarize kibana instances with stats', async () => {
|
||||
const { body } = await supertest
|
||||
.post('/api/monitoring/v1/clusters/DFDDUmKHR0Ge0mkdYW2bew/kibana')
|
||||
.set('kbn-xsrf', 'xxx')
|
||||
.send({ timeRange })
|
||||
.expect(200);
|
||||
|
||||
body.metrics = normalizeDataTypeDifferences(body.metrics, overviewFixture);
|
||||
overviewFixture.metrics = setIndicesFound(overviewFixture.metrics, true);
|
||||
expect(body).to.eql(overviewFixture);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
|
@ -1,485 +0,0 @@
|
|||
{
|
||||
"metrics": {
|
||||
"kibana_os_load": [
|
||||
{
|
||||
"bucket_size": "1 min",
|
||||
"timeRange": {
|
||||
"min": 1654022659267,
|
||||
"max": 1654027159267
|
||||
},
|
||||
"metric": {
|
||||
"app": "kibana",
|
||||
"field": "kibana_stats.os.load.1m",
|
||||
"metricAgg": "max",
|
||||
"label": "1m",
|
||||
"title": "System Load",
|
||||
"description": "Load average over the last minute.",
|
||||
"units": "",
|
||||
"format": "0,0.[00]",
|
||||
"hasCalculation": false,
|
||||
"isDerivative": false
|
||||
},
|
||||
"data": [
|
||||
[
|
||||
1654023060000,
|
||||
5.27734375
|
||||
],
|
||||
[
|
||||
1654023120000,
|
||||
4.78125
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"bucket_size": "1 min",
|
||||
"timeRange": {
|
||||
"min": 1654022659267,
|
||||
"max": 1654027159267
|
||||
},
|
||||
"metric": {
|
||||
"app": "kibana",
|
||||
"field": "kibana_stats.os.load.5m",
|
||||
"metricAgg": "max",
|
||||
"label": "5m",
|
||||
"title": "System Load",
|
||||
"description": "Load average over the last 5 minutes.",
|
||||
"units": "",
|
||||
"format": "0,0.[00]",
|
||||
"hasCalculation": false,
|
||||
"isDerivative": false
|
||||
},
|
||||
"data": [
|
||||
[
|
||||
1654023060000,
|
||||
6.7734375
|
||||
],
|
||||
[
|
||||
1654023120000,
|
||||
6.5625
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"bucket_size": "1 min",
|
||||
"timeRange": {
|
||||
"min": 1654022659267,
|
||||
"max": 1654027159267
|
||||
},
|
||||
"metric": {
|
||||
"app": "kibana",
|
||||
"field": "kibana_stats.os.load.15m",
|
||||
"metricAgg": "max",
|
||||
"label": "15m",
|
||||
"title": "System Load",
|
||||
"description": "Load average over the last 15 minutes.",
|
||||
"units": "",
|
||||
"format": "0,0.[00]",
|
||||
"hasCalculation": false,
|
||||
"isDerivative": false
|
||||
},
|
||||
"data": [
|
||||
[
|
||||
1654023060000,
|
||||
5.8359375
|
||||
],
|
||||
[
|
||||
1654023120000,
|
||||
5.78125
|
||||
]
|
||||
]
|
||||
}
|
||||
],
|
||||
"kibana_average_concurrent_connections": [
|
||||
{
|
||||
"bucket_size": "1 min",
|
||||
"timeRange": {
|
||||
"min": 1654022659267,
|
||||
"max": 1654027159267
|
||||
},
|
||||
"metric": {
|
||||
"app": "kibana",
|
||||
"field": "kibana_stats.concurrent_connections",
|
||||
"metricAgg": "max",
|
||||
"label": "HTTP Connections",
|
||||
"description": "Total number of open socket connections to the Kibana instance.",
|
||||
"units": "",
|
||||
"format": "0.[00]",
|
||||
"hasCalculation": false,
|
||||
"isDerivative": false
|
||||
},
|
||||
"data": [
|
||||
[
|
||||
1654023060000,
|
||||
10
|
||||
],
|
||||
[
|
||||
1654023120000,
|
||||
17
|
||||
]
|
||||
]
|
||||
}
|
||||
],
|
||||
"kibana_process_delay": [
|
||||
{
|
||||
"bucket_size": "1 min",
|
||||
"timeRange": {
|
||||
"min": 1654022659267,
|
||||
"max": 1654027159267
|
||||
},
|
||||
"metric": {
|
||||
"app": "kibana",
|
||||
"field": "kibana_stats.process.event_loop_delay",
|
||||
"metricAgg": "max",
|
||||
"label": "Event Loop Delay",
|
||||
"description": "Delay in Kibana server event loops. Longer delays may indicate blocking events in server thread, such as synchronous functions taking large amount of CPU time.",
|
||||
"units": "ms",
|
||||
"format": "0.[00]",
|
||||
"hasCalculation": false,
|
||||
"isDerivative": false
|
||||
},
|
||||
"data": [
|
||||
[
|
||||
1654023060000,
|
||||
10.624
|
||||
],
|
||||
[
|
||||
1654023120000,
|
||||
11.916
|
||||
]
|
||||
]
|
||||
}
|
||||
],
|
||||
"kibana_memory": [
|
||||
{
|
||||
"bucket_size": "1 min",
|
||||
"timeRange": {
|
||||
"min": 1654022659267,
|
||||
"max": 1654027159267
|
||||
},
|
||||
"metric": {
|
||||
"app": "kibana",
|
||||
"field": "kibana_stats.process.memory.heap.size_limit",
|
||||
"metricAgg": "max",
|
||||
"label": "Heap Size Limit",
|
||||
"title": "Memory Size",
|
||||
"description": "Limit of memory usage before garbage collection.",
|
||||
"units": "B",
|
||||
"format": "0,0.0 b",
|
||||
"hasCalculation": false,
|
||||
"isDerivative": false
|
||||
},
|
||||
"data": [
|
||||
[
|
||||
1654023060000,
|
||||
8438939648
|
||||
],
|
||||
[
|
||||
1654023120000,
|
||||
8438939648
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"bucket_size": "1 min",
|
||||
"timeRange": {
|
||||
"min": 1654022659267,
|
||||
"max": 1654027159267
|
||||
},
|
||||
"metric": {
|
||||
"app": "kibana",
|
||||
"field": "kibana_stats.process.memory.resident_set_size_in_bytes",
|
||||
"metricAgg": "max",
|
||||
"label": "Memory Size",
|
||||
"title": "Memory Size",
|
||||
"description": "Total heap used by Kibana running in Node.js.",
|
||||
"units": "B",
|
||||
"format": "0,0.0 b",
|
||||
"hasCalculation": false,
|
||||
"isDerivative": false
|
||||
},
|
||||
"data": [
|
||||
[
|
||||
1654023060000,
|
||||
568397824
|
||||
],
|
||||
[
|
||||
1654023120000,
|
||||
632569856
|
||||
]
|
||||
]
|
||||
}
|
||||
],
|
||||
"kibana_response_times": [
|
||||
{
|
||||
"bucket_size": "1 min",
|
||||
"timeRange": {
|
||||
"min": 1654022659267,
|
||||
"max": 1654027159267
|
||||
},
|
||||
"metric": {
|
||||
"app": "kibana",
|
||||
"field": "kibana_stats.response_times.max",
|
||||
"metricAgg": "max",
|
||||
"label": "Max",
|
||||
"title": "Client Response Time",
|
||||
"description": "Maximum response time for client requests to the Kibana instance.",
|
||||
"units": "ms",
|
||||
"format": "0.[00]",
|
||||
"hasCalculation": false,
|
||||
"isDerivative": false
|
||||
},
|
||||
"data": [
|
||||
[
|
||||
1654023060000,
|
||||
77
|
||||
],
|
||||
[
|
||||
1654023120000,
|
||||
418
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"bucket_size": "1 min",
|
||||
"timeRange": {
|
||||
"min": 1654022659267,
|
||||
"max": 1654027159267
|
||||
},
|
||||
"metric": {
|
||||
"app": "kibana",
|
||||
"field": "kibana_stats.response_times.average",
|
||||
"metricAgg": "max",
|
||||
"label": "Average",
|
||||
"title": "Client Response Time",
|
||||
"description": "Average response time for client requests to the Kibana instance.",
|
||||
"units": "ms",
|
||||
"format": "0.[00]",
|
||||
"hasCalculation": false,
|
||||
"isDerivative": false
|
||||
},
|
||||
"data": [
|
||||
[
|
||||
1654023060000,
|
||||
37
|
||||
],
|
||||
[
|
||||
1654023120000,
|
||||
40
|
||||
]
|
||||
]
|
||||
}
|
||||
],
|
||||
"kibana_requests": [
|
||||
{
|
||||
"bucket_size": "1 min",
|
||||
"timeRange": {
|
||||
"min": 1654022659267,
|
||||
"max": 1654027159267
|
||||
},
|
||||
"metric": {
|
||||
"app": "kibana",
|
||||
"field": "kibana_stats.requests.total",
|
||||
"metricAgg": "max",
|
||||
"label": "Client Requests",
|
||||
"description": "Total number of client requests received by the Kibana instance.",
|
||||
"units": "",
|
||||
"format": "0.[00]",
|
||||
"hasCalculation": false,
|
||||
"isDerivative": false
|
||||
},
|
||||
"data": [
|
||||
[
|
||||
1654023060000,
|
||||
3
|
||||
],
|
||||
[
|
||||
1654023120000,
|
||||
59
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"bucket_size": "1 min",
|
||||
"timeRange": {
|
||||
"min": 1654022659267,
|
||||
"max": 1654027159267
|
||||
},
|
||||
"metric": {
|
||||
"app": "kibana",
|
||||
"field": "kibana_stats.requests.disconnects",
|
||||
"metricAgg": "max",
|
||||
"label": "Client Disconnects",
|
||||
"description": "Total number of client disconnects to the Kibana instance.",
|
||||
"units": "",
|
||||
"format": "0.[00]",
|
||||
"hasCalculation": false,
|
||||
"isDerivative": false
|
||||
},
|
||||
"data": [
|
||||
[
|
||||
1654023060000,
|
||||
0
|
||||
],
|
||||
[
|
||||
1654023120000,
|
||||
0
|
||||
]
|
||||
]
|
||||
}
|
||||
],
|
||||
"kibana_instance_rule_failures": [
|
||||
{
|
||||
"bucket_size": "1 min",
|
||||
"timeRange": {
|
||||
"min": 1654022659267,
|
||||
"max": 1654027159267
|
||||
},
|
||||
"metric": {
|
||||
"app": "kibana",
|
||||
"field": "kibana.node_rules.failures",
|
||||
"metricAgg": "max",
|
||||
"label": "Rule Failures",
|
||||
"description": "Total rule failures for the Kibana instance.",
|
||||
"units": "",
|
||||
"format": "0.[00]",
|
||||
"technicalPreview": true,
|
||||
"hasCalculation": false,
|
||||
"isDerivative": true
|
||||
},
|
||||
"indices_found": {
|
||||
"internal": false,
|
||||
"ecs": true
|
||||
},
|
||||
"data": [
|
||||
[
|
||||
1654023060000,
|
||||
null
|
||||
],
|
||||
[
|
||||
1654023120000,
|
||||
0
|
||||
]
|
||||
]
|
||||
}
|
||||
],
|
||||
"kibana_instance_rule_executions": [
|
||||
{
|
||||
"bucket_size": "1 min",
|
||||
"timeRange": {
|
||||
"min": 1654022659267,
|
||||
"max": 1654027159267
|
||||
},
|
||||
"metric": {
|
||||
"app": "kibana",
|
||||
"field": "kibana.node_rules.executions",
|
||||
"metricAgg": "max",
|
||||
"label": "Rule Executions",
|
||||
"description": "Total rule executions for the Kibana instance.",
|
||||
"units": "",
|
||||
"format": "0.[00]",
|
||||
"technicalPreview": true,
|
||||
"hasCalculation": false,
|
||||
"isDerivative": true
|
||||
},
|
||||
"indices_found": {
|
||||
"internal": false,
|
||||
"ecs": true
|
||||
},
|
||||
"data": [
|
||||
[
|
||||
1654023060000,
|
||||
null
|
||||
],
|
||||
[
|
||||
1654023120000,
|
||||
2
|
||||
]
|
||||
]
|
||||
}
|
||||
],
|
||||
"kibana_instance_action_failures": [
|
||||
{
|
||||
"bucket_size": "1 min",
|
||||
"timeRange": {
|
||||
"min": 1654022659267,
|
||||
"max": 1654027159267
|
||||
},
|
||||
"metric": {
|
||||
"app": "kibana",
|
||||
"field": "kibana.node_actions.failures",
|
||||
"metricAgg": "max",
|
||||
"label": "Action Failures",
|
||||
"description": "Total action failures for the Kibana instance.",
|
||||
"units": "",
|
||||
"format": "0.[00]",
|
||||
"technicalPreview": true,
|
||||
"hasCalculation": false,
|
||||
"isDerivative": true
|
||||
},
|
||||
"indices_found": {
|
||||
"internal": false,
|
||||
"ecs": true
|
||||
},
|
||||
"data": [
|
||||
[
|
||||
1654023060000,
|
||||
null
|
||||
],
|
||||
[
|
||||
1654023120000,
|
||||
0
|
||||
]
|
||||
]
|
||||
}
|
||||
],
|
||||
"kibana_instance_action_executions": [
|
||||
{
|
||||
"bucket_size": "1 min",
|
||||
"timeRange": {
|
||||
"min": 1654022659267,
|
||||
"max": 1654027159267
|
||||
},
|
||||
"metric": {
|
||||
"app": "kibana",
|
||||
"field": "kibana.node_actions.executions",
|
||||
"metricAgg": "max",
|
||||
"label": "Action Executions",
|
||||
"description": "Total action executions for the Kibana instance.",
|
||||
"units": "",
|
||||
"format": "0.[00]",
|
||||
"technicalPreview": true,
|
||||
"hasCalculation": false,
|
||||
"isDerivative": true
|
||||
},
|
||||
"indices_found": {
|
||||
"internal": false,
|
||||
"ecs": true
|
||||
},
|
||||
"data": [
|
||||
[
|
||||
1654023060000,
|
||||
null
|
||||
],
|
||||
[
|
||||
1654023120000,
|
||||
2
|
||||
]
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"kibanaSummary": {
|
||||
"name": "CBR-MBP.local",
|
||||
"host": "localhost",
|
||||
"status": "green",
|
||||
"transport_address": "localhost:5601",
|
||||
"uuid": "5b2de169-2785-441b-ae8c-186a1936b17d",
|
||||
"snapshot": false,
|
||||
"index": ".kibana",
|
||||
"version": "8.4.0",
|
||||
"statusIsStale": true,
|
||||
"lastSeenTimestamp": "2022-05-31T18:52:10.179Z",
|
||||
"os_memory_free": 1504448512,
|
||||
"uptime": 1845765
|
||||
}
|
||||
}
|
|
@ -1,81 +0,0 @@
|
|||
[
|
||||
{
|
||||
"cluster_uuid": "SvjwrFv6Rvuqjm9-cSSVEg",
|
||||
"cluster_name": "elasticsearch",
|
||||
"version": "8.4.0",
|
||||
"license": { "status": "active", "type": "basic" },
|
||||
"elasticsearch": {
|
||||
"cluster_stats": {
|
||||
"indices": {
|
||||
"count": 13,
|
||||
"docs": { "count": 2922 },
|
||||
"shards": { "total": 13, "primaries": 13 },
|
||||
"store": { "size_in_bytes": 10225568 }
|
||||
},
|
||||
"nodes": {
|
||||
"fs": { "total_in_bytes": 499963174912, "available_in_bytes": 85294256128 },
|
||||
"count": { "total": 1 },
|
||||
"jvm": {
|
||||
"max_uptime_in_millis": 16567476,
|
||||
"mem": { "heap_max_in_bytes": 1610612736, "heap_used_in_bytes": 984250168 }
|
||||
}
|
||||
},
|
||||
"status": "yellow"
|
||||
},
|
||||
"logs": {
|
||||
"enabled": false,
|
||||
"types": [],
|
||||
"reason": {
|
||||
"indexPatternExists": false,
|
||||
"indexPatternInTimeRangeExists": false,
|
||||
"typeExistsAtAnyTime": false,
|
||||
"typeExists": false,
|
||||
"usingStructuredLogs": false,
|
||||
"clusterExists": false,
|
||||
"nodeExists": null,
|
||||
"indexExists": null
|
||||
}
|
||||
}
|
||||
},
|
||||
"logstash": {},
|
||||
"kibana": {
|
||||
"status": "green",
|
||||
"some_status_is_stale": true,
|
||||
"requests_total": 59,
|
||||
"concurrent_connections": 17,
|
||||
"response_time_max": 418,
|
||||
"memory_size": 632569856,
|
||||
"memory_limit": 8438939648,
|
||||
"count": 1,
|
||||
"rules": {
|
||||
"cluster": { "overdue": { "count": 1, "delay": { "p50": 1586, "p99": 1586 } } },
|
||||
"instance": { "failures": 0, "executions": 51, "timeouts": 0 }
|
||||
}
|
||||
},
|
||||
"beats": { "totalEvents": 0, "bytesSent": 0, "beats": { "total": 0, "types": [] } },
|
||||
"apm": {
|
||||
"totalEvents": 0,
|
||||
"memRss": 0,
|
||||
"apms": { "total": 0 },
|
||||
"versions": [],
|
||||
"config": { "container": false }
|
||||
},
|
||||
"enterpriseSearch": {
|
||||
"clusterUuid": "SvjwrFv6Rvuqjm9-cSSVEg",
|
||||
"stats": {
|
||||
"appSearchEngines": 0,
|
||||
"workplaceSearchOrgSources": 0,
|
||||
"workplaceSearchPrivateSources": 0,
|
||||
"totalInstances": 0,
|
||||
"uptime": 0,
|
||||
"memUsed": 0,
|
||||
"memCommitted": 0,
|
||||
"memTotal": 0,
|
||||
"versions": []
|
||||
}
|
||||
},
|
||||
"isPrimary": true,
|
||||
"status": "yellow",
|
||||
"isCcrEnabled": false
|
||||
}
|
||||
]
|
|
@ -1,46 +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 fixture from './fixtures/instance.json';
|
||||
import { getLifecycleMethods } from '../../data_stream';
|
||||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const { setup, tearDown } = getLifecycleMethods(getService);
|
||||
|
||||
describe('instance detail - metricbeat and package', () => {
|
||||
['rules_and_actions', 'rules_and_actions_package'].forEach((source) => {
|
||||
describe(`instance detail ${source}`, () => {
|
||||
const archive = `x-pack/test/functional/es_archives/monitoring/kibana/${source}`;
|
||||
const timeRange = {
|
||||
min: '2022-05-31T18:44:19.267Z',
|
||||
max: '2022-05-31T19:59:19.267Z',
|
||||
};
|
||||
|
||||
before('load archive', () => {
|
||||
return setup(archive);
|
||||
});
|
||||
|
||||
after('unload archive', () => {
|
||||
return tearDown(archive);
|
||||
});
|
||||
|
||||
it('should get data for the kibana instance view', async () => {
|
||||
const { body } = await supertest
|
||||
.post(
|
||||
'/api/monitoring/v1/clusters/SvjwrFv6Rvuqjm9-cSSVEg/kibana/5b2de169-2785-441b-ae8c-186a1936b17d'
|
||||
)
|
||||
.set('kbn-xsrf', 'xxx')
|
||||
.send({ timeRange })
|
||||
.expect(200);
|
||||
expect(body).to.eql(fixture);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
|
@ -1,45 +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 fixture from './fixtures/overview.json';
|
||||
import { getLifecycleMethods } from '../../data_stream';
|
||||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const { setup, tearDown } = getLifecycleMethods(getService);
|
||||
|
||||
describe('overview - metricbeat and package', () => {
|
||||
['rules_and_actions', 'rules_and_actions_package'].forEach((source) => {
|
||||
describe(`overview ${source}`, () => {
|
||||
const archive = `x-pack/test/functional/es_archives/monitoring/kibana/${source}`;
|
||||
const timeRange = {
|
||||
min: '2022-05-31T18:44:19.267Z',
|
||||
max: '2022-05-31T19:59:19.267Z',
|
||||
};
|
||||
|
||||
before('load archive', () => {
|
||||
return setup(archive);
|
||||
});
|
||||
|
||||
after('unload archive', () => {
|
||||
return tearDown(archive);
|
||||
});
|
||||
|
||||
it('should get kibana rules at cluster level', async () => {
|
||||
const { body } = await supertest
|
||||
.post('/api/monitoring/v1/clusters/SvjwrFv6Rvuqjm9-cSSVEg')
|
||||
.set('kbn-xsrf', 'xxx')
|
||||
.send({ timeRange, codePaths: ['all'] })
|
||||
.expect(200);
|
||||
|
||||
expect(body[0].kibana.rules).to.eql(fixture[0].kibana.rules);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
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
|
@ -13,6 +13,7 @@ export default function ({ loadTestFile }: FtrProviderContext) {
|
|||
loadTestFile(require.resolve('./beats'));
|
||||
loadTestFile(require.resolve('./elasticsearch'));
|
||||
loadTestFile(require.resolve('./enterprisesearch'));
|
||||
loadTestFile(require.resolve('./kibana'));
|
||||
loadTestFile(require.resolve('./logstash'));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -5,9 +5,11 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
export default function ({ loadTestFile }) {
|
||||
describe('Rules and Actions', () => {
|
||||
import { FtrProviderContext } from '../../../api_integration/ftr_provider_context';
|
||||
|
||||
export default function ({ loadTestFile }: FtrProviderContext) {
|
||||
describe('Kibana', () => {
|
||||
loadTestFile(require.resolve('./overview'));
|
||||
loadTestFile(require.resolve('./instance'));
|
||||
loadTestFile(require.resolve('./instances'));
|
||||
});
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* 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 instancesResponse from '../../fixtures/kibana/instances.json';
|
||||
import instanceResponse from '../../fixtures/kibana/instance.json';
|
||||
|
||||
export default function ({ getService }: FtrProviderContext) {
|
||||
const supertest = getService('supertest');
|
||||
|
||||
const testRunner = getTestRunner({
|
||||
testName: 'Instances',
|
||||
archiveRoot: 'x-pack/test/monitoring_api_integration/archives/kibana/single_node',
|
||||
getService,
|
||||
});
|
||||
|
||||
const timeRange = {
|
||||
min: '2023-03-14T12:53:50.000Z',
|
||||
max: '2023-03-14T13:03:30.000Z',
|
||||
};
|
||||
|
||||
testRunner(() => {
|
||||
it('should summarize list of kibana instances with stats', async () => {
|
||||
const { body } = await supertest
|
||||
.post('/api/monitoring/v1/clusters/rSEDbJNIQmOE-v9n2rV5cA/kibana/instances')
|
||||
.set('kbn-xsrf', 'xxx')
|
||||
.send({ timeRange })
|
||||
.expect(200);
|
||||
|
||||
expect(body).to.eql(instancesResponse);
|
||||
});
|
||||
|
||||
it('should summarize single kibana instance with metrics', async () => {
|
||||
const { body } = await supertest
|
||||
.post(
|
||||
'/api/monitoring/v1/clusters/rSEDbJNIQmOE-v9n2rV5cA/kibana/2eae9cd1-7305-4f3e-9381-dbf1975bf624'
|
||||
)
|
||||
.set('kbn-xsrf', 'xxx')
|
||||
.send({ timeRange })
|
||||
.expect(200);
|
||||
|
||||
expect(body).to.eql(instanceResponse);
|
||||
});
|
||||
});
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* 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 clusterOverviewResponse from '../../fixtures/kibana/cluster_overview.json';
|
||||
import kibanaOverviewResponse from '../../fixtures/kibana/kibana_overview.json';
|
||||
|
||||
export default function ({ getService }: FtrProviderContext) {
|
||||
const supertest = getService('supertest');
|
||||
|
||||
const testRunner = getTestRunner({
|
||||
testName: 'Overview',
|
||||
archiveRoot: 'x-pack/test/monitoring_api_integration/archives/kibana/single_node',
|
||||
getService,
|
||||
});
|
||||
|
||||
const timeRange = {
|
||||
min: '2023-03-14T12:53:50.000Z',
|
||||
max: '2023-03-14T13:03:30.000Z',
|
||||
};
|
||||
|
||||
testRunner(() => {
|
||||
it('should get kibana rules at cluster level', async () => {
|
||||
const { body } = await supertest
|
||||
.post('/api/monitoring/v1/clusters/rSEDbJNIQmOE-v9n2rV5cA')
|
||||
.set('kbn-xsrf', 'xxx')
|
||||
.send({ timeRange, codePaths: ['all'] })
|
||||
.expect(200);
|
||||
|
||||
expect(body[0].kibana.rules).to.eql(clusterOverviewResponse[0].kibana.rules);
|
||||
});
|
||||
|
||||
it('should summarize kibana instances with stats', async () => {
|
||||
const { body } = await supertest
|
||||
.post('/api/monitoring/v1/clusters/rSEDbJNIQmOE-v9n2rV5cA/kibana')
|
||||
.set('kbn-xsrf', 'xxx')
|
||||
.send({ timeRange })
|
||||
.expect(200);
|
||||
|
||||
expect(body).to.eql(kibanaOverviewResponse);
|
||||
});
|
||||
});
|
||||
}
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
[{"cluster_uuid":"rSEDbJNIQmOE-v9n2rV5cA","cluster_name":"elasticsearch","version":"8.7.0","license":{"status":"active","type":"trial","expiry_date_in_millis":1681389467555},"elasticsearch":{"cluster_stats":{"indices":{"count":46,"docs":{"count":8789},"shards":{"total":46,"primaries":46},"store":{"size_in_bytes":15044337}},"nodes":{"fs":{"total_in_bytes":193393164288,"available_in_bytes":42682073088},"count":{"total":1},"jvm":{"max_uptime_in_millis":1553652,"mem":{"heap_max_in_bytes":1073741824,"heap_used_in_bytes":716122432}}},"status":"yellow"},"logs":{"enabled":false,"types":[],"reason":{"indexPatternExists":false,"indexPatternInTimeRangeExists":false,"typeExistsAtAnyTime":false,"typeExists":false,"usingStructuredLogs":false,"clusterExists":false,"nodeExists":null,"indexExists":null}}},"logstash":{},"kibana":{"status":"green","some_status_is_stale":true,"requests_total":101,"concurrent_connections":20,"response_time_max":1131,"memory_size":540241920,"memory_limit":4345298944,"count":1,"rules":{"cluster":{"overdue":{"count":7,"delay":{"p50":1353,"p99":1354}}},"instance":{"failures":0,"executions":114,"timeouts":0}}},"ml":{"jobs":0},"beats":{"totalEvents":0,"bytesSent":0,"beats":{"total":0,"types":[]}},"apm":{"totalEvents":0,"memRss":0,"apms":{"total":0},"versions":[],"config":{"container":false}},"enterpriseSearch":{"clusterUuid":"rSEDbJNIQmOE-v9n2rV5cA","stats":{"appSearchEngines":0,"workplaceSearchOrgSources":0,"workplaceSearchPrivateSources":0,"totalInstances":0,"uptime":0,"memUsed":0,"memCommitted":0,"memTotal":0,"versions":[]}},"isPrimary":true,"status":"yellow","isCcrEnabled":true}]
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
{"clusterStatus":{"uuids":["2eae9cd1-7305-4f3e-9381-dbf1975bf624"],"status":"green","some_status_is_stale":true,"requests_total":101,"concurrent_connections":20,"response_time_max":1131,"memory_size":540241920,"memory_limit":4345298944,"count":1},"kibanas":[{"kibana":{"name":"kibana","host":"0.0.0.0","status":"green","transport_address":"0.0.0.0:5601","uuid":"2eae9cd1-7305-4f3e-9381-dbf1975bf624"},"concurrent_connections":20,"process":{"memory":{"resident_set_size_in_bytes":540241920}},"os":{"load":{"1m":1.24}},"response_times":{"average":188,"max":1131},"requests":{"total":101},"statusIsStale":true,"lastSeenTimestamp":"2023-03-14T13:03:23.964Z"}]}
|
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -12,6 +12,7 @@ const PACKAGES = [
|
|||
{ name: 'elasticsearch', version: '1.4.1' },
|
||||
{ name: 'enterprisesearch', version: '1.0.0' },
|
||||
{ name: 'logstash', version: '2.2.2-preview1' },
|
||||
{ name: 'kibana', version: '2.3.0-preview1' },
|
||||
];
|
||||
|
||||
export const getPackagesArgs = (): string[] => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue