Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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 .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"tileMap": "src/core_plugins/tile_map",
"tagCloud": "src/core_plugins/tagcloud",
"xpack.idxMgmt": "x-pack/plugins/index_management",
"xpack.monitoring": "x-pack/plugins/monitoring",
"xpack.watcher": "x-pack/plugins/watcher",
"xpack.security": "x-pack/plugins/security"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
import React from 'react';
import { SummaryStatus } from '../../summary_status';
import { formatMetric } from '../../../lib/format_number';
import { injectI18n } from '@kbn/i18n/react';

export function ClusterStatus({ stats }) {
function ClusterStatusUi({ stats, intl }) {
const {
node_count: nodeCount,
avg_memory_used: avgMemoryUsed,
Expand All @@ -19,22 +20,30 @@ export function ClusterStatus({ stats }) {

const metrics = [
{
label: 'Nodes',
label: intl.formatMessage({
id: 'xpack.monitoring.logstash.clusterStatus.nodesLabel', defaultMessage: 'Nodes'
}),
value: nodeCount,
dataTestSubj: 'node_count'
},
{
label: 'Memory',
label: intl.formatMessage({
id: 'xpack.monitoring.logstash.clusterStatus.memoryLabel', defaultMessage: 'Memory'
}),
value: formatMetric(avgMemoryUsed, 'byte') + ' / ' + formatMetric(avgMemory, 'byte'),
dataTestSubj: 'memory_used'
},
{
label: 'Events Received',
label: intl.formatMessage({
id: 'xpack.monitoring.logstash.clusterStatus.eventsReceivedLabel', defaultMessage: 'Events Received'
}),
value: formatMetric(eventsInTotal, '0.[0]a'),
dataTestSubj: 'events_in_total'
},
{
label: 'Events Emitted',
label: intl.formatMessage({
id: 'xpack.monitoring.logstash.clusterStatus.eventsEmittedLabel', defaultMessage: 'Events Emitted'
}),
value: formatMetric(eventsOutTotal, '0.[0]a'),
dataTestSubj: 'events_out_total'
}
Expand All @@ -47,3 +56,5 @@ export function ClusterStatus({ stats }) {
/>
);
}

export const ClusterStatus = injectI18n(ClusterStatusUi);
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
import React from 'react';
import { SummaryStatus } from '../../summary_status';
import { formatMetric } from '../../../lib/format_number';
import { injectI18n } from '@kbn/i18n/react';

export function DetailStatus({ stats }) {
function DetailStatusUi({ stats, intl }) {
const {
http_address: httpAddress,
events,
Expand All @@ -25,40 +26,54 @@ export function DetailStatus({ stats }) {
dataTestSubj: 'httpAddress'
},
{
label: 'Events Received',
label: intl.formatMessage({
id: 'xpack.monitoring.logstash.detailStatus.eventsReceivedLabel', defaultMessage: 'Events Received'
}),
value: formatMetric(events.in, '0.[0]a'),
dataTestSubj: 'eventsIn'
},
{
label: 'Events Emitted',
label: intl.formatMessage({
id: 'xpack.monitoring.logstash.detailStatus.eventsEmittedLabel', defaultMessage: 'Events Emitted'
}),
value: formatMetric(events.out, '0.[0]a'),
dataTestSubj: 'eventsOut'
},
{
label: 'Config Reloads',
label: intl.formatMessage({
id: 'xpack.monitoring.logstash.detailStatus.configReloadsLabel', defaultMessage: 'Config Reloads'
}),
value: reloads.successes,
dataTestSubj: 'numReloads'
},
{
label: 'Pipeline Workers',
label: intl.formatMessage({
id: 'xpack.monitoring.logstash.detailStatus.pipelineWorkersLabel', defaultMessage: 'Pipeline Workers'
}),
value: pipeline.workers,
dataTestSubj: 'pipelineWorkers'
},
{
label: 'Batch Size',
label: intl.formatMessage({
id: 'xpack.monitoring.logstash.detailStatus.batchSizeLabel', defaultMessage: 'Batch Size'
}),
value: pipeline.batch_size,
dataTestSubj: 'pipelineBatchSize'
}
];

const lastMetrics = [
{
label: 'Version',
label: intl.formatMessage({
id: 'xpack.monitoring.logstash.detailStatus.versionLabel', defaultMessage: 'Version'
}),
value: version,
dataTestSubj: 'version'
},
{
label: 'Uptime',
label: intl.formatMessage({
id: 'xpack.monitoring.logstash.detailStatus.uptimeLabel', defaultMessage: 'Uptime'
}),
value: formatMetric(uptime, 'time_since'),
dataTestSubj: 'uptime'
}
Expand All @@ -68,7 +83,9 @@ export function DetailStatus({ stats }) {
const metrics = [...firstMetrics];
if (queueType) {
metrics.push({
label: 'Queue Type',
label: intl.formatMessage({
id: 'xpack.monitoring.logstash.detailStatus.queueTypeLabel', defaultMessage: 'Queue Type'
}),
value: queueType,
dataTestSubj: 'queueType'
});
Expand All @@ -82,3 +99,5 @@ export function DetailStatus({ stats }) {
/>
);
}

export const DetailStatus = injectI18n(DetailStatusUi);
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
} from '@elastic/eui';
import { Sparkline } from '../../../sparkline';
import { formatMetric } from '../../../../lib/format_number';
import { FormattedMessage } from '@kbn/i18n/react';

function renderIcon(vertex) {
return (
Expand All @@ -46,7 +47,12 @@ function renderPluginBasicStats(vertex, timeseriesTooltipXValueFormatter) {
? null
: (
<EuiTableRow key="events_latency">
<EuiTableRowCell>Events Latency</EuiTableRowCell>
<EuiTableRowCell>
<FormattedMessage
id="xpack.monitoring.logstash.pipeline.detailDrawer.eventsLatencyLabel"
defaultMessage="Events Latency"
/>
</EuiTableRowCell>
<EuiTableRowCell>
<div className="lspvDetailDrawerSparklineContainer">
<Sparkline
Expand All @@ -69,7 +75,12 @@ function renderPluginBasicStats(vertex, timeseriesTooltipXValueFormatter) {
const eventsOutRateValueFormatter = (value) => formatMetric(value, '0.[0]a', 'e/s');
const eventsOutRateRow = (
<EuiTableRow key="events_out_rate">
<EuiTableRowCell>Events Emitted Rate</EuiTableRowCell>
<EuiTableRowCell>
<FormattedMessage
id="xpack.monitoring.logstash.pipeline.detailDrawer.eventsEmittedRateLabel"
defaultMessage="Events Emitted Rate"
/>
</EuiTableRowCell>
<EuiTableRowCell>
<div className="lspvDetailDrawerSparklineContainer">
<Sparkline
Expand Down Expand Up @@ -99,7 +110,12 @@ function renderPluginBasicStats(vertex, timeseriesTooltipXValueFormatter) {
? null
: (
<EuiTableRow key="events_in">
<EuiTableRowCell>Events Received</EuiTableRowCell>
<EuiTableRowCell>
<FormattedMessage
id="xpack.monitoring.logstash.pipeline.detailDrawer.eventsReceivedRateLabel"
defaultMessage="Events Received"
/>
</EuiTableRowCell>
<EuiTableRowCell>
<div className="lspvDetailDrawerSparklineContainer">
<Sparkline
Expand All @@ -126,7 +142,12 @@ function renderPluginBasicStats(vertex, timeseriesTooltipXValueFormatter) {
: null;
const eventsOutRow = (
<EuiTableRow key="events_out">
<EuiTableRowCell>Events Emitted</EuiTableRowCell>
<EuiTableRowCell>
<FormattedMessage
id="xpack.monitoring.logstash.pipeline.detailDrawer.eventsEmittedLabel"
defaultMessage="Events Emitted"
/>
</EuiTableRowCell>
<EuiTableRowCell>
<div className="lspvDetailDrawerSparklineContainer">
<Sparkline
Expand Down Expand Up @@ -160,13 +181,23 @@ function renderPluginBasicStats(vertex, timeseriesTooltipXValueFormatter) {

function renderIfBasicStats(_vertex) {
return (
<p>There are currently no metrics to show for this if condition.</p>
<p>
<FormattedMessage
id="xpack.monitoring.logstash.pipeline.detailDrawer.noMetricsForIfDescription"
defaultMessage="There are currently no metrics to show for this if condition."
/>
</p>
);
}

function renderQueueBasicStats(_vertex) {
return (
<p>There are currently no metrics to show for the queue.</p>
<p>
<FormattedMessage
id="xpack.monitoring.logstash.pipeline.detailDrawer.noMetricsForQueueDescription"
defaultMessage="There are currently no metrics to show for the queue."
/>
</p>
);
}

Expand All @@ -187,15 +218,25 @@ function renderBasicStats(vertex, timeseriesTooltipXValueFormatter) {
function renderPluginBasicInfo(vertex) {
if (vertex.hasExplicitId) {
return (
<p>This {vertex.typeString}&#39;s ID is <EuiBadge>{ vertex.id }</EuiBadge>.</p>
<p>
<FormattedMessage
id="xpack.monitoring.logstash.pipeline.detailDrawer.vertexIdDescription"
defaultMessage="This {vertexType}&#39;s ID is {vertexId}."
values={{ vertexType: vertex.typeString, vertexId: (<EuiBadge>{ vertex.id }</EuiBadge>) }}
/>
</p>
);
}

return (
<div>
<p>
This {vertex.typeString} does not have an ID explicitly specified. Specifying an ID allows you to track differences
across pipeline changes. You can explicitly specify an ID for this plugin like so:
<FormattedMessage
id="xpack.monitoring.logstash.pipeline.detailDrawer.specifyVertexIdDescription"
defaultMessage="This {vertexType} does not have an ID explicitly specified. Specifying an ID allows you to track differences
across pipeline changes. You can explicitly specify an ID for this plugin like so:"
values={{ vertexType: vertex.typeString }}
/>
</p>
<EuiCodeBlock>
{vertex.name} {`{
Expand All @@ -215,7 +256,10 @@ function renderIfBasicInfo(vertex) {
return (
<div>
<p>
This is a conditional statement in your pipeline.
<FormattedMessage
id="xpack.monitoring.logstash.pipeline.detailDrawer.conditionalStatementDescription"
defaultMessage="This is a conditional statement in your pipeline."
/>
</p>
<EuiCodeBlock>{ ifCode }</EuiCodeBlock>
<EuiSpacer />
Expand All @@ -226,8 +270,11 @@ function renderIfBasicInfo(vertex) {
function renderQueueBasicInfo(_vertex) {
return (
<p>
This is an internal structure used by Logstash to buffer events between
inputs and the rest of the pipeline.
<FormattedMessage
id="xpack.monitoring.logstash.pipeline.detailDrawer.structureDescription"
defaultMessage="This is an internal structure used by Logstash to buffer events between
inputs and the rest of the pipeline."
/>
</p>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ import PropTypes from 'prop-types';
import { DetailDrawer } from './detail_drawer';
import { Queue } from './queue';
import { StatementSection } from './statement_section';
import { injectI18n } from '@kbn/i18n/react';
import {
EuiSpacer,
EuiPage,
EuiPageContent,
EuiPageBody,
} from '@elastic/eui';

export class PipelineViewer extends React.Component {
class PipelineViewerUi extends React.Component {
constructor() {
super();
this.state = {
Expand Down Expand Up @@ -68,14 +69,15 @@ export class PipelineViewer extends React.Component {
outputs,
queue
} = this.props.pipeline;
const { intl } = this.props;

return (
<EuiPage>
<EuiPageBody>
<EuiPageContent verticalPosition="center" horizontalPosition="center" className="monPipelineViewer">
<StatementSection
iconType="logstashInput"
headingText="Inputs"
headingText={intl.formatMessage({ id: 'xpack.monitoring.logstash.pipelineViewer.inputsTitle', defaultMessage: 'Inputs' })}
elements={inputs}
onShowVertexDetails={this.onShowVertexDetails}
detailVertex={this.state.detailDrawer.vertex}
Expand All @@ -85,15 +87,15 @@ export class PipelineViewer extends React.Component {
<EuiSpacer />
<StatementSection
iconType="logstashFilter"
headingText="Filters"
headingText={intl.formatMessage({ id: 'xpack.monitoring.logstash.pipelineViewer.filtersTitle', defaultMessage: 'Filters' })}
elements={filters}
onShowVertexDetails={this.onShowVertexDetails}
detailVertex={this.state.detailDrawer.vertex}
/>
<EuiSpacer />
<StatementSection
iconType="logstashOutput"
headingText="Outputs"
headingText={intl.formatMessage({ id: 'xpack.monitoring.logstash.pipelineViewer.outputsTitle', defaultMessage: 'Outputs' })}
elements={outputs}
onShowVertexDetails={this.onShowVertexDetails}
detailVertex={this.state.detailDrawer.vertex}
Expand All @@ -106,11 +108,13 @@ export class PipelineViewer extends React.Component {
}
}

PipelineViewer.propTypes = {
PipelineViewerUi.propTypes = {
pipeline: PropTypes.shape({
inputs: PropTypes.array.isRequired,
filters: PropTypes.array.isRequired,
outputs: PropTypes.array.isRequired,
queue: PropTypes.object.isRequired,
}).isRequired
};

export const PipelineViewer = injectI18n(PipelineViewerUi);
Loading