-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add telemetry for data tiers (#63031)
This commit adds telemetry for our data tier formalization. This telemetry helps determine the topology of the cluster with regard to the content, hot, warm, & cold tiers/roles. An example of the telemetry looks like: ``` GET /_xpack/usage?human { ... "data_tiers" : { "available" : true, "enabled" : true, "data_warm" : { ... }, "data_cold" : { ... }, "data_content" : { "node_count" : 1, "index_count" : 6, "total_shard_count" : 6, "primary_shard_count" : 6, "doc_count" : 71, "total_size" : "59.6kb", "total_size_bytes" : 61110, "primary_size" : "59.6kb", "primary_size_bytes" : 61110, "primary_shard_size_avg" : "9.9kb", "primary_shard_size_avg_bytes" : 10185, "primary_shard_size_median" : "8kb", "primary_shard_size_median_bytes" : 8254, "primary_shard_size_mad" : "7.2kb", "primary_shard_size_mad_bytes" : 7391 }, "data_hot" : { ... } } } ``` The fields are as follows: - node_count :: number of nodes with this tier/role - index_count :: number of indices on this tier - total_shard_count :: total number of shards for all nodes in this tier - primary_shard_count :: number of primary shards for all nodes in this tier - doc_count :: number of documents for all nodes in this tier - total_size_bytes :: total number of bytes for all shards for all nodes in this tier - primary_size_bytes :: number of bytes for all primary shards on all nodes in this tier - primary_shard_size_avg_bytes :: average shard size for primary shard in this tier - primary_shard_size_median_bytes :: median shard size for primary shard in this tier - primary_shard_size_mad_bytes :: [median absolute deviation](https://en.wikipedia.org/wiki/Median_absolute_deviation) of shard size for primary shard in this tier Relates to #60848
- Loading branch information
Showing
15 changed files
with
703 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
...Test/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierTelemetryPlugin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
package org.elasticsearch.xpack.cluster.routing.allocation; | ||
|
||
import org.elasticsearch.action.support.ActionFilters; | ||
import org.elasticsearch.action.support.TransportAction; | ||
import org.elasticsearch.client.node.NodeClient; | ||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; | ||
import org.elasticsearch.cluster.service.ClusterService; | ||
import org.elasticsearch.common.inject.Inject; | ||
import org.elasticsearch.common.settings.Settings; | ||
import org.elasticsearch.license.LicenseService; | ||
import org.elasticsearch.protocol.xpack.XPackInfoRequest; | ||
import org.elasticsearch.protocol.xpack.XPackInfoResponse; | ||
import org.elasticsearch.protocol.xpack.XPackUsageRequest; | ||
import org.elasticsearch.threadpool.ThreadPool; | ||
import org.elasticsearch.transport.TransportService; | ||
import org.elasticsearch.xpack.core.LocalStateCompositeXPackPlugin; | ||
import org.elasticsearch.xpack.core.action.TransportXPackInfoAction; | ||
import org.elasticsearch.xpack.core.action.TransportXPackUsageAction; | ||
import org.elasticsearch.xpack.core.action.XPackInfoFeatureAction; | ||
import org.elasticsearch.xpack.core.action.XPackUsageFeatureAction; | ||
import org.elasticsearch.xpack.core.action.XPackUsageResponse; | ||
|
||
import java.nio.file.Path; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
/** | ||
* This plugin extends {@link LocalStateCompositeXPackPlugin} to only make the data tier telemetry | ||
* available. This allows telemetry to be retrieved in integration tests where it would otherwise | ||
* throw errors trying to retrieve all of the different telemetry types. | ||
*/ | ||
public class DataTierTelemetryPlugin extends LocalStateCompositeXPackPlugin { | ||
|
||
public static class DataTiersTransportXPackUsageAction extends TransportXPackUsageAction { | ||
@Inject | ||
public DataTiersTransportXPackUsageAction(ThreadPool threadPool, TransportService transportService, | ||
ClusterService clusterService, ActionFilters actionFilters, | ||
IndexNameExpressionResolver indexNameExpressionResolver, NodeClient client) { | ||
super(threadPool, transportService, clusterService, actionFilters, indexNameExpressionResolver, client); | ||
} | ||
@Override | ||
protected List<XPackUsageFeatureAction> usageActions() { | ||
return Collections.singletonList(XPackUsageFeatureAction.DATA_TIERS); | ||
} | ||
} | ||
|
||
public static class DataTiersTransportXPackInfoAction extends TransportXPackInfoAction { | ||
@Inject | ||
public DataTiersTransportXPackInfoAction(TransportService transportService, ActionFilters actionFilters, | ||
LicenseService licenseService, NodeClient client) { | ||
super(transportService, actionFilters, licenseService, client); | ||
} | ||
|
||
@Override | ||
protected List<XPackInfoFeatureAction> infoActions() { | ||
return Collections.singletonList(XPackInfoFeatureAction.DATA_TIERS); | ||
} | ||
} | ||
|
||
public DataTierTelemetryPlugin(final Settings settings, final Path configPath) { | ||
super(settings, configPath); | ||
} | ||
|
||
@Override | ||
protected Class<? extends TransportAction<XPackUsageRequest, XPackUsageResponse>> getUsageAction() { | ||
return DataTiersTransportXPackUsageAction.class; | ||
} | ||
|
||
@Override | ||
protected Class<? extends TransportAction<XPackInfoRequest, XPackInfoResponse>> getInfoAction() { | ||
return DataTiersTransportXPackInfoAction.class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.