Skip to content

Commit

Permalink
Troubleshooting.
Browse files Browse the repository at this point in the history
Signed-off-by: AWSHurneyt <[email protected]>
  • Loading branch information
AWSHurneyt committed Oct 4, 2023
1 parent 7fceb54 commit 6406c5b
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,20 +121,23 @@ class InputService(
}
is ClusterMetricsInput -> {
logger.debug("ClusterMetricsInput clusterMetricType: ${input.clusterMetricType}")

logger.info("hurneyt ClusterMetricsInput::clustersAliases = ${input.clusters}")
if (input.clusters.isNotEmpty()) {
logger.info("hurneyt ClusterMetricsInput HAS REMOTE CLUSTERS")
client.threadPool().threadContext.stashContext().use {
scope.launch {
val responseMap = mutableMapOf<String, Map<String, Any>>()
input.clusters.forEach { cluster ->
logger.info("hurneyt ClusterMetricsInput::cluster = $cluster")
val targetClient = CrossClusterMonitorUtils.getClientForCluster(cluster, client, clusterService)
val response = executeTransportAction(input, targetClient)

// Not all supported API reference the cluster name in their response.
// Mapping each response to the cluster name.
results += mapOf(cluster to response.toMap())
// Mapping each response to the cluster name before adding to results.
// Not adding this same logic for local-only monitors to avoid breaking existing monitors.
responseMap[cluster] = response.toMap()
}
results += responseMap
}
}
} else {
Expand Down

0 comments on commit 6406c5b

Please sign in to comment.