Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Monitoring] Elasticsearch monitoring to EUI #26217

Merged
merged 27 commits into from
Dec 12, 2018
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6eaa4bb
Convert cluster alerts page to use EUI tables. Also adds baseline sup…
chrisronline Nov 21, 2018
8d55e54
Fix tests
chrisronline Nov 21, 2018
b5fd045
Merge remote-tracking branch 'elastic/master' into monitoring/eui_alerts
chrisronline Nov 21, 2018
923c57c
Remove these two files
chrisronline Nov 21, 2018
93b9f6e
Keep the original table but offer a new one so existing UIs still work
chrisronline Nov 21, 2018
63d5f63
Use different base table controller for the EUI table
chrisronline Nov 21, 2018
47a7ca6
Use EUI specific asc and desc constants
chrisronline Nov 21, 2018
38a71bf
Update summary status
chrisronline Nov 23, 2018
445e762
ES nodes
chrisronline Nov 26, 2018
8e182fe
Indices page
chrisronline Nov 26, 2018
b460147
ML job listing
chrisronline Nov 26, 2018
bb76c83
Fix tests up
chrisronline Nov 26, 2018
022ee06
Merge in monotiring_eui
chrisronline Nov 26, 2018
c5f007a
Node listing page
chrisronline Nov 26, 2018
6701f58
Advanced node page
chrisronline Nov 26, 2018
a8cb066
Advanced index
chrisronline Nov 26, 2018
6279105
Fix tests
chrisronline Nov 26, 2018
2b13435
Fix onBrush
chrisronline Nov 26, 2018
a3ae2dd
Cluster listing page
chrisronline Nov 27, 2018
b100433
Merge in monitoring_eui
chrisronline Nov 27, 2018
c36fa87
Update snapshots
chrisronline Nov 27, 2018
8497bcc
Fix functional tests
chrisronline Nov 27, 2018
1727079
Fix more tests
chrisronline Nov 27, 2018
7b1840f
Merge remote-tracking branch 'elastic/master' into monitoring/eui_es
chrisronline Nov 30, 2018
4c27b49
Merge remote-tracking branch 'elastic/monitoring_eui' into monitoring…
chrisronline Nov 30, 2018
2288946
Remove commented out code
chrisronline Nov 30, 2018
0643113
Merge branch 'monitoring_eui' of github.com:elastic/kibana into chris…
mattapperson Dec 6, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,31 @@ function StatusUI({ stats, intl }) {
defaultMessage: 'Name',
}),
value: name,
dataTestSubj: 'name'
'data-test-subj': 'name'
},
{
label: intl.formatMessage({
id: 'xpack.monitoring.apm.instance.status.outputLabel',
defaultMessage: 'Output',
}),
value: output,
dataTestSubj: 'output'
'data-test-subj': 'output'
},
{
label: intl.formatMessage({
id: 'xpack.monitoring.apm.instance.status.versionLabel',
defaultMessage: 'Version',
}),
value: version,
dataTestSubj: 'version'
'data-test-subj': 'version'
},
{
label: intl.formatMessage({
id: 'xpack.monitoring.apm.instance.status.uptimeLabel',
defaultMessage: 'Uptime',
}),
value: formatMetric(uptime, 'time_since'),
dataTestSubj: 'uptime'
'data-test-subj': 'uptime'
},
{
label: intl.formatMessage({
Expand All @@ -65,7 +65,7 @@ function StatusUI({ stats, intl }) {
defaultMessage: '{timeOfLastEvent} ago' }, {
timeOfLastEvent: formatTimestampToDuration(+moment(timeOfLastEvent), CALCULATE_DURATION_SINCE)
}),
dataTestSubj: 'timeOfLastEvent',
'data-test-subj': 'timeOfLastEvent',
}
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ function StatusUI({ stats, intl }) {
defaultMessage: 'Servers',
}),
value: total,
dataTestSubj: 'total'
'data-test-subj': 'total'
},
{
label: intl.formatMessage({
id: 'xpack.monitoring.apm.instances.status.totalEventsLabel',
defaultMessage: 'Total Events',
}),
value: formatMetric(totalEvents, '0.[0]a'),
dataTestSubj: 'totalEvents'
'data-test-subj': 'totalEvents'
},
{
label: intl.formatMessage({
Expand All @@ -49,7 +49,7 @@ function StatusUI({ stats, intl }) {
defaultMessage: '{timeOfLastEvent} ago' }, {
timeOfLastEvent: formatTimestampToDuration(+moment(timeOfLastEvent), CALCULATE_DURATION_SINCE)
}),
dataTestSubj: 'timeOfLastEvent',
'data-test-subj': 'timeOfLastEvent',
}
];

Expand Down
91 changes: 30 additions & 61 deletions x-pack/plugins/monitoring/public/components/beats/beat/beat.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
import React from 'react';
import { MonitoringTimeseriesContainer } from '../../chart';
import { formatMetric } from '../../../lib/format_number';
import { EuiFlexItem, EuiFlexGroup, EuiPage, EuiPageBody, EuiFlexGrid, EuiSpacer } from '@elastic/eui';
import { EuiFlexItem, EuiPage, EuiPageBody, EuiFlexGrid, EuiSpacer, EuiPageContent } from '@elastic/eui';
import { injectI18n } from '@kbn/i18n/react';
import { SummaryStatus } from '../../summary_status';

function BeatUi({ summary, metrics, intl, ...props }) {

Expand All @@ -23,122 +24,90 @@ function BeatUi({ summary, metrics, intl, ...props }) {
metrics.beat_handles,
];

const wrapChild = ({ label, value, dataTestSubj }, index) => (
<EuiFlexItem
key={`summary-status-item-${index}`}
grow={false}
data-test-subj={dataTestSubj}
>
<EuiFlexGroup responsive={false} gutterSize="xs" alignItems="center">
<EuiFlexItem grow={false}>
{label ? label + ': ' : null}
</EuiFlexItem>
<EuiFlexItem grow={false}>
<strong>{value}</strong>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
);

const summarytStatsTop = [
{
label: intl.formatMessage({ id: 'xpack.monitoring.beats.instance.nameLabel', defaultMessage: 'Name' }),
value: summary.name,
dataTestSubj: 'name'
'data-test-subj': 'name'
},
{
label: intl.formatMessage({ id: 'xpack.monitoring.beats.instance.hostLabel', defaultMessage: 'Host' }),
value: summary.transportAddress,
dataTestSubj: 'host'
'data-test-subj': 'host'
},
{
label: intl.formatMessage({ id: 'xpack.monitoring.beats.instance.versionLabel', defaultMessage: 'Version' }),
value: summary.version,
dataTestSubj: 'version'
'data-test-subj': 'version'
},
{
label: intl.formatMessage({ id: 'xpack.monitoring.beats.instance.typeLabel', defaultMessage: 'Type' }),
value: summary.type,
dataTestSubj: 'type'
'data-test-subj': 'type'
},
{
label: intl.formatMessage({ id: 'xpack.monitoring.beats.instance.outputLabel', defaultMessage: 'Output' }),
value: summary.output,
dataTestSubj: 'output'
'data-test-subj': 'output'
},
{
label: intl.formatMessage({ id: 'xpack.monitoring.beats.instance.configReloadsLabel', defaultMessage: 'Config reloads' }),
value: formatMetric(summary.configReloads, 'int_commas'),
dataTestSubj: 'configReloads'
'data-test-subj': 'configReloads'
},
{
label: intl.formatMessage({ id: 'xpack.monitoring.beats.instance.uptimeLabel', defaultMessage: 'Uptime' }),
value: formatMetric(summary.uptime, 'time_since'),
dataTestSubj: 'uptime'
'data-test-subj': 'uptime'
},
];

const summarytStatsBot = [
{
label: intl.formatMessage({ id: 'xpack.monitoring.beats.instance.eventsTotalLabel', defaultMessage: 'Events total' }),
value: formatMetric(summary.eventsTotal, 'int_commas'),
dataTestSubj: 'eventsTotal'
'data-test-subj': 'eventsTotal'
},
{
label: intl.formatMessage({ id: 'xpack.monitoring.beats.instance.eventsEmittedLabel', defaultMessage: 'Events emitted' }),
value: formatMetric(summary.eventsEmitted, 'int_commas'),
dataTestSubj: 'eventsEmitted'
'data-test-subj': 'eventsEmitted'
},
{
label: intl.formatMessage({ id: 'xpack.monitoring.beats.instance.eventsDroppedLabel', defaultMessage: 'Events dropped' }),
value: formatMetric(summary.eventsDropped, 'int_commas'),
dataTestSubj: 'eventsDropped'
'data-test-subj': 'eventsDropped'
},
{
label: intl.formatMessage({ id: 'xpack.monitoring.beats.instance.bytesSentLabel', defaultMessage: 'Bytes sent' }),
value: formatMetric(summary.bytesWritten, 'byte'),
dataTestSubj: 'bytesWritten'
'data-test-subj': 'bytesWritten'
},
{
label: intl.formatMessage({ id: 'xpack.monitoring.beats.instance.handlesLimitSoftLabel', defaultMessage: 'Handles limit (soft)' }),
value: formatMetric(summary.handlesSoftLimit, 'byte'),
dataTestSubj: 'handlesLimitSoft'
'data-test-subj': 'handlesLimitSoft'
},
{
label: intl.formatMessage({ id: 'xpack.monitoring.beats.instance.handlesLimitHardLabel', defaultMessage: 'Handles limit (hard)' }),
value: formatMetric(summary.handlesHardLimit, 'byte'),
dataTestSubj: 'handlesLimitHard'
'data-test-subj': 'handlesLimitHard'
},
];

return (
<div>
<div className="monSummaryStatus" role="status">
<div {...props}>
<EuiFlexGroup gutterSize="none" alignItems="center" data-test-subj="beatSummaryStatus01">
<EuiFlexItem grow={false}>
<EuiFlexGroup>
{summarytStatsTop.map(wrapChild)}
</EuiFlexGroup>
</EuiFlexItem>
</EuiFlexGroup>
</div>
</div>

<div className="monSummaryStatus" role="status">
<div {...props}>
<EuiFlexGroup gutterSize="none" alignItems="center" data-test-subj="beatSummaryStatus02">
<EuiFlexItem grow={false}>
<EuiFlexGroup>
{summarytStatsBot.map(wrapChild)}
</EuiFlexGroup>
</EuiFlexItem>
</EuiFlexGroup>
</div>
</div>

<EuiPage style={{ backgroundColor: 'white' }}>
<EuiPageBody>
<EuiPage>
<EuiPageBody>
<EuiPageContent>
<SummaryStatus
metrics={summarytStatsTop}
data-test-subj="beatSummaryStatus01"
/>
<SummaryStatus
metrics={summarytStatsBot}
data-test-subj="beatSummaryStatus02"
/>
<EuiSpacer size="m"/>
<EuiFlexGrid columns={2} gutterSize="none">
{metricsToShow.map((metric, index) => (
<EuiFlexItem key={index} style={{ width: '50%' }}>
Expand All @@ -150,9 +119,9 @@ function BeatUi({ summary, metrics, intl, ...props }) {
</EuiFlexItem>
))}
</EuiFlexGrid>
</EuiPageBody>
</EuiPage>
</div>
</EuiPageContent>
</EuiPageBody>
</EuiPage>
);
}

Expand Down
107 changes: 39 additions & 68 deletions x-pack/plugins/monitoring/public/components/beats/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,80 +4,51 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { get } from 'lodash';
import React from 'react';
import { formatMetric } from 'plugins/monitoring/lib/format_number';
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { SummaryStatus } from '../summary_status';

export function Stats({ stats }) {
const types = stats.types.map(({ type, count }, index) => {
return (
<EuiFlexItem
key={`type-${index}`}
data-test-subj="typeCount"
data-test-type-count={type + ':' + count}
grow={false}
>
<EuiFlexGroup responsive={false} gutterSize="xs" alignItems="center">
<EuiFlexItem grow={false}>
{type ? type + ': ' : null}
</EuiFlexItem>
<EuiFlexItem grow={false}>
<strong>{formatMetric(count, 'int_commas')}</strong>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
);
const {
total,
types,
stats: {
bytesSent,
totalEvents,
}
} = stats;

const metrics = [
{
label: 'Total Beats',
value: formatMetric(total, 'int_commas'),
'data-test-subj': 'totalBeats'
},
];

metrics.push(...types.map(({ type, count }) => ({
label: type,
value: formatMetric(count, 'int_commas'),
'data-test-subj': 'typeCount',
'data-test-type-count': `${type}:${count}`
})));

metrics.push({
label: 'Total Events',
value: formatMetric(totalEvents, '0.[0]a'),
'data-test-subj': 'totalEvents'
});

return (
<div className="monSummaryStatus" role="status" data-test-subj="beatsSummaryStatus">

<EuiFlexGroup responsive={false} gutterSize="xs" alignItems="center">
<EuiFlexItem grow={false}>
<FormattedMessage
id="xpack.monitoring.beats.overview.totalBeatsLabel"
defaultMessage="Total Beats"
/>
:&nbsp;
</EuiFlexItem>
<EuiFlexItem grow={false}>
<strong data-test-subj="totalBeats">
{formatMetric(get(stats, 'total'), 'int_commas')}
</strong>
</EuiFlexItem>

{types}

<EuiFlexItem grow={false}>
<FormattedMessage
id="xpack.monitoring.beats.overview.totalEventsLabel"
defaultMessage="Total Events"
/>
:&nbsp;
</EuiFlexItem>

<EuiFlexItem grow={false}>
<strong data-test-subj="totalEvents">
{formatMetric(get(stats, 'stats.totalEvents'), '0.[0]a')}
</strong>
</EuiFlexItem>

<EuiFlexItem grow={false}>
<FormattedMessage
id="xpack.monitoring.beats.overview.bytesSentLabel"
defaultMessage="Bytes Sent"
/>
:&nbsp;
</EuiFlexItem>
<EuiFlexItem grow={false}>
<strong data-test-subj="bytesSent">
{formatMetric(get(stats, 'stats.bytesSent'), 'byte')}
</strong>
</EuiFlexItem>
</EuiFlexGroup>
metrics.push({
label: 'Bytes Sent',
value: formatMetric(bytesSent, 'byte'),
'data-test-subj': 'bytesSent'
});

</div>
return (
<SummaryStatus
metrics={metrics}
data-test-subj="beatsSummaryStatus"
/>
);
}
Loading