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] Add mappings for standalone archives and fix tests #31315

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { CLUSTER_ALERTS_SEARCH_SIZE, STANDALONE_CLUSTER_CLUSTER_UUID } from '../
import { getApmsForClusters } from '../apm/get_apms_for_clusters';
import { i18n } from '@kbn/i18n';
import { checkCcrEnabled } from '../elasticsearch/ccr';
import { standaloneClusterDefinition, hasStandaloneClusters } from '../standalone_clusters';
import { getStandaloneClusterDefinition, hasStandaloneClusters } from '../standalone_clusters';

/**
* Get all clusters or the cluster associated with {@code clusterUuid} when it is defined.
Expand All @@ -41,7 +41,7 @@ export async function getClustersFromRequest(req, indexPatterns, { clusterUuid,
let clusters = [];

if (isStandaloneCluster) {
clusters.push(standaloneClusterDefinition);
clusters.push(getStandaloneClusterDefinition());
}
else {
// get clusters with stats and cluster state
Expand All @@ -56,7 +56,7 @@ export async function getClustersFromRequest(req, indexPatterns, { clusterUuid,
];

if (await hasStandaloneClusters(req, indexPatternsToCheckForNonClusters)) {
clusters.push(standaloneClusterDefinition);
clusters.push(getStandaloneClusterDefinition());
}
}

Expand Down Expand Up @@ -112,6 +112,7 @@ export async function getClustersFromRequest(req, indexPatterns, { clusterUuid,
}

// add kibana data

const kibanas = isStandaloneCluster ? [] : await getKibanasForClusters(req, kbnIndexPattern, clusters);
// add the kibana data to each cluster
kibanas.forEach(kibana => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
*/
import { STANDALONE_CLUSTER_CLUSTER_UUID } from '../../../common/constants';

export const standaloneClusterDefinition = {
cluster_uuid: STANDALONE_CLUSTER_CLUSTER_UUID,
license: {},
cluster_state: {},
cluster_stats: {
nodes: {
jvm: {},
count: {}
export const getStandaloneClusterDefinition = () => {
return {
cluster_uuid: STANDALONE_CLUSTER_CLUSTER_UUID,
license: {},
cluster_state: {},
cluster_stats: {
nodes: {
jvm: {},
count: {}
}
}
}
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
*/

export { hasStandaloneClusters } from './has_standalone_clusters';
export { standaloneClusterDefinition } from './standalone_cluster_definition';
export { getStandaloneClusterDefinition } from './get_standalone_cluster_definition';
export { standaloneClusterFilter } from './standalone_cluster_query_filter';
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"isSupported":true,"cluster_uuid":"__standalone_cluster__","license":{},"elasticsearch":{"cluster_stats":{"indices":{},"nodes":{"count":{},"jvm":{}}}},"logstash":{},"kibana":{"status":null,"requests_total":0,"concurrent_connections":0,"response_time_max":0,"memory_size":0,"memory_limit":0,"count":0},"beats":{"totalEvents":348,"bytesSent":319913,"beats":{"total":1,"types":[{"type":"Packetbeat","count":1}]}},"apm":{"totalEvents":0,"memRss":0,"memTotal":0,"apms":{"total":0}},"alerts":{"message":"Cluster Alerts are not displayed because the [production] cluster's license could not be determined."},"isPrimary":false}]
[{"cluster_uuid":"__standalone_cluster__","license":{},"elasticsearch":{"cluster_stats":{"indices":{},"nodes":{"count":{},"jvm":{}}}},"logstash":{},"kibana":{},"beats":{"totalEvents":348,"bytesSent":319913,"beats":{"total":1,"types":[{"type":"Packetbeat","count":1}]}},"apm":{"totalEvents":0,"memRss":0,"memTotal":0,"apms":{"total":0}},"alerts":{"message":"Cluster Alerts are not displayed because the [production] cluster's license could not be determined."},"isPrimary":false}]
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"type": "index",
"value": {
"index": ".monitoring-es-6-2019.02.04",
"settings": {
"index": {
"codec": "best_compression",
"format": "6",
"number_of_replicas": "1",
"number_of_shards": "1"
}
}
}
}

{
"type": "index",
"value": {
"index": ".monitoring-alerts-6",
"settings": {
"index": {
"codec": "best_compression",
"format": "6",
"number_of_replicas": "1",
"number_of_shards": "1"
}
}
}
}

{
"type": "index",
"value": {
"index": ".monitoring-kibana-6-2019.02.04",
"settings": {
"index": {
"codec": "best_compression",
"format": "6",
"number_of_replicas": "1",
"number_of_shards": "1"
}
}
}
}

{
"type": "index",
"value": {
"index": ".monitoring-beats-6-2019.02.04",
"settings": {
"index": {
"codec": "best_compression",
"format": "6",
"number_of_replicas": "1",
"number_of_shards": "1"
}
}
}
}