[Optimize]健康检查日志优化(#869)

This commit is contained in:
fengqiongfeng
2023-02-09 19:09:39 +08:00
committed by EricZeng
parent e204023b1f
commit 98a5c7b776

View File

@@ -58,7 +58,7 @@ public class HealthCheckClusterService extends AbstractHealthCheckService {
Result<ClusterMetrics> clusterMetricsResult = clusterMetricService.getLatestMetricsFromES(param.getClusterPhyId(), Arrays.asList(ClusterMetricVersionItems.CLUSTER_METRIC_ACTIVE_CONTROLLER_COUNT)); Result<ClusterMetrics> clusterMetricsResult = clusterMetricService.getLatestMetricsFromES(param.getClusterPhyId(), Arrays.asList(ClusterMetricVersionItems.CLUSTER_METRIC_ACTIVE_CONTROLLER_COUNT));
if (clusterMetricsResult.failed() || !clusterMetricsResult.hasData()) { if (clusterMetricsResult.failed() || !clusterMetricsResult.hasData()) {
log.error("method=checkClusterNoController||param={}||config={}||result={}||errMsg=get metrics failed", log.error("method=checkClusterNoController||param={}||config={}||result={}||errMsg=get metrics from es failed",
param, valueConfig, clusterMetricsResult); param, valueConfig, clusterMetricsResult);
return null; return null;
} }
@@ -71,7 +71,11 @@ public class HealthCheckClusterService extends AbstractHealthCheckService {
); );
Float activeController = clusterMetricsResult.getData().getMetric(ClusterMetricVersionItems.CLUSTER_METRIC_ACTIVE_CONTROLLER_COUNT); Float activeController = clusterMetricsResult.getData().getMetric(ClusterMetricVersionItems.CLUSTER_METRIC_ACTIVE_CONTROLLER_COUNT);
if (activeController == null) {
log.error("method=checkClusterNoController||param={}||config={}||errMsg=get metrics from es failed, activeControllerCount is null",
param, valueConfig);
return null;
}
checkResult.setPassed(activeController.intValue() != valueConfig.getValue().intValue() ? 0: 1); checkResult.setPassed(activeController.intValue() != valueConfig.getValue().intValue() ? 0: 1);