Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
08a7de1
Initial attempt at a reactor of how this works
chrisronline Apr 15, 2019
22fb160
Enter and exiting setup mode with migration buttons working
chrisronline Apr 15, 2019
964d9da
Merge remote-tracking branch 'elastic/master' into monitoring/mb_setu…
chrisronline Apr 17, 2019
fc78ee8
Adding monitoring url step back in and some small cleanup
chrisronline Apr 17, 2019
1a887ab
Elasticsearch steps
chrisronline Apr 17, 2019
79d1845
Add missing file
chrisronline Apr 18, 2019
f7881f5
Better organization here
chrisronline Apr 18, 2019
2c74202
Remove this debug logic
chrisronline Apr 22, 2019
caa889e
Clean up
chrisronline Apr 23, 2019
a9138f3
PR feedback
chrisronline Apr 23, 2019
b53a3af
Merge remote-tracking branch 'elastic/master' into monitoring/mb_setu…
chrisronline May 6, 2019
ca78377
Merge remote-tracking branch 'elastic/master' into monitoring/mb_setu…
chrisronline May 13, 2019
07de62b
Add in monospacing
chrisronline May 13, 2019
bdab86c
Persist monitoring url in local storage
chrisronline May 13, 2019
cfedbae
Merge remote-tracking branch 'elastic/master' into monitoring/mb_setu…
chrisronline May 19, 2019
b65a578
Rework the steps
chrisronline May 22, 2019
a0cd832
Merge in master
chrisronline May 22, 2019
10011ed
Change node to server, and add missing files
chrisronline May 22, 2019
6ff890d
Fix linting issues
chrisronline May 22, 2019
069863a
Fix api integration tests
chrisronline May 22, 2019
d297173
Merge remote-tracking branch 'elastic/master' into monitoring/mb_setu…
chrisronline May 23, 2019
2cd7a0e
PR feedback
chrisronline May 23, 2019
330d0af
Pass down if the product is the "primary" or not, then use that to sh…
chrisronline May 23, 2019
1e1e6c3
Elasticsearch migration will work slightly differently in that all no…
chrisronline May 28, 2019
d900540
More PR feedback
chrisronline May 28, 2019
acc712c
PR feedback
chrisronline May 29, 2019
3d30d20
Better links
chrisronline May 29, 2019
8c92c97
Fix tests
chrisronline May 29, 2019
08d421a
This should open in a new tab
chrisronline May 30, 2019
7c8ffea
PR feedback
chrisronline May 30, 2019
2aa97f9
Merge in master
chrisronline May 30, 2019
d130e24
Design and PR feedback
chrisronline May 31, 2019
1998046
Merge remote-tracking branch 'elastic/master' into monitoring/mb_setu…
chrisronline May 31, 2019
af2c7b9
Fix these tests
chrisronline May 31, 2019
7d476f7
Merge in master
chrisronline Jun 7, 2019
1c77d96
PR feedback
chrisronline Jun 7, 2019
4bfae10
Remove debug
chrisronline Jun 7, 2019
e2bf711
PR feedback
chrisronline Jun 7, 2019
9118cd0
Merge in master
chrisronline Jun 13, 2019
7d6cea1
Update the import path
chrisronline Jun 13, 2019
f45c64d
Update this import path too
chrisronline Jun 13, 2019
3218a7c
PR feedback
chrisronline Jun 14, 2019
ee15ead
Fix i18n
chrisronline Jun 14, 2019
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
2 changes: 2 additions & 0 deletions x-pack/plugins/monitoring/common/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ export const INDEX_PATTERN_FILEBEAT = 'filebeat-*';
// This is the unique token that exists in monitoring indices collected by metricbeat
export const METRICBEAT_INDEX_NAME_UNIQUE_TOKEN = '-mb-';

// We use this for metricbeat migration to identify specific products that we do not have constants for
export const ELASTICSEARCH_CUSTOM_ID = 'elasticsearch';
/**
* The id of the infra source owned by the monitoring plugin.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const getProps = (field) => {
upTime: 28056934,
version: ['8.0.0']
},
setupMode: {},
nodes,
sorting: {
sort: { field: 'name', direction: 'asc' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import React from 'react';
import React, { Fragment } from 'react';
import { NodeStatusIcon } from '../node';
import { extractIp } from '../../../lib/extract_ip'; // TODO this is only used for elasticsearch nodes summary / node detail, so it should be moved to components/elasticsearch/nodes/lib
import { ClusterStatus } from '../cluster_status';
Expand All @@ -18,6 +18,8 @@ import {
EuiPageContent,
EuiPageBody,
EuiPanel,
EuiCallOut,
EuiButton,
EuiText
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
Expand Down Expand Up @@ -207,7 +209,37 @@ const getColumns = showCgroupMetricsElasticsearch => {

export function ElasticsearchNodes({ clusterStatus, nodes, showCgroupMetricsElasticsearch, ...props }) {
const columns = getColumns(showCgroupMetricsElasticsearch);
const { sorting, pagination, onTableChange } = props;
const { sorting, pagination, onTableChange, setupMode } = props;

let disableInternalCollectionForMigrationMessage = null;
if (setupMode.data) {
if (setupMode.data.totalUniquePartiallyMigratedCount === setupMode.data.totalUniqueInstanceCount) {
disableInternalCollectionForMigrationMessage = (
<Fragment>
<EuiCallOut
title={i18n.translate('xpack.monitoring.elasticsearch.nodes.metribeatMigration.disableInternalCollectionTitle', {
defaultMessage: 'Disable internal collection to finish the migration',
})}
color="warning"
iconType="help"
>
<p>
{i18n.translate('xpack.monitoring.elasticsearch.nodes.metribeatMigration.disableInternalCollectionDescription', {
defaultMessage: `All of your Elasticsearch servers are monitored using Metricbeat,
but you need to disable internal collection to finish the migration.`
})}
</p>
<EuiButton onClick={() => setupMode.openFlyout()} size="s" color="warning" fill>
{i18n.translate('xpack.monitoring.elasticsearch.nodes.metribeatMigration.disableInternalCollectionMigrationButtonLabel', {
defaultMessage: 'Disable and finish migration'
})}
</EuiButton>
</EuiCallOut>
<EuiSpacer size="m"/>
</Fragment>
);
}
}

return (
<EuiPage>
Expand All @@ -216,13 +248,17 @@ export function ElasticsearchNodes({ clusterStatus, nodes, showCgroupMetricsElas
<ClusterStatus stats={clusterStatus} />
</EuiPanel>
<EuiSpacer size="m" />
{disableInternalCollectionForMigrationMessage}
<EuiPageContent>
<EuiMonitoringTable
className="elasticsearchNodesTable"
rows={nodes}
columns={columns}
sorting={sorting}
pagination={pagination}
setupMode={setupMode}
uuidField="resolver"
nameField="name"
search={{
box: {
incremental: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

export { KibanaInstances } from './instances';
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React, { PureComponent } from 'react';
import { EuiPage, EuiPageBody, EuiPageContent, EuiPanel, EuiSpacer, EuiLink } from '@elastic/eui';
import { capitalize } from 'lodash';
import { ClusterStatus } from '../cluster_status';
import { EuiMonitoringTable } from '../../table';
import { KibanaStatusIcon } from '../status_icon';
import { formatMetric, formatNumber } from '../../../lib/format_number';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';

const getColumns = (kbnUrl, scope) => {
Copy link
Copy Markdown
Contributor

@igoristic igoristic Jun 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed none of these columns have sortable which will be set to true automagically by EuiMonitoringTable, but in some cases it might require a handler:
sortable: (row) => row.sortOnThisPropInstead to sort on a different property.

This is just something to account for, but might not require any changes here

const columns = [
{
name: i18n.translate('xpack.monitoring.kibana.listing.nameColumnTitle', {
defaultMessage: 'Name'
}),
field: 'name',
render: (name, kibana) => (
<EuiLink
onClick={() => {
scope.$evalAsync(() => {
kbnUrl.changePath(`/kibana/instances/${kibana.kibana.uuid}`);
});
}}
data-test-subj={`kibanaLink-${name}`}
>
{ name }
</EuiLink>
)
},
{
name: i18n.translate('xpack.monitoring.kibana.listing.statusColumnTitle', {
defaultMessage: 'Status'
}),
field: 'status',
render: (status, kibana) => (
<div
title={`Instance status: ${status}`}
className="monTableCell__status"
>
<KibanaStatusIcon status={status} availability={kibana.availability} />&nbsp;
{ !kibana.availability ? (
<FormattedMessage
id="xpack.monitoring.kibana.listing.instanceStatus.offlineLabel"
defaultMessage="Offline"
/>
) : capitalize(status) }
</div>
)
},
{
name: i18n.translate('xpack.monitoring.kibana.listing.loadAverageColumnTitle', {
defaultMessage: 'Load Average'
}),
field: 'os.load.1m',
render: value => (
<span>
{formatMetric(value, '0.00')}
</span>
)
},
{
name: i18n.translate('xpack.monitoring.kibana.listing.memorySizeColumnTitle', {
defaultMessage: 'Memory Size'
}),
field: 'process.memory.resident_set_size_in_bytes',
render: value => (
<span>
{formatNumber(value, 'byte')}
</span>
)
},
{
name: i18n.translate('xpack.monitoring.kibana.listing.requestsColumnTitle', {
defaultMessage: 'Requests'
}),
field: 'requests.total',
render: value => (
<span>
{formatNumber(value, 'int_commas')}
</span>
)
},
{
name: i18n.translate('xpack.monitoring.kibana.listing.responseTimeColumnTitle', {
defaultMessage: 'Response Times'
}),
// It is possible this does not exist through MB collection
field: 'response_times.average',
render: (value, kibana) => {
if (!value) {
return null;
}

return (
<div>
<div className="monTableCell__splitNumber">
{ (formatNumber(value, 'int_commas') + ' ms avg') }
</div>
<div className="monTableCell__splitNumber">
{ formatNumber(kibana.response_times.max, 'int_commas') } ms max
</div>
</div>
);
}
}
];

return columns;
};

export class KibanaInstances extends PureComponent {
render() {
const {
instances,
clusterStatus,
angular,
setupMode,
sorting,
pagination,
onTableChange
} = this.props;

const dataFlattened = instances.map(item => ({
...item,
name: item.kibana.name,
status: item.kibana.status,
}));

return (
<EuiPage>
<EuiPageBody>
<EuiPanel>
<ClusterStatus stats={clusterStatus} />
</EuiPanel>
<EuiSpacer size="m" />
<EuiPageContent>
<EuiMonitoringTable
className="kibanaInstancesTable"
rows={dataFlattened}
columns={getColumns(angular.kbnUrl, angular.$scope)}
sorting={sorting}
pagination={pagination}
setupMode={setupMode}
uuidField="kibana.uuid"
nameField="name"
search={{
box: {
incremental: true,
placeholder: i18n.translate('xpack.monitoring.kibana.listing.filterInstancesPlaceholder', {
defaultMessage: 'Filter Instances…'
})
},
}}
onTableChange={onTableChange}
executeQueryOptions={{
defaultFields: ['name']
}}
/>
</EuiPageContent>
</EuiPageBody>
</EuiPage>
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

export const INSTRUCTION_STEP_SET_MONITORING_URL = 'setMonitoringUrl';
export const INSTRUCTION_STEP_ENABLE_METRICBEAT = 'enableMetricbeat';
export const INSTRUCTION_STEP_DISABLE_INTERNAL = 'disableInternal';
Loading