From 6a13cf08dd00cdf2b911b992759157a6a2c14d44 Mon Sep 17 00:00:00 2001 From: catdrink <2738035238@qq.com> Date: Wed, 25 Dec 2024 15:02:40 +0800 Subject: [PATCH] fix retrieve data api and data model --- .../controller/MonitoringController.java | 25 +- .../manager/server/proxy/BigtopProxy.java | 92 ------ .../manager/server/proxy/PrometheusProxy.java | 262 ++++++++---------- .../server/service/MonitoringService.java | 6 +- .../service/impl/MonitoringServiceImpl.java | 11 +- .../src/main/resources/application.yml | 1 - 6 files changed, 123 insertions(+), 274 deletions(-) delete mode 100644 bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/proxy/BigtopProxy.java diff --git a/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/controller/MonitoringController.java b/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/controller/MonitoringController.java index c5a9752f..73bcd8c2 100644 --- a/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/controller/MonitoringController.java +++ b/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/controller/MonitoringController.java @@ -22,6 +22,7 @@ import org.apache.bigtop.manager.server.utils.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -46,23 +47,17 @@ public ResponseEntity agentHostsHealthyStatus() { return ResponseEntity.success(monitoringService.queryAgentsHealthyStatus()); } - @Operation(summary = "staticAgentInfo", description = "agent static info query") - @GetMapping("staticAgentInfo") - public ResponseEntity queryAgentsInfo() { - return ResponseEntity.success(monitoringService.queryAgentsInfo()); + @Operation(summary = "host info", description = "host info query") + @GetMapping("host/{id}") + public ResponseEntity queryAgentInfo( + @RequestParam(value = "step", defaultValue = "1") String step, @PathVariable String id) { + return ResponseEntity.success(monitoringService.queryAgentInfo(Long.valueOf(id), step)); } - @Operation(summary = "dynamicAgentInfo", description = "agent dynamic info query") - @GetMapping("dynamicAgentInfo") - public ResponseEntity queryAgentsInfo(@RequestParam(value = "step", defaultValue = "1") String step) { - return ResponseEntity.success(monitoringService.queryAgentsInfo(step)); - } - - @Operation(summary = "cluster info", description = "cluster multi info") - @GetMapping("clusterInfo") + @Operation(summary = "cluster info", description = "cluster info query") + @GetMapping("cluster/{id}") public ResponseEntity queryCluster( - @RequestParam(value = "clusterId") String clusterId, - @RequestParam(value = "step", defaultValue = "1") String step) { - return ResponseEntity.success(monitoringService.queryClusterInfo(clusterId, step)); + @RequestParam(value = "step", defaultValue = "1") String step, @PathVariable String id) { + return ResponseEntity.success(monitoringService.queryClusterInfo(Long.valueOf(id), step)); } } diff --git a/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/proxy/BigtopProxy.java b/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/proxy/BigtopProxy.java deleted file mode 100644 index 9e010991..00000000 --- a/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/proxy/BigtopProxy.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.bigtop.manager.server.proxy; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.MediaType; -import org.springframework.stereotype.Component; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; -import org.springframework.web.reactive.function.BodyInserters; -import org.springframework.web.reactive.function.client.WebClient; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import reactor.core.publisher.Mono; - -@Component -public class BigtopProxy { - - private final WebClient webClient; - - public BigtopProxy(WebClient.Builder webClientBuilder, @Value("${monitoring.bigtop-host}") String bigTopHost) { - this.webClient = webClientBuilder.baseUrl(bigTopHost).build(); - } - - private MultiValueMap createFormData(Integer pageNum) { - MultiValueMap formData = new LinkedMultiValueMap<>(); - formData.add("pageNum", String.valueOf(pageNum)); - formData.add("pageSize", "20"); - formData.add("orderBy", "id"); - formData.add("sort", "asc"); - return formData; - } - - public JsonNode queryHosts(int pageNum) { - Mono body = webClient - .post() - .uri(uriBuilder -> uriBuilder.path("/api/hosts").build()) - .contentType(MediaType.APPLICATION_FORM_URLENCODED) - .body(BodyInserters.fromFormData(createFormData(pageNum))) - .retrieve() - .bodyToMono(JsonNode.class); - JsonNode result = body.block(); - if (result == null || result.isEmpty() || !(result.get("failed").asBoolean())) { - return null; - } - return result; - } - - public JsonNode queryClusterAgents(String clusterId) { - ObjectMapper objectMapper = new ObjectMapper(); - // query cluster name - Mono body = - webClient.get().uri("/api/clusters/{id}", clusterId).retrieve().bodyToMono(JsonNode.class); - JsonNode result = body.block(); - if (result == null || result.isEmpty() || !(result.get("failed").asBoolean())) return null; - String clusterName = result.get("data").get("name").asText(); - ObjectNode clusterAgents = objectMapper.createObjectNode(); - ArrayNode arrayNode = objectMapper.createArrayNode(); - int pageNum = 1; - while (true) { - JsonNode agentsPage = queryHosts(pageNum++); - if (agentsPage == null) break; - JsonNode agentsContent = agentsPage.get("data").get("content"); - agentsContent.forEach(agent -> { - if (agent.get("clusterName").asText().equals(clusterName)) - arrayNode.add(agent.get("ipv4").asText()); - }); - } - clusterAgents.put("agentsNum", arrayNode.size()); - clusterAgents.set("agents", arrayNode); - return clusterAgents; - } -} diff --git a/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/proxy/PrometheusProxy.java b/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/proxy/PrometheusProxy.java index f8ae4a7b..ca33f849 100644 --- a/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/proxy/PrometheusProxy.java +++ b/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/proxy/PrometheusProxy.java @@ -18,6 +18,10 @@ */ package org.apache.bigtop.manager.server.proxy; +import org.apache.bigtop.manager.dao.query.HostQuery; +import org.apache.bigtop.manager.server.model.vo.HostVO; +import org.apache.bigtop.manager.server.model.vo.PageVO; +import org.apache.bigtop.manager.server.service.HostService; import org.apache.bigtop.manager.server.utils.ProxyUtils; import org.springframework.beans.factory.annotation.Value; @@ -37,18 +41,14 @@ import java.time.LocalDateTime; import java.time.ZoneId; import java.util.ArrayList; -import java.util.HashSet; +import java.util.List; import java.util.Objects; -import java.util.Set; @Component public class PrometheusProxy { private final WebClient webClient; - @Resource - private BigtopProxy bigtopProxy; - @Value("${monitoring.agent-host-job-name}") private String agentHostJobName; @@ -66,6 +66,9 @@ public class PrometheusProxy { public static final String DISK_READ = "diskRead"; public static final String DISK_WRITE = "diskWrite"; + @Resource + private HostService hostService; + public PrometheusProxy( WebClient.Builder webClientBuilder, @Value("${monitoring.prometheus-host}") String prometheusHost) { this.webClient = webClientBuilder.baseUrl(prometheusHost).build(); @@ -139,159 +142,108 @@ public JsonNode queryAgentsHealthyStatus() { } return objectMapper.createObjectNode(); } - /** - * query agents ipv4 list + * query agents info */ - private JsonNode queryAgents() { - JsonNode result = query("agent_host_monitoring_cpu"); + public JsonNode queryAgentsInfo(Long id, String step) { ObjectMapper objectMapper = new ObjectMapper(); - if (result != null) { - JsonNode agentCpus = result.get("data").get("result"); - if (agentCpus.isArray() && !agentCpus.isEmpty()) { - Set iPv4addrSet = new HashSet<>(); - for (JsonNode agent : agentCpus) { - iPv4addrSet.add(agent.get("metric").get("iPv4addr").asText()); - } - ArrayNode iPv4addrArray = objectMapper.createArrayNode(); - for (String value : iPv4addrSet.toArray(new String[0])) { - iPv4addrArray.add(value); - } - ObjectNode node = objectMapper.createObjectNode(); - node.put("agentsNum", iPv4addrArray.size()); - node.set("iPv4addr", iPv4addrArray); - return node; - } - } - return objectMapper.createObjectNode(); - } + String agentIpv4 = hostService.get(id).getIpv4(); + if (!Objects.equals(agentIpv4, "")) { + ObjectNode ag = objectMapper.createObjectNode(); + double[] agentsCpuUsage = new double[6]; + double[] agentsCpuLoad1 = new double[6]; + double[] agentsCpuLoad2 = new double[6]; + double[] agentsCpuLoad3 = new double[6]; + long[] agentMemIdle = new long[6]; + long[] agentMemTotal = new long[6]; + long[] agentDiskRead = new long[6]; + long[] agentDiskWrite = new long[6]; + + // real-time cpuUsage + JsonNode agentCpu = retrieveAgentCpu(agentIpv4); + // real-time mem + JsonNode agentMem = retrieveAgentMemory(agentIpv4); + // real-time disk + JsonNode agentDisk = queryAgentDisk(agentIpv4); + // real-time diskIO + JsonNode agentDiskIO = queryAgentDiskIO(agentIpv4); + // dynamic + JsonNode agentCpuInterval = retrieveAgentCpu(agentIpv4, step); + JsonNode agentMemInterval = retrieveAgentMemory(agentIpv4, step); + JsonNode agentDiskIOInterval = queryAgentDiskIO(agentIpv4, step); + + // data process + for (int i = 0; i < 6; i++) { + // CPU + agentsCpuUsage[i] = ProxyUtils.getDoubleSafely(agentCpuInterval, CPU_USAGE, i); + agentsCpuLoad1[i] = ProxyUtils.getDoubleSafely(agentCpuInterval, CPU_LOAD_AVG_MIN_1, i); + agentsCpuLoad2[i] = ProxyUtils.getDoubleSafely(agentCpuInterval, CPU_LOAD_AVG_MIN_5, i); + agentsCpuLoad3[i] = ProxyUtils.getDoubleSafely(agentCpuInterval, CPU_LOAD_AVG_MIN_15, i); - /** - * query agents static info - */ - public JsonNode queryAgentsInfo() { - JsonNode agents = queryAgents(); - ObjectMapper objectMapper = new ObjectMapper(); - if (agents != null && !agents.isEmpty()) { - JsonNode agentsIpv4 = agents.get("iPv4addr"); - ArrayNode agentsInfo = objectMapper.createArrayNode(); - for (JsonNode agentIpv4 : agentsIpv4) { - JsonNode cpuResult = retrieveAgentCpu(agentIpv4.asText()); - JsonNode memResult = retrieveAgentMemory(agentIpv4.asText()); - JsonNode diskResult = queryAgentDisk(agentIpv4.asText()); - ObjectNode temp = objectMapper.createObjectNode(); - // HOST - temp.put("hostname", cpuResult.get("hostname").asText()); - temp.put("iPv4addr", cpuResult.get("iPv4addr").asText()); - temp.put("cpuInfo", cpuResult.get("cpuInfo").asText().strip()); - // temp.put("iPv6addr", cpuResult.get("iPv6addr").asText()); - temp.put("os", cpuResult.get("os").asText()); - temp.put("architecture", cpuResult.get("architecture").asText()); - temp.put(PHYSICAL_CORES, cpuResult.get(PHYSICAL_CORES).asText()); // MEM - temp.put(MEM_TOTAL, memResult.get(MEM_TOTAL).asLong()); - // DISK - temp.set(DISK_TOTAL, diskResult.get(DISK_TOTAL)); - agentsInfo.add(temp); - } - return agentsInfo; - } - return objectMapper.createObjectNode(); - } + agentMemIdle[i] = ProxyUtils.getLongSafely(agentMemInterval, MEM_IDLE, i); + agentMemTotal[i] = ProxyUtils.getLongSafely(agentMemInterval, MEM_TOTAL, i); - /** - * query agents dynamic info - */ - public JsonNode queryAgentsInfo(String step) { - JsonNode agents = queryAgents(); - ObjectMapper objectMapper = new ObjectMapper(); - if (agents != null && !agents.isEmpty()) { - JsonNode agentsIpv4 = agents.get("iPv4addr"); - ArrayNode agentsInfo = objectMapper.createArrayNode(); - for (JsonNode agentIpv4 : agentsIpv4) { - ObjectNode ag = objectMapper.createObjectNode(); - double[] agentsCpuUsage = new double[6]; - double[] agentsCpuLoad1 = new double[6]; - double[] agentsCpuLoad2 = new double[6]; - double[] agentsCpuLoad3 = new double[6]; - long[] agentMemIdle = new long[6]; - long[] agentMemTotal = new long[6]; - long[] agentDiskRead = new long[6]; - long[] agentDiskWrite = new long[6]; - // real-time cpuUsage - JsonNode agentCpu = retrieveAgentCpu(agentIpv4.asText()); - // real-time mem - JsonNode agentMem = retrieveAgentMemory(agentIpv4.asText()); - // real-time disk - JsonNode agentDisk = queryAgentDisk(agentIpv4.asText()); - // real-time diskIO - JsonNode agentDiskIO = queryAgentDiskIO(agentIpv4.asText()); - - // dynamic - JsonNode agentCpuInterval = retrieveAgentCpu(agentIpv4.asText(), step); - JsonNode agentMemInterval = retrieveAgentMemory(agentIpv4.asText(), step); - JsonNode agentDiskIOInterval = queryAgentDiskIO(agentIpv4.asText(), step); - for (int i = 0; i < 6; i++) { - // CPU - System.out.println(agentCpuInterval); - agentsCpuUsage[i] = ProxyUtils.getDoubleSafely(agentCpuInterval, CPU_USAGE, i); - agentsCpuLoad1[i] = ProxyUtils.getDoubleSafely(agentCpuInterval, CPU_LOAD_AVG_MIN_1, i); - agentsCpuLoad2[i] = ProxyUtils.getDoubleSafely(agentCpuInterval, CPU_LOAD_AVG_MIN_5, i); - agentsCpuLoad3[i] = ProxyUtils.getDoubleSafely(agentCpuInterval, CPU_LOAD_AVG_MIN_15, i); - - // MEM - agentMemIdle[i] = ProxyUtils.getLongSafely(agentMemInterval, MEM_IDLE, i); - agentMemTotal[i] = ProxyUtils.getLongSafely(agentMemInterval, MEM_TOTAL, i); - - // DISK IO - agentDiskRead[i] = ProxyUtils.getLongSafely(agentDiskIOInterval, DISK_READ, i); - agentDiskWrite[i] = ProxyUtils.getLongSafely(agentDiskIOInterval, DISK_WRITE, i); - } - // cur - ag.put("cpu_usage_cur", agentCpu.get(CPU_USAGE).asDouble()); - ag.put( - "memory_usage_cur", - (double) (agentMem.get(MEM_TOTAL).asLong() - - agentMem.get(MEM_IDLE).asLong()) - / agentMem.get(MEM_TOTAL).asLong()); - ag.put( - "disk_usage_cur", - (double) (agentDisk.get(DISK_TOTAL).asLong() - - agentDisk.get(DISK_IDLE).asLong()) - / agentDisk.get(DISK_TOTAL).asLong()); - ag.put( - "file_descriptor_usage", - (double) agentCpu.get(FILE_OPEN_DESCRIPTOR).asLong() - / agentCpu.get(FILE_TOTAL_DESCRIPTOR).asLong()); - ag.put("disk_read", agentDiskIO.get(DISK_READ).asLong()); - ag.put("disk_read", agentDiskIO.get(DISK_WRITE).asLong()); - // cpu - ag.set("cpu_usage", ProxyUtils.array2node(agentsCpuUsage)); - ag.set("system_load1", ProxyUtils.array2node(agentsCpuLoad1)); - ag.set("system_load2", ProxyUtils.array2node(agentsCpuLoad2)); - ag.set("system_load3", ProxyUtils.array2node(agentsCpuLoad3)); - // mem - ag.set("memory_usage", ProxyUtils.array2node(agentMemIdle, agentMemTotal)); - // disk io - ag.set("disk_read", ProxyUtils.array2node(agentDiskRead)); - ag.set("disk_write", ProxyUtils.array2node(agentDiskWrite)); - - agentsInfo.add(ag); + // DISK IO + agentDiskRead[i] = ProxyUtils.getLongSafely(agentDiskIOInterval, DISK_READ, i); + agentDiskWrite[i] = ProxyUtils.getLongSafely(agentDiskIOInterval, DISK_WRITE, i); } - return agentsInfo; + // HOST + ag.put("hostname", agentCpu.get("hostname").asText()); + ag.put("iPv4addr", agentCpu.get("iPv4addr").asText()); + ag.put("cpuInfo", agentCpu.get("cpuInfo").asText().strip()); + // ag.put("iPv6addr", agentCpu.get("iPv6addr").asText()); + ag.put("os", agentCpu.get("os").asText()); + ag.put("architecture", agentCpu.get("architecture").asText()); + ag.put(PHYSICAL_CORES, agentCpu.get(PHYSICAL_CORES).asText()); + // MEM + ag.put(MEM_TOTAL, agentMem.get(MEM_TOTAL).asLong()); + // DISK + ag.set(DISK_TOTAL, agentDisk.get(DISK_TOTAL)); + + // cur + ag.put("cpu_usage_cur", agentCpu.get(CPU_USAGE).asDouble()); + ag.put( + "memory_usage_cur", + (double) (agentMem.get(MEM_TOTAL).asLong() + - agentMem.get(MEM_IDLE).asLong()) + / agentMem.get(MEM_TOTAL).asLong()); + ag.put( + "disk_usage_cur", + (double) (agentDisk.get(DISK_TOTAL).asLong() + - agentDisk.get(DISK_IDLE).asLong()) + / agentDisk.get(DISK_TOTAL).asLong()); + ag.put( + "file_descriptor_usage", + (double) agentCpu.get(FILE_OPEN_DESCRIPTOR).asLong() + / agentCpu.get(FILE_TOTAL_DESCRIPTOR).asLong()); + ag.put("disk_read", agentDiskIO.get(DISK_READ).asLong()); + ag.put("disk_read", agentDiskIO.get(DISK_WRITE).asLong()); + // cpu + ag.set("cpu_usage", ProxyUtils.array2node(agentsCpuUsage)); + ag.set("system_load1", ProxyUtils.array2node(agentsCpuLoad1)); + ag.set("system_load2", ProxyUtils.array2node(agentsCpuLoad2)); + ag.set("system_load3", ProxyUtils.array2node(agentsCpuLoad3)); + // mem + ag.set("memory_usage", ProxyUtils.array2node(agentMemIdle, agentMemTotal)); + // disk io + ag.set("disk_read", ProxyUtils.array2node(agentDiskRead)); + ag.set("disk_write", ProxyUtils.array2node(agentDiskWrite)); + return ag; } return objectMapper.createObjectNode(); } /** * query cluster info */ - public JsonNode queryClusterInfo(String clusterId, String step) { - JsonNode clusterAgents = bigtopProxy.queryClusterAgents(clusterId); + public JsonNode queryClusterInfo(Long clusterId, String step) { + HostQuery hostQuery = new HostQuery(); + hostQuery.setClusterId(clusterId); + PageVO hostPage = hostService.list(hostQuery); // query host list + List hostList = hostPage.getContent(); ObjectMapper objectMapper = new ObjectMapper(); - if (clusterAgents != null && !clusterAgents.isEmpty()) { - JsonNode agents = clusterAgents.get("agents"); // cluster's agents - int agentsNum = - bigtopProxy.queryClusterAgents(clusterId).get("agentsNum").asInt(); // agentsNum + int agentsNum = Math.toIntExact(hostPage.getTotal()); // change to agentsNum + if (agentsNum > 0) { int total_physical_cores = 0; long totalMemSpace = 0L, totalDiskSpace = 0L, totalMemIdle = 0L; double instantCpuUsage = 0.0; @@ -303,23 +255,25 @@ public JsonNode queryClusterInfo(String clusterId, String step) { long[][] agentMemTotal = new long[agentsNum][6]; int agentIndex = 0; ObjectNode clusterInfo = objectMapper.createObjectNode(); - for (JsonNode agentIpv4 : agents) { + for (HostVO hostVO : hostList) { + String agentIpv4 = hostVO.getIpv4(); // real-time cpuUsage - JsonNode agentCpu = retrieveAgentCpu(agentIpv4.asText()); + JsonNode agentCpu = retrieveAgentCpu(agentIpv4); instantCpuUsage += agentCpu.get("cpuUsage").asDouble() * agentCpu.get(PHYSICAL_CORES).asInt(); - // real-time mem - JsonNode agentMem = retrieveAgentMemory(agents.asText()); + // real-time memUsage + JsonNode agentMem = retrieveAgentMemory(agentIpv4); totalMemIdle += agentMem.get("memIdle").asLong(); totalMemSpace += agentMem.get(("memTotal")).asLong(); - // real-time disk - JsonNode agentDisk = queryAgentDisk(agentIpv4.asText()); + // real-time diskUsage + JsonNode agentDisk = queryAgentDisk(agentIpv4); totalDiskSpace += agentDisk.get(DISK_TOTAL).asLong(); - // avg time - JsonNode agentCpuStep = retrieveAgentCpu(agentIpv4.asText(), step); - JsonNode agentMemStep = retrieveAgentMemory(agents.asText(), step); - int agent_physical_cores = agentCpuStep.get(PHYSICAL_CORES).asInt(); + // freshTime + JsonNode agentCpuStep = retrieveAgentCpu(agentIpv4, step); + JsonNode agentMemStep = retrieveAgentMemory(agentIpv4, step); + + int agent_physical_cores = agentCpu.get(PHYSICAL_CORES).asInt(); total_physical_cores += agent_physical_cores; for (int i = 0; i < 6; i++) { // CPU diff --git a/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/service/MonitoringService.java b/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/service/MonitoringService.java index 09ed562e..2411b3cb 100644 --- a/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/service/MonitoringService.java +++ b/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/service/MonitoringService.java @@ -24,9 +24,7 @@ public interface MonitoringService { JsonNode queryAgentsHealthyStatus(); - JsonNode queryAgentsInfo(); + JsonNode queryAgentInfo(Long id, String step); - JsonNode queryAgentsInfo(String step); - - JsonNode queryClusterInfo(String clusterId, String step); + JsonNode queryClusterInfo(Long clusterId, String step); } diff --git a/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/service/impl/MonitoringServiceImpl.java b/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/service/impl/MonitoringServiceImpl.java index 6cfc2c14..274f3bbb 100644 --- a/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/service/impl/MonitoringServiceImpl.java +++ b/bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/service/impl/MonitoringServiceImpl.java @@ -41,17 +41,12 @@ public JsonNode queryAgentsHealthyStatus() { } @Override - public JsonNode queryAgentsInfo() { - return prometheusProxy.queryAgentsInfo(); + public JsonNode queryAgentInfo(Long id, String step) { + return prometheusProxy.queryAgentsInfo(id, step); } @Override - public JsonNode queryAgentsInfo(String step) { - return prometheusProxy.queryAgentsInfo(step); - } - - @Override - public JsonNode queryClusterInfo(String clusterId, String step) { + public JsonNode queryClusterInfo(Long clusterId, String step) { return prometheusProxy.queryClusterInfo(clusterId, step); } } diff --git a/bigtop-manager-server/src/main/resources/application.yml b/bigtop-manager-server/src/main/resources/application.yml index 4886e552..9c3a1282 100644 --- a/bigtop-manager-server/src/main/resources/application.yml +++ b/bigtop-manager-server/src/main/resources/application.yml @@ -58,7 +58,6 @@ springdoc: default-models-expand-depth: -1 monitoring: - bigtop-host: "http://localhost:5173" prometheus-host: "http://localhost:9090" agent-host-job-name: "bm-agent-host"