[Monitoring] Add handles graph for beats (#24265) (#24522)

* Add handles graph

* Add limits in the UI

* Remove debug

* Update api tests

* Fix tests

* Fix snapshots

* Skip this test for now

* Fix this test and re-enable it
This commit is contained in:
Chris Roberson 2018-10-24 15:23:57 -04:00 committed by GitHub
parent 876567a9b9
commit 8122f5e6db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 756 additions and 1543 deletions

View file

@ -19,6 +19,7 @@ export function Beat({ summary, metrics, ...props }) {
metrics.beat_memory,
metrics.beat_cpu_utilization,
metrics.beat_os_load,
metrics.beat_handles,
];
const wrapChild = ({ label, value, dataTestSubj }, index) => (
@ -53,6 +54,8 @@ export function Beat({ summary, metrics, ...props }) {
{ label: 'Events emitted', value: formatMetric(summary.eventsEmitted, 'int_commas'), dataTestSubj: 'eventsEmitted' },
{ label: 'Events dropped', value: formatMetric(summary.eventsDropped, 'int_commas'), dataTestSubj: 'eventsDropped' },
{ label: 'Bytes sent', value: formatMetric(summary.bytesWritten, 'byte'), dataTestSubj: 'bytesWritten' },
{ label: 'Handles limit (soft)', value: formatMetric(summary.handlesSoftLimit, 'byte'), dataTestSubj: 'handlesLimitSoft' },
{ label: 'Handles limit (hard)', value: formatMetric(summary.handlesHardLimit, 'byte'), dataTestSubj: 'handlesLimitHard' },
];
return (

View file

@ -25,6 +25,8 @@ describe('get_beat_summary', () => {
bytesWritten: null,
configReloads: null,
uptime: null,
handlesHardLimit: null,
handlesSoftLimit: null
});
});
@ -47,6 +49,12 @@ describe('get_beat_summary', () => {
uptime: {
ms: 32 * 1000 * 1000 * 1000,
}
},
handles: {
limit: {
hard: 14000,
soft: 14000
}
}
},
libbeat: {
@ -119,6 +127,8 @@ describe('get_beat_summary', () => {
bytesWritten: 16000000,
configReloads: 17,
uptime: 32000000000,
handlesHardLimit: 14000,
handlesSoftLimit: 14000
});
});
@ -141,6 +151,12 @@ describe('get_beat_summary', () => {
uptime: {
ms: 32 * 1000 * 1000
}
},
handles: {
limit: {
hard: 14000,
soft: 14000
}
}
},
libbeat: {
@ -213,6 +229,8 @@ describe('get_beat_summary', () => {
bytesWritten: null,
configReloads: 18,
uptime: 32000000,
handlesHardLimit: 14000,
handlesSoftLimit: 14000
});
});
});

View file

@ -22,6 +22,8 @@ export function handleResponse(response, beatUuid) {
const eventsEmittedLast = get(stats, 'metrics.libbeat.pipeline.events.published', null);
const eventsDroppedLast = get(stats, 'metrics.libbeat.pipeline.events.dropped', null);
const bytesWrittenLast = get(stats, 'metrics.libbeat.output.write.bytes', null);
const handlesHardLimit = get(stats, 'metrics.beat.handles.limit.hard', null);
const handlesSoftLimit = get(stats, 'metrics.beat.handles.limit.soft', null);
return {
uuid: beatUuid,
@ -36,6 +38,8 @@ export function handleResponse(response, beatUuid) {
eventsEmitted: getDiffCalculation(eventsEmittedLast, eventsEmittedFirst),
eventsDropped: getDiffCalculation(eventsDroppedLast, eventsDroppedFirst),
bytesWritten: getDiffCalculation(bytesWrittenLast, bytesWrittenFirst),
handlesHardLimit,
handlesSoftLimit,
};
}
@ -61,6 +65,8 @@ export async function getBeatSummary(req, beatsIndexPattern, { clusterUuid, beat
'hits.hits._source.beats_stats.metrics.libbeat.output.write.bytes',
'hits.hits._source.beats_stats.metrics.libbeat.config.reloads',
'hits.hits._source.beats_stats.metrics.beat.info.uptime.ms',
'hits.hits._source.beats_stats.metrics.beat.handles.limit.hard',
'hits.hits._source.beats_stats.metrics.beat.handles.limit.soft',
'hits.hits.inner_hits.first_hit.hits.hits._source.beats_stats.metrics.libbeat.pipeline.events.published',
'hits.hits.inner_hits.first_hit.hits.hits._source.beats_stats.metrics.libbeat.pipeline.events.total',
'hits.hits.inner_hits.first_hit.hits.hits._source.beats_stats.metrics.libbeat.pipeline.events.dropped',

View file

@ -1556,6 +1556,19 @@ Object {
"units": "%",
"uuidField": "beats_stats.beat.uuid",
},
"beat_handles_open": BeatsMetric {
"app": "beats",
"derivative": false,
"description": "Count of open file handlers",
"field": "beats_stats.metrics.beat.handles.open",
"format": "0.[00]",
"label": "Open Handles",
"metricAgg": "max",
"timestampField": "beats_stats.timestamp",
"title": "Open Handles",
"units": "",
"uuidField": "beats_stats.beat.uuid",
},
"beat_mem_alloc": BeatsMetric {
"app": "beats",
"derivative": false,

View file

@ -12,7 +12,7 @@ import {
BeatsCpuUtilizationMetric,
BeatsMetric
} from './classes';
import { LARGE_FLOAT, LARGE_BYTES } from '../../../../common/formatting';
import { LARGE_FLOAT, LARGE_BYTES, SMALL_FLOAT } from '../../../../common/formatting';
export const metrics = {
beat_cluster_pipeline_events_total_rate: new BeatsEventsRateClusterMetric({
@ -248,5 +248,15 @@ export const metrics = {
format: LARGE_FLOAT,
metricAgg: 'max',
units: ''
}),
beat_handles_open: new BeatsMetric({
field: 'beats_stats.metrics.beat.handles.open',
label: 'Open Handles',
title: 'Open Handles',
description: 'Count of open file handlers',
format: SMALL_FLOAT,
metricAgg: 'max',
units: '',
})
};

View file

@ -43,5 +43,11 @@ export const metricSet = [
'beat_system_os_load_15'
],
name: 'beat_os_load'
},
{
name: 'beat_handles',
keys: [
'beat_handles_open',
]
}
];