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

[Monitoring] Use the cluster name from metadata if it exists #24495

Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Array [
"totalEvents": null,
},
"ccs": "proddy1",
"cluster_name": "proddy1",
"cluster_name": "Custom name",
"cluster_uuid": "fOt6KT9KTICAMm2ncRhsMg",
"elasticsearch": Object {
"cluster_stats": Object {
Expand Down Expand Up @@ -227,7 +227,7 @@ Array [
"totalEvents": null,
},
"ccs": "proddy1",
"cluster_name": "proddy1",
"cluster_name": "Custom name",
"cluster_uuid": "fOt6KT9KTICAMm2ncRhsMg",
"elasticsearch": Object {
"cluster_stats": Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,13 @@
}
}
},
"cluster_settings": {
"cluster": {
"metadata": {
"display_name": "Custom name"
}
}
},
"isSupported": true,
"alerts": {
"alertsMeta": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ function fetchClusterStats(req, esIndexPattern, clusterUuid) {
'hits.hits._source.license.expiry_date',
'hits.hits._source.license.expiry_date_in_millis',
'hits.hits._source.cluster_stats',
'hits.hits._source.cluster_state'
'hits.hits._source.cluster_state',
'hits.hits._source.cluster_settings'
Copy link
Member

Choose a reason for hiding this comment

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

This could become hits.hits._source.cluster_settings.cluster.metadata.display_name until we have a need to show metadata somewhere.

On the other hand, it may prove worthwhile to include the metadata on the cluster overview screen as a way to help users see their metadata in a separate PR.

],
body: {
query: createQuery({ type: 'cluster_stats', start, end, metric, clusterUuid }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { pick, omit } from 'lodash';
import { pick, omit, get } from 'lodash';
import { calculateOverallStatus } from '../calculate_overall_status';

export function getClustersSummary(clusters, kibanaUuid) {
return clusters.map(cluster => {
const {
isSupported,
cluster_uuid: clusterUuid,
cluster_name: clusterName,
version,
license,
cluster_stats: clusterStats,
Expand All @@ -22,9 +21,12 @@ export function getClustersSummary(clusters, kibanaUuid) {
beats,
apm,
alerts,
ccs
ccs,
cluster_settings: clusterSettings
} = cluster;

const clusterName = get(clusterSettings, 'cluster.metadata.display_name', cluster.cluster_name);

const {
status: licenseStatus,
type: licenseType,
Expand Down