Skip to content

Commit

Permalink
Kibana status more relevant (elastic#97071)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
2 people authored and madirey committed May 11, 2021
1 parent 4154d68 commit 8676d76
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ export function ElasticsearchPanel(props) {
</EuiDescriptionListTitle>
<EuiDescriptionListDescription>
<EuiHealth color={statusColorMap[clusterStats.status]} data-test-subj="statusIcon">
<HealthLabel status={clusterStats.status} />
<HealthLabel status={clusterStats.status} product={'es'} />
</EuiHealth>
</EuiDescriptionListDescription>
<EuiDescriptionListTitle className="eui-textBreakWord">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,32 @@ export function HealthLabel(props) {
});
}

if (props.status === 'yellow') {
return i18n.translate('xpack.monitoring.cluster.health.replicaShards', {
defaultMessage: 'Missing replica shards',
});
const { product, status } = props;
if (product === 'es') {
if (props.status === 'yellow') {
return i18n.translate('xpack.monitoring.cluster.health.replicaShards', {
defaultMessage: 'Missing replica shards',
});
}

if (props.status === 'red') {
return i18n.translate('xpack.monitoring.cluster.health.primaryShards', {
defaultMessage: 'Missing primary shards',
});
}
}

if (props.status === 'red') {
return i18n.translate('xpack.monitoring.cluster.health.primaryShards', {
defaultMessage: 'Missing primary shards',
});
if (product === 'kb' && status === 'red') {
return (
<EuiText>
{i18n.translate('xpack.monitoring.cluster.health.pluginIssues', {
defaultMessage: 'Some plugins are experiencing issues. Check ',
})}
<EuiLink href="/status" target="_blank" external={true}>
status
</EuiLink>
</EuiText>
);
}

return 'N/A';
Expand All @@ -55,7 +71,7 @@ export function HealthStatusIndicator(props) {
<EuiFlexGroup alignItems="center" gutterSize="s">
<EuiFlexItem grow={false}>
<EuiHealth color={statusColor} data-test-subj="statusIcon">
<HealthLabel status={props.status} />
<HealthLabel {...props} />
</EuiHealth>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function KibanaPanel(props) {
return null;
}

const statusIndicator = <HealthStatusIndicator status={props.status} />;
const statusIndicator = <HealthStatusIndicator status={props.status} product={'kb'} />;

const goToKibana = () => getSafeForExternalLink('#/kibana');
const goToInstances = () => getSafeForExternalLink('#/kibana/instances');
Expand Down

0 comments on commit 8676d76

Please sign in to comment.