Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
4b343af
Support for logstash
chrisronline Jul 5, 2019
8d85b2b
Beats support
chrisronline Jul 5, 2019
9c0c2ee
Fix cherry-pick api issue
chrisronline Jul 22, 2019
142ac48
Support for logstash
chrisronline Jul 5, 2019
f15cd75
Updates for beats and logstash
chrisronline Jul 11, 2019
b5f928d
APM migration working
chrisronline Jul 15, 2019
8e0453e
Tweaks for beats migration
chrisronline Jul 15, 2019
164df37
Update copy for setup new button
chrisronline Jul 15, 2019
99d546b
If on cloud, disable setup mode
chrisronline Jul 15, 2019
16861c1
Handle new beat flow better
chrisronline Jul 18, 2019
911b3b1
Better phrasing for APM
chrisronline Jul 19, 2019
bc03b08
Add beat type to disable step
chrisronline Jul 22, 2019
94dcb34
Fix i18n issue
chrisronline Jul 22, 2019
e009eb3
Fix jest tests
chrisronline Jul 22, 2019
7ac0ad3
Fix api tests
chrisronline Jul 22, 2019
f3943a7
PR feedback
chrisronline Jul 23, 2019
35d48d4
Update copy
chrisronline Jul 23, 2019
de7792c
Merge remote-tracking branch 'elastic/master' into monitoring/mb_setu…
chrisronline Jul 23, 2019
0d47d3a
Remove unnecessary code
chrisronline Jul 23, 2019
d34ccc3
Undo changes that are now in a separate PR
chrisronline Jul 24, 2019
146a589
Disable more links
chrisronline Jul 24, 2019
5a735ec
Fix overview link for logstash
chrisronline Jul 25, 2019
7605f91
PR feedback
chrisronline Jul 26, 2019
aba082c
Merge remote-tracking branch 'elastic/master' into monitoring/mb_setu…
chrisronline Jul 26, 2019
a58514e
Fix tests
chrisronline Jul 26, 2019
ee42eb2
PR feedback
chrisronline Jul 26, 2019
85be013
Merge remote-tracking branch 'elastic/master' into monitoring/mb_setu…
chrisronline Jul 31, 2019
7b32f38
PR feedback
chrisronline Jul 31, 2019
016679b
Capitalize Beat per PR feedback
chrisronline Jul 31, 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
1 change: 1 addition & 0 deletions x-pack/legacy/plugins/monitoring/common/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ 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';
export const APM_CUSTOM_ID = 'apm';
/**
* 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 @@ -4,11 +4,11 @@
* you may not use this file except in compliance with the Elastic License.
*/

import React from 'react';
import React, { Fragment } from 'react';
import moment from 'moment';
import { uniq } from 'lodash';
import { uniq, get } from 'lodash';
import { EuiMonitoringTable } from '../../table';
import { EuiLink, EuiPage, EuiPageBody, EuiPageContent, EuiSpacer } from '@elastic/eui';
import { EuiLink, EuiPage, EuiPageBody, EuiPageContent, EuiSpacer, EuiCallOut } from '@elastic/eui';
import { Status } from './status';
import { formatMetric } from '../../../lib/format_number';
import { formatTimestampToDuration } from '../../../../common';
Expand Down Expand Up @@ -83,14 +83,37 @@ const columns = [
},
];

export function ApmServerInstances({ apms }) {
export function ApmServerInstances({ apms, setupMode }) {
const {
pagination,
sorting,
onTableChange,
data
data,
} = apms;

let detectedInstanceMessage = null;
if (setupMode.enabled && setupMode.data && get(setupMode.data, 'detected.mightExist')) {
detectedInstanceMessage = (
<Fragment>
<EuiCallOut
title={i18n.translate('xpack.monitoring.apm.instances.metricbeatMigration.detectedInstanceTitle', {
defaultMessage: 'APM server detected',
})}
color="warning"
iconType="help"
>
<p>
{i18n.translate('xpack.monitoring.apm.instances.metricbeatMigration.detectedInstanceDescription', {
defaultMessage: `Based on your indices, we think you might have an APM server. Click the 'Setup monitoring'
button below to start monitoring this APM server.`
})}
</p>
</EuiCallOut>
<EuiSpacer size="m"/>
</Fragment>
);
}

const versions = uniq(data.apms.map(item => item.version)).map(version => {
return { value: version };
});
Expand All @@ -101,12 +124,19 @@ export function ApmServerInstances({ apms }) {
<EuiPageContent>
<Status stats={data.stats} />
<EuiSpacer size="m"/>
{detectedInstanceMessage}
<EuiMonitoringTable
className="apmInstancesTable"
rows={data.apms}
columns={columns}
sorting={sorting}
pagination={pagination}
setupMode={setupMode}
uuidField="uuid"
nameField="name"
setupNewButtonLabel={i18n.translate('xpack.monitoring.apm.metricbeatMigration.setupNewButtonLabel', {
defaultMessage: 'Setup monitoring for new APM server'
})}
search={{
box: {
incremental: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* you may not use this file except in compliance with the Elastic License.
*/

import React, { PureComponent } from 'react';
import { uniq } from 'lodash';
import { EuiPage, EuiPageBody, EuiPageContent, EuiSpacer, EuiLink } from '@elastic/eui';
import React, { PureComponent, Fragment } from 'react';
import { uniq, get } from 'lodash';
import { EuiPage, EuiPageBody, EuiPageContent, EuiSpacer, EuiLink, EuiCallOut } from '@elastic/eui';
import { Stats } from 'plugins/monitoring/components/beats';
import { formatMetric } from 'plugins/monitoring/lib/format_number';
import { EuiMonitoringTable } from 'plugins/monitoring/components/table';
Expand Down Expand Up @@ -74,9 +74,32 @@ export class Listing extends PureComponent {
data,
sorting,
pagination,
onTableChange
onTableChange,
setupMode
} = this.props;

let detectedInstanceMessage = null;
if (setupMode.enabled && setupMode.data && get(setupMode.data, 'detected.mightExist')) {
detectedInstanceMessage = (
<Fragment>
<EuiCallOut
title={i18n.translate('xpack.monitoring.beats.instances.metricbeatMigration.detectedInstanceTitle', {
defaultMessage: 'Beats instance detected',
})}
color="warning"
iconType="help"
>
<p>
{i18n.translate('xpack.monitoring.beats.instances.metricbeatMigration.detectedInstanceDescription', {
defaultMessage: `Based on your indices, we think you might have a beats instance. Click the 'Setup monitoring'
button below to start monitoring this instance.`
})}
</p>
</EuiCallOut>
<EuiSpacer size="m"/>
</Fragment>
);
}

const types = uniq(data.map(item => item.type)).map(type => {
return { value: type };
Expand All @@ -92,9 +115,16 @@ export class Listing extends PureComponent {
<EuiPageContent>
<Stats stats={stats} />
<EuiSpacer size="m"/>
{detectedInstanceMessage}
<EuiMonitoringTable
className="beatsTable"
rows={data}
setupMode={setupMode}
uuidField="uuid"
nameField="name"
setupNewButtonLabel={i18n.translate('xpack.monitoring.beats.metricbeatMigration.setupNewButtonLabel', {
defaultMessage: 'Setup monitoring for new Beats instance'
})}
columns={this.getColumns()}
sorting={sorting}
pagination={pagination}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ import React from 'react';
import moment from 'moment';
import { get } from 'lodash';
import { formatMetric } from 'plugins/monitoring/lib/format_number';
import { ClusterItemContainer, BytesPercentageUsage } from './helpers';
import { ClusterItemContainer, BytesPercentageUsage, DisabledIfNoDataAndInSetupModeLink } from './helpers';
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';

import {
EuiFlexGrid,
EuiFlexItem,
Expand All @@ -22,18 +21,55 @@ import {
EuiDescriptionListTitle,
EuiDescriptionListDescription,
EuiHorizontalRule,
EuiFlexGroup,
EuiToolTip,
EuiBadge
} from '@elastic/eui';
import { formatTimestampToDuration } from '../../../../common';
import { CALCULATE_DURATION_SINCE } from '../../../../common/constants';

export function ApmPanel(props) {
if (!get(props, 'apms.total', 0) > 0) {
const { setupMode } = props;
const apmsTotal = get(props, 'apms.total') || 0;
// Do not show if we are not in setup mode
if (apmsTotal === 0 && !setupMode.enabled) {
return null;
}

const goToApm = () => props.changeUrl('apm');
const goToInstances = () => props.changeUrl('apm/instances');

const setupModeApmData = get(setupMode.data, 'apm');
let setupModeInstancesData = null;
if (setupMode.enabled && setupMode.data) {
const migratedNodesCount = Object.values(setupModeApmData.byUuid).filter(node => node.isFullyMigrated).length;
let totalNodesCount = Object.values(setupModeApmData.byUuid).length;
if (totalNodesCount === 0 && get(setupMode.data, 'apm.detected.mightExist', false)) {
totalNodesCount = 1;
}

const badgeColor = migratedNodesCount === totalNodesCount
? 'secondary'
: 'danger';

setupModeInstancesData = (
<EuiFlexItem grow={false}>
<EuiToolTip
position="top"
content={i18n.translate('xpack.monitoring.cluster.overview.apmPanel.setupModeNodesTooltip', {
defaultMessage: `These numbers indicate how many detected monitored APM servers versus how many ` +
`detected total APM servers. If there are more detected APM servers than monitored APM servers, click the Nodes ` +
`link and you will be guided in how to setup monitoring for the missing node.`
Comment thread
chrisronline marked this conversation as resolved.
})}
>
<EuiBadge color={badgeColor}>
{migratedNodesCount}/{totalNodesCount}
</EuiBadge>
</EuiToolTip>
</EuiFlexItem>
);
}

return (
<ClusterItemContainer
{...props}
Expand All @@ -47,7 +83,9 @@ export function ApmPanel(props) {
<EuiPanel paddingSize="m">
<EuiTitle size="s">
<h3>
<EuiLink
<DisabledIfNoDataAndInSetupModeLink
setupModeEnabled={setupMode.enabled}
setupModeData={setupModeApmData}
onClick={goToApm}
aria-label={i18n.translate('xpack.monitoring.cluster.overview.apmPanel.overviewLinkAriaLabel', {
defaultMessage: 'APM Overview'
Expand All @@ -58,7 +96,7 @@ export function ApmPanel(props) {
id="xpack.monitoring.cluster.overview.apmPanel.overviewLinkLabel"
defaultMessage="Overview"
/>
</EuiLink>
</DisabledIfNoDataAndInSetupModeLink>
</h3>
</EuiTitle>
<EuiHorizontalRule margin="m" />
Expand Down Expand Up @@ -90,27 +128,32 @@ export function ApmPanel(props) {
</EuiFlexItem>
<EuiFlexItem>
<EuiPanel paddingSize="m">
<EuiTitle size="s">
<h3>
<EuiLink
onClick={goToInstances}
aria-label={i18n.translate(
'xpack.monitoring.cluster.overview.apmPanel.instancesTotalLinkAriaLabel',
{
defaultMessage: 'Apm Instances: {apmsTotal}',
values: { apmsTotal: props.apms.total }
}
)}
data-test-subj="apmListing"
>
<FormattedMessage
id="xpack.monitoring.cluster.overview.apmPanel.serversTotalLinkLabel"
defaultMessage="APM Servers: {apmsTotal}"
values={{ apmsTotal: (<span data-test-subj="apmsTotal">{props.apms.total}</span>) }}
/>
</EuiLink>
</h3>
</EuiTitle>
<EuiFlexGroup justifyContent="spaceBetween">
<EuiFlexItem grow={false}>
<EuiTitle size="s">
<h3>
<EuiLink
onClick={goToInstances}
aria-label={i18n.translate(
'xpack.monitoring.cluster.overview.apmPanel.instancesTotalLinkAriaLabel',
{
defaultMessage: 'APM Instances: {apmsTotal}',
values: { apmsTotal }
}
)}
data-test-subj="apmListing"
>
<FormattedMessage
id="xpack.monitoring.cluster.overview.apmPanel.serversTotalLinkLabel"
defaultMessage="APM Servers: {apmsTotal}"
values={{ apmsTotal: (<span data-test-subj="apmsTotal">{apmsTotal}</span>) }}
/>
</EuiLink>
</h3>
</EuiTitle>
</EuiFlexItem>
{setupModeInstancesData}
</EuiFlexGroup>
<EuiHorizontalRule margin="m" />
<EuiDescriptionList type="column">
<EuiDescriptionListTitle>
Expand Down
Loading