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] APM monitoring to EUI #26344

Merged
merged 32 commits into from
Dec 12, 2018
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
32 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
15d5bb9
Overview page
chrisronline Nov 27, 2018
c36fa87
Update snapshots
chrisronline Nov 27, 2018
8497bcc
Fix functional tests
chrisronline Nov 27, 2018
940c267
Beats instances
chrisronline Nov 27, 2018
1727079
Fix more tests
chrisronline Nov 27, 2018
d867656
Update tests
chrisronline Nov 27, 2018
c29f10c
Update cluster tests
chrisronline Nov 27, 2018
3d46fd4
Logstash UIs
chrisronline Nov 27, 2018
ace5aa3
Logstash tests
chrisronline Nov 27, 2018
a520f8b
APM pages
chrisronline Nov 28, 2018
5982b5a
Merge in monitoring_eui
chrisronline Dec 12, 2018
8fc975d
Merge remote-tracking branch 'elastic/monitoring_eui' into monitoring…
chrisronline Dec 12, 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 @@ -12,7 +12,8 @@ import {
EuiSpacer,
EuiPage,
EuiPageBody,
EuiFlexGroup
EuiFlexGroup,
EuiPageContent
} from '@elastic/eui';
import { Status } from './status';

Expand Down Expand Up @@ -46,13 +47,15 @@ export function ApmServerInstance({ summary, metrics, ...props }) {
));

return (
<EuiPage style={{ backgroundColor: 'white' }}>
<EuiPage>
<EuiPageBody>
<Status stats={summary}/>
<EuiSpacer size="s"/>
<EuiFlexGroup wrap>
{charts}
</EuiFlexGroup>
<EuiPageContent>
<Status stats={summary}/>
<EuiSpacer size="s"/>
<EuiFlexGroup wrap>
{charts}
</EuiFlexGroup>
</EuiPageContent>
</EuiPageBody>
</EuiPage>
);
Expand Down
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
174 changes: 75 additions & 99 deletions x-pack/plugins/monitoring/public/components/apm/instances/instances.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,150 +6,126 @@

import React from 'react';
import moment from 'moment';
import { MonitoringTable } from '../../table';
import {
KuiTableRowCell,
KuiTableRow
} from '@kbn/ui-framework/components';
import { EuiLink } from '@elastic/eui';
import { uniq } from 'lodash';
import { EuiMonitoringTable } from '../../table';
import { EuiLink, EuiPage, EuiPageBody, EuiPageContent, EuiSpacer } from '@elastic/eui';
import { Status } from './status';
import { SORT_ASCENDING, SORT_DESCENDING, TABLE_ACTION_UPDATE_FILTER } from '../../../../common/constants';
import { formatMetric } from '../../../lib/format_number';
import { formatTimestampToDuration } from '../../../../common';
import { i18n } from '@kbn/i18n';
import { injectI18n } from '@kbn/i18n/react';


const filterFields = [ 'name', 'type', 'version', 'output' ];
const columns = [
{
title: i18n.translate('xpack.monitoring.apm.instances.nameTitle', {
name: i18n.translate('xpack.monitoring.apm.instances.nameTitle', {
defaultMessage: 'Name'
}),
sortKey: 'name',
sortOrder: SORT_ASCENDING
field: 'name',
render: (name, instance) => (
<EuiLink
href={`#/apm/instances/${instance.uuid}`}
data-test-subj={`apmLink-${name}`}
>
{name}
</EuiLink>
)
},
{
title: i18n.translate('xpack.monitoring.apm.instances.outputEnabledTitle', {
name: i18n.translate('xpack.monitoring.apm.instances.outputEnabledTitle', {
defaultMessage: 'Output Enabled'
}),
sortKey: 'output'
field: 'output'
},
{
title: i18n.translate('xpack.monitoring.apm.instances.totalEventsRateTitle', {
name: i18n.translate('xpack.monitoring.apm.instances.totalEventsRateTitle', {
defaultMessage: 'Total Events Rate'
}),
sortKey: 'total_events_rate',
secondarySortOrder: SORT_DESCENDING
field: 'total_events_rate',
render: value => formatMetric(value, '', '/s')
},
{
title: i18n.translate('xpack.monitoring.apm.instances.bytesSentRateTitle', {
name: i18n.translate('xpack.monitoring.apm.instances.bytesSentRateTitle', {
defaultMessage: 'Bytes Sent Rate'
}),
sortKey: 'bytes_sent_rate'
field: 'bytes_sent_rate',
render: value => formatMetric(value, 'byte', '/s')
},
{
title: i18n.translate('xpack.monitoring.apm.instances.outputErrorsTitle', {
name: i18n.translate('xpack.monitoring.apm.instances.outputErrorsTitle', {
defaultMessage: 'Output Errors'
}),
sortKey: 'errors'
field: 'errors',
render: value => formatMetric(value, '0')
},
{
title: i18n.translate('xpack.monitoring.apm.instances.lastEventTitle', {
name: i18n.translate('xpack.monitoring.apm.instances.lastEventTitle', {
defaultMessage: 'Last Event'
}),
sortKey: 'time_of_last_event'
field: 'time_of_last_event',
render: value => formatTimestampToDuration(+moment(value), 'since') + ' ago'
},
{
title: i18n.translate('xpack.monitoring.apm.instances.allocatedMemoryTitle', {
name: i18n.translate('xpack.monitoring.apm.instances.allocatedMemoryTitle', {
defaultMessage: 'Allocated Memory'
}),
sortKey: 'memory'
field: 'memory',
render: value => formatMetric(value, 'byte')
},
{
title: i18n.translate('xpack.monitoring.apm.instances.versionTitle', {
name: i18n.translate('xpack.monitoring.apm.instances.versionTitle', {
defaultMessage: 'Version'
}),
sortKey: 'version'
field: 'version'
},
];
const instanceRowFactory = () => {
return function KibanaRow(props) {
const applyFiltering = filterText => () => {
props.dispatchTableAction(TABLE_ACTION_UPDATE_FILTER, filterText);
};

return (
<KuiTableRow>
<KuiTableRowCell>
<div className="monTableCell__name">
<EuiLink
href={`#/apm/instances/${props.uuid}`}
data-test-subj={`apmLink-${props.name}`}
>
{props.name}
</EuiLink>
</div>
</KuiTableRowCell>
<KuiTableRowCell>
{props.output}
</KuiTableRowCell>
<KuiTableRowCell>
{formatMetric(props.total_events_rate, '', '/s')}
</KuiTableRowCell>
<KuiTableRowCell>
{formatMetric(props.bytes_sent_rate, 'byte', '/s')}
</KuiTableRowCell>
<KuiTableRowCell>
{formatMetric(props.errors, '0')}
</KuiTableRowCell>
<KuiTableRowCell>
{formatTimestampToDuration(+moment(props.time_of_last_event), 'since') + ' ago'}
</KuiTableRowCell>
<KuiTableRowCell>
{formatMetric(props.memory, 'byte')}
</KuiTableRowCell>
<KuiTableRowCell>
<EuiLink
onClick={applyFiltering(props.version)}
>
{props.version}
</EuiLink>
</KuiTableRowCell>
</KuiTableRow>
);
};
};

function ApmServerInstancesUI({ apms, intl }) {
export function ApmServerInstancesUI({ apms, intl }) {
const {
pageIndex,
filterText,
sortKey,
sortOrder,
onNewState,
pagination,
sorting,
onTableChange,
data
} = apms;

const versions = uniq(data.apms.map(item => item.version)).map(version => {
return { value: version };
});

return (
<div>
<Status stats={apms.data.stats}/>
<MonitoringTable
className="apmInstancesTable"
rows={apms.data.apms}
pageIndex={pageIndex}
filterText={filterText}
sortKey={sortKey}
sortOrder={sortOrder}
onNewState={onNewState}
placeholder={intl.formatMessage({
id: 'xpack.monitoring.apm.instances.filterInstancesPlaceholder',
defaultMessage: 'Filter Instances…'
})}
filterFields={filterFields}
columns={columns}
rowComponent={instanceRowFactory()}
/>
</div>
<EuiPage>
<EuiPageBody>
<EuiPageContent>
<Status stats={data.stats} />
<EuiSpacer size="m"/>
<EuiMonitoringTable
className="apmInstancesTable"
rows={data.apms}
columns={columns}
sorting={sorting}
pagination={pagination}
search={{
box: {
incremental: true,
placeholder: intl.formatMessage({
id: 'xpack.monitoring.apm.instances.filterInstancesPlaceholder',
defaultMessage: 'Filter Instances…'
})
},
filters: [
{
type: 'field_value_selection',
field: 'version',
name: 'Version',
options: versions,
multiSelect: 'or',
}
]
}}
onTableChange={onTableChange}
/>
</EuiPageContent>
</EuiPageBody>
</EuiPage>
);
}

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
17 changes: 10 additions & 7 deletions x-pack/plugins/monitoring/public/components/apm/overview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiPageBody,
EuiPanel
EuiPanel,
EuiPageContent
} from '@elastic/eui';
import { Status } from '../instances/status';

Expand Down Expand Up @@ -50,13 +51,15 @@ export function ApmOverview({
));

return (
<EuiPage style={{ backgroundColor: 'white' }}>
<EuiPage>
<EuiPageBody>
<Status stats={stats}/>
<EuiSpacer size="s"/>
<EuiFlexGroup wrap>
{charts}
</EuiFlexGroup>
<EuiPageContent>
<Status stats={stats}/>
<EuiSpacer size="s"/>
<EuiFlexGroup wrap>
{charts}
</EuiFlexGroup>
</EuiPageContent>
</EuiPageBody>
</EuiPage>
);
Expand Down
Loading