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

[i18n] Translations for Monitoring: Logstash #24897

Merged
Show file tree
Hide file tree
Changes from all 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 @@ -16,6 +16,7 @@
"xpack.grokDebugger": "x-pack/plugins/grokdebugger",
"xpack.idxMgmt": "x-pack/plugins/index_management",
"xpack.licenseMgmt": "x-pack/plugins/license_management",
"xpack.monitoring": "x-pack/plugins/monitoring",
"xpack.rollupJobs": "x-pack/plugins/rollup",
"xpack.searchProfiler": "x-pack/plugins/searchprofiler",
"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 @@ -50,7 +50,11 @@ exports[`DetailDrawer component If vertices shows basic info and no stats for if
>
<div>
<p>
This is a conditional statement in your pipeline.
<FormattedMessage
defaultMessage="This is a conditional statement in your pipeline."
id="xpack.monitoring.logstash.pipeline.detailDrawer.conditionalStatementDescription"
values={Object {}}
/>
</p>
<EuiCodeBlock>
if ([type] == "apache_log") {
Expand All @@ -62,7 +66,11 @@ exports[`DetailDrawer component If vertices shows basic info and no stats for if
/>
</div>
<p>
There are currently no metrics to show for this if condition.
<FormattedMessage
defaultMessage="There are currently no metrics to show for this if condition."
id="xpack.monitoring.logstash.pipeline.detailDrawer.noMetricsForIfDescription"
values={Object {}}
/>
</p>
</EuiText>
</EuiFlyoutBody>
Expand Down Expand Up @@ -119,9 +127,15 @@ exports[`DetailDrawer component Plugin vertices Plugin does not have explicit ID
>
<div>
<p>
This
plugin
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
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:"
id="xpack.monitoring.logstash.pipeline.detailDrawer.specifyVertexIdDescription"
values={
Object {
"vertexType": "plugin",
}
}
/>
</p>
<EuiCodeBlock>

Expand All @@ -144,7 +158,11 @@ exports[`DetailDrawer component Plugin vertices Plugin does not have explicit ID
align="left"
textOnly={true}
>
Events Latency
<FormattedMessage
defaultMessage="Events Latency"
id="xpack.monitoring.logstash.pipeline.detailDrawer.eventsLatencyLabel"
values={Object {}}
/>
</EuiTableRowCell>
<EuiTableRowCell
align="left"
Expand Down Expand Up @@ -198,7 +216,11 @@ exports[`DetailDrawer component Plugin vertices Plugin does not have explicit ID
align="left"
textOnly={true}
>
Events Emitted Rate
<FormattedMessage
defaultMessage="Events Emitted Rate"
id="xpack.monitoring.logstash.pipeline.detailDrawer.eventsEmittedRateLabel"
values={Object {}}
/>
</EuiTableRowCell>
<EuiTableRowCell
align="left"
Expand Down Expand Up @@ -252,7 +274,11 @@ exports[`DetailDrawer component Plugin vertices Plugin does not have explicit ID
align="left"
textOnly={true}
>
Events Received
<FormattedMessage
defaultMessage="Events Received"
id="xpack.monitoring.logstash.pipeline.detailDrawer.eventsReceivedLabel"
values={Object {}}
/>
</EuiTableRowCell>
<EuiTableRowCell
align="left"
Expand Down Expand Up @@ -306,7 +332,11 @@ exports[`DetailDrawer component Plugin vertices Plugin does not have explicit ID
align="left"
textOnly={true}
>
Events Emitted
<FormattedMessage
defaultMessage="Events Emitted"
id="xpack.monitoring.logstash.pipeline.detailDrawer.eventsEmittedLabel"
values={Object {}}
/>
</EuiTableRowCell>
<EuiTableRowCell
align="left"
Expand Down Expand Up @@ -409,16 +439,21 @@ exports[`DetailDrawer component Plugin vertices Plugin has explicit ID shows bas
grow={true}
>
<p>
This
plugin
's ID is
<EuiBadge
color="default"
iconSide="left"
>
parse_apache_logline
</EuiBadge>
.
<FormattedMessage
defaultMessage="This {vertexType}'s ID is {vertexId}."
id="xpack.monitoring.logstash.pipeline.detailDrawer.vertexIdDescription"
values={
Object {
"vertexId": <EuiBadge
color="default"
iconSide="left"
>
parse_apache_logline
</EuiBadge>,
"vertexType": "plugin",
}
}
/>
</p>
<EuiTable
responsive={true}
Expand All @@ -431,7 +466,11 @@ exports[`DetailDrawer component Plugin vertices Plugin has explicit ID shows bas
align="left"
textOnly={true}
>
Events Latency
<FormattedMessage
defaultMessage="Events Latency"
id="xpack.monitoring.logstash.pipeline.detailDrawer.eventsLatencyLabel"
values={Object {}}
/>
</EuiTableRowCell>
<EuiTableRowCell
align="left"
Expand Down Expand Up @@ -485,7 +524,11 @@ exports[`DetailDrawer component Plugin vertices Plugin has explicit ID shows bas
align="left"
textOnly={true}
>
Events Emitted Rate
<FormattedMessage
defaultMessage="Events Emitted Rate"
id="xpack.monitoring.logstash.pipeline.detailDrawer.eventsEmittedRateLabel"
values={Object {}}
/>
</EuiTableRowCell>
<EuiTableRowCell
align="left"
Expand Down Expand Up @@ -539,7 +582,11 @@ exports[`DetailDrawer component Plugin vertices Plugin has explicit ID shows bas
align="left"
textOnly={true}
>
Events Received
<FormattedMessage
defaultMessage="Events Received"
id="xpack.monitoring.logstash.pipeline.detailDrawer.eventsReceivedLabel"
values={Object {}}
/>
</EuiTableRowCell>
<EuiTableRowCell
align="left"
Expand Down Expand Up @@ -593,7 +640,11 @@ exports[`DetailDrawer component Plugin vertices Plugin has explicit ID shows bas
align="left"
textOnly={true}
>
Events Emitted
<FormattedMessage
defaultMessage="Events Emitted"
id="xpack.monitoring.logstash.pipeline.detailDrawer.eventsEmittedLabel"
values={Object {}}
/>
</EuiTableRowCell>
<EuiTableRowCell
align="left"
Expand Down Expand Up @@ -696,10 +747,18 @@ exports[`DetailDrawer component Queue vertices shows basic info and no stats for
grow={true}
>
<p>
This is an internal structure used by Logstash to buffer events between inputs and the rest of the pipeline.
<FormattedMessage
defaultMessage="This is an internal structure used by Logstash to buffer events between inputs and the rest of the pipeline."
id="xpack.monitoring.logstash.pipeline.detailDrawer.structureDescription"
values={Object {}}
/>
</p>
<p>
There are currently no metrics to show for the queue.
<FormattedMessage
defaultMessage="There are currently no metrics to show for the queue."
id="xpack.monitoring.logstash.pipeline.detailDrawer.noMetricsForQueueDescription"
values={Object {}}
/>
</p>
</EuiText>
</EuiFlyoutBody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ exports[`Queue component renders default elements 1`] = `
className="monPipelineViewer__queueMessage"
grow={true}
>
Queue metrics not available
<FormattedMessage
defaultMessage="Queue metrics not available"
id="xpack.monitoring.logstash.pipeline.queue.noMetricsDescription"
values={Object {}}
/>
</EuiText>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ exports[`Statement component renders a PluginStatement component for plugin mode
<div
className="monPipelineViewer__spaceContainer"
/>
<PluginStatement
<InjectIntl(PluginStatementUi)
onShowVertexDetails={[MockFunction]}
statement={
PluginStatement {
Expand Down
Loading