This is an automated email from the ASF dual-hosted git repository.
liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-java-chassis.git
The following commit(s) were added to refs/heads/master by this push:
new c0162c1 SCB-2177 reporting metrics data to dashboard service. (#2206)
c0162c1 is described below
commit c0162c16515e4e2ce0fe412a4fb49eae917d55e5
Author: zyl <[email protected]>
AuthorDate: Thu Jan 28 09:09:48 2021 +0800
SCB-2177 reporting metrics data to dashboard service. (#2206)
* SCB-2177 reporting metrics data to dashboard service.
#only with function codes, the test cases will be provide later.
* SCB-2177 reporting metrics data to dashboard service.
---
dependencies/bom/pom.xml | 5 +
distribution/pom.xml | 5 +-
huawei-cloud/dashboard/pom.xml | 51 ++++
.../dashboard/monitor/AddressManager.java | 152 ++++++++++++
.../monitor/ConsoleMonitorDataPublisher.java | 43 ++++
.../huaweicloud/dashboard/monitor/DataFactory.java | 97 ++++++++
.../monitor/DefaultMonitorDataPublisher.java | 188 +++++++++++++++
.../monitor/HealthMonitorDataProvider.java | 134 +++++++++++
.../dashboard/monitor/MonitorBootListener.java | 43 ++++
.../monitor/MonitorDefaultDeploymentProvider.java | 57 +++++
.../monitor/MonitorInformationCollector.java | 42 ++++
.../huaweicloud/dashboard/monitor/SignUtil.java | 81 +++++++
.../dashboard/monitor/data/CPUMonitorCalc.java | 61 +++++
.../dashboard/monitor/data/Diagnosis.java | 35 +++
.../dashboard/monitor/data/InterfaceInfo.java | 220 +++++++++++++++++
.../dashboard/monitor/data/MonitorConstant.java | 168 +++++++++++++
.../dashboard/monitor/data/MonitorData.java | 266 +++++++++++++++++++++
.../monitor/event/ConsoleMonitorDataEvent.java | 34 +++
.../dashboard/monitor/event/MonitorFailEvent.java | 35 +++
.../dashboard/monitor/event/MonitorSuccEvent.java | 21 ++
.../monitor/model/MonitorDaraProvider.java | 24 ++
.../monitor/model/MonitorDataPublisher.java | 26 ++
...vicecomb.core.bootup.BootUpInformationCollector | 17 ++
...pache.servicecomb.deployment.DeploymentProvider | 17 ++
.../resources/META-INF/spring/services.bean.xml} | 28 +--
huawei-cloud/pom.xml | 1 +
26 files changed, 1829 insertions(+), 22 deletions(-)
diff --git a/dependencies/bom/pom.xml b/dependencies/bom/pom.xml
index 06aed60..cff62e3 100644
--- a/dependencies/bom/pom.xml
+++ b/dependencies/bom/pom.xml
@@ -331,6 +331,11 @@
<artifactId>servicestage</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.servicecomb</groupId>
+ <artifactId>dashboard</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<!-- ServiceComb: swagger -->
<dependency>
<groupId>org.apache.servicecomb</groupId>
diff --git a/distribution/pom.xml b/distribution/pom.xml
index 3fb6eac..f9e2349 100644
--- a/distribution/pom.xml
+++ b/distribution/pom.xml
@@ -279,7 +279,10 @@
<groupId>org.apache.servicecomb</groupId>
<artifactId>servicestage</artifactId>
</dependency>
-
+ <dependency>
+ <groupId>org.apache.servicecomb</groupId>
+ <artifactId>dashboard</artifactId>
+ </dependency>
<!-- swagger -->
<dependency>
<groupId>org.apache.servicecomb</groupId>
diff --git a/huawei-cloud/dashboard/pom.xml b/huawei-cloud/dashboard/pom.xml
new file mode 100644
index 0000000..81cfd94
--- /dev/null
+++ b/huawei-cloud/dashboard/pom.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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
+ ~
+ ~ http://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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>huawei-cloud</artifactId>
+ <groupId>org.apache.servicecomb</groupId>
+ <version>2.2.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>dashboard</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.servicecomb</groupId>
+ <artifactId>foundation-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicecomb</groupId>
+ <artifactId>deployment</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicecomb</groupId>
+ <artifactId>java-chassis-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicecomb</groupId>
+ <artifactId>registry-service-center</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.netflix.hystrix</groupId>
+ <artifactId>hystrix-core</artifactId>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
diff --git
a/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/AddressManager.java
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/AddressManager.java
new file mode 100644
index 0000000..27c1188
--- /dev/null
+++
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/AddressManager.java
@@ -0,0 +1,152 @@
+/*
+ * 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
+ *
+ * http://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.servicecomb.huaweicloud.dashboard.monitor;
+
+
+import com.google.common.eventbus.Subscribe;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
+import org.apache.servicecomb.foundation.common.event.EventManager;
+import org.apache.servicecomb.deployment.Deployment;
+import
org.apache.servicecomb.huaweicloud.dashboard.monitor.data.MonitorConstant;
+import
org.apache.servicecomb.huaweicloud.dashboard.monitor.event.MonitorFailEvent;
+import org.apache.servicecomb.registry.api.registry.MicroserviceInstance;
+import org.apache.servicecomb.serviceregistry.RegistryUtils;
+
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+
+public class AddressManager {
+ private static final String MONITR_SERVICE_NAME = "CseMonitoring";
+
+ private static final String MONITR_APPLICATION = "default";
+
+ private static final String MONITR_VERSION = "latest";
+
+ static class State {
+ static final long MAX_TIME = 300000;
+
+ static final int MIN_FAILED = 3;
+
+ private long failedCount = 0;
+
+ private long time;
+
+ public long getTime() {
+ return time;
+ }
+
+ public void setTime(long time) {
+ this.time = time;
+ }
+
+ boolean isIsolated() {
+ if (failedCount < MIN_FAILED) {
+ return false;
+ }
+ if ((System.currentTimeMillis() - time) > MAX_TIME) {
+ time = System.currentTimeMillis();
+ return false;
+ }
+ return true;
+ }
+
+ void setIsolateStatus(boolean isFailed) {
+ if (isFailed) {
+ if (failedCount == 0) {
+ time = System.currentTimeMillis();
+ }
+ failedCount++;
+ } else {
+ failedCount = 0;
+ }
+ }
+ }
+
+ private Map<String, State> addresses = new LinkedHashMap<>();
+
+ private String currentServer;
+
+ private State discoveryState = new State();
+
+ AddressManager() {
+ updateAddresses();
+ EventManager.register(this);
+ }
+
+ public Map<String, State> getAddresses() {
+ return addresses;
+ }
+
+ public void updateAddresses() {
+ SystemBootstrapInfo info = Deployment.getSystemBootStrapInfo(
+ MonitorConstant.SYSTEM_KEY_DASHBOARD_SERVICE);
+ if (addresses.size() > 0) {
+ addresses.clear();
+ }
+ if (info != null && info.getAccessURL() != null) {
+ info.getAccessURL().forEach(url -> {
+ addresses.put(url, new State());
+ });
+ }
+ }
+
+ @Subscribe
+ public void MonitorFailEvent(MonitorFailEvent event) {
+ updateAddresses();
+ }
+
+ String nextServer() {
+ if (currentServer == null && addresses.size() > 0) {
+ currentServer = addresses.keySet().iterator().next();
+ }
+
+ if (currentServer == null || addresses.get(currentServer).isIsolated()) {
+ currentServer = null;
+ if (!discoveryState.isIsolated()) {
+ updateServersFromSC();
+ discoveryState.setIsolateStatus(true);
+ }
+ for (Map.Entry<String, State> entry : addresses.entrySet()) {
+ if (!entry.getValue().isIsolated()) {
+ currentServer = entry.getKey();
+ break;
+ }
+ }
+ }
+ return currentServer;
+ }
+
+ private void updateServersFromSC() {
+ List<MicroserviceInstance> servers =
RegistryUtils.findServiceInstance(MONITR_APPLICATION,
+ MONITR_SERVICE_NAME,
+ MONITR_VERSION);
+ if (servers != null) {
+ for (MicroserviceInstance server : servers) {
+ for (String endpoint : server.getEndpoints()) {
+ addresses.computeIfAbsent(endpoint, key -> new State());
+ }
+ }
+ }
+ }
+
+ void updateStates(String server, boolean failed) {
+ addresses.get(server).setIsolateStatus(failed);
+ }
+}
diff --git
a/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/ConsoleMonitorDataPublisher.java
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/ConsoleMonitorDataPublisher.java
new file mode 100644
index 0000000..324f23d
--- /dev/null
+++
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/ConsoleMonitorDataPublisher.java
@@ -0,0 +1,43 @@
+/*
+ * 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
+ *
+ * http://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.servicecomb.huaweicloud.dashboard.monitor;
+
+import io.vertx.core.json.Json;
+import org.apache.servicecomb.foundation.common.event.EventManager;
+import
org.apache.servicecomb.huaweicloud.dashboard.monitor.event.ConsoleMonitorDataEvent;
+import
org.apache.servicecomb.huaweicloud.dashboard.monitor.model.MonitorDaraProvider;
+import
org.apache.servicecomb.huaweicloud.dashboard.monitor.model.MonitorDataPublisher;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ConsoleMonitorDataPublisher implements MonitorDataPublisher {
+ private static final int END_INDEX = 100;
+
+ private static final Logger LOGGER =
LoggerFactory.getLogger(ConsoleMonitorDataPublisher.class);
+
+ @Override
+ public void publish(MonitorDaraProvider provider) {
+ Object data = provider.getData();
+ if (data == null) {
+ return;
+ }
+ String reqString = Json.encode(data);
+ LOGGER.info(reqString.length() > END_INDEX ? reqString.substring(0,
END_INDEX) : reqString);
+ EventManager.post(new ConsoleMonitorDataEvent(reqString));
+ }
+}
diff --git
a/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/DataFactory.java
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/DataFactory.java
new file mode 100644
index 0000000..a2c8578
--- /dev/null
+++
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/DataFactory.java
@@ -0,0 +1,97 @@
+/*
+ * 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
+ *
+ * http://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.servicecomb.huaweicloud.dashboard.monitor;
+
+import io.netty.util.concurrent.DefaultThreadFactory;
+import
org.apache.servicecomb.huaweicloud.dashboard.monitor.data.MonitorConstant;
+import
org.apache.servicecomb.huaweicloud.dashboard.monitor.model.MonitorDaraProvider;
+import
org.apache.servicecomb.huaweicloud.dashboard.monitor.model.MonitorDataPublisher;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.inject.Inject;
+import java.util.List;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.TimeUnit;
+
+public class DataFactory {
+ private static final Logger LOGGER =
LoggerFactory.getLogger(DataFactory.class);
+
+ private static final int CORE_SIZE = 1;
+
+ private boolean hasStart = false;
+
+ @Inject
+ private List<MonitorDaraProvider> dataProviders;
+
+ @Inject
+ private MonitorDataPublisher publisher;
+
+ private ScheduledExecutorService executorService = null;
+
+
+ public DataFactory() {
+ ThreadFactory threadFactory = new
DefaultThreadFactory("monitor-datafactory");
+ executorService = Executors.newScheduledThreadPool(CORE_SIZE,
threadFactory);
+ }
+
+ public void setMonitorDataProviders(List<MonitorDaraProvider> dataProviders)
{
+ this.dataProviders = dataProviders;
+ }
+
+ public void setMonitorDataPublisher(MonitorDataPublisher publisher) {
+ this.publisher = publisher;
+ }
+
+ void start() {
+ if (!hasStart) {
+ publisher.init();
+
+ StringBuilder sb = new StringBuilder();
+ sb.append("Monitor data sender started. Configured data providers is {");
+ for (MonitorDaraProvider provider : dataProviders) {
+ sb.append(provider.getClass().getName());
+ sb.append(",");
+ }
+ sb.append("}");
+ LOGGER.info(sb.toString());
+
+ executorService.scheduleWithFixedDelay(() -> {
+ try {
+ sendData();
+ } catch (Throwable e) {
+ LOGGER.error("send monitor data error.", e);
+ }
+ }, MonitorConstant.getInterval(), MonitorConstant.getInterval(),
TimeUnit.MILLISECONDS);
+ hasStart = true;
+ }
+ }
+
+ void sendData() {
+ if (!MonitorConstant.isMonitorEnabled()) {
+ return;
+ }
+
+ for (MonitorDaraProvider provider : this.dataProviders) {
+ this.publisher.publish(provider);
+ }
+ }
+
+}
diff --git
a/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/DefaultMonitorDataPublisher.java
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/DefaultMonitorDataPublisher.java
new file mode 100644
index 0000000..a9d5535
--- /dev/null
+++
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/DefaultMonitorDataPublisher.java
@@ -0,0 +1,188 @@
+/*
+ * 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
+ *
+ * http://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.servicecomb.huaweicloud.dashboard.monitor;
+
+import io.netty.handler.codec.http.HttpResponseStatus;
+import io.vertx.core.DeploymentOptions;
+import io.vertx.core.Vertx;
+import io.vertx.core.VertxOptions;
+import io.vertx.core.http.HttpClientOptions;
+import io.vertx.core.http.HttpClientRequest;
+import io.vertx.core.json.Json;
+import io.vertx.core.net.ProxyOptions;
+import org.apache.commons.io.IOUtils;
+import org.apache.servicecomb.foundation.auth.SignRequest;
+import org.apache.servicecomb.foundation.common.event.EventManager;
+import org.apache.servicecomb.foundation.common.net.IpPort;
+import org.apache.servicecomb.foundation.common.net.NetUtils;
+import org.apache.servicecomb.foundation.ssl.SSLCustom;
+import org.apache.servicecomb.foundation.ssl.SSLOption;
+import org.apache.servicecomb.foundation.ssl.SSLOptionFactory;
+import org.apache.servicecomb.foundation.vertx.AddressResolverConfig;
+import org.apache.servicecomb.foundation.vertx.VertxTLSBuilder;
+import org.apache.servicecomb.foundation.vertx.VertxUtils;
+import org.apache.servicecomb.foundation.vertx.client.ClientPoolManager;
+import org.apache.servicecomb.foundation.vertx.client.ClientVerticle;
+import
org.apache.servicecomb.foundation.vertx.client.http.HttpClientPoolFactory;
+import
org.apache.servicecomb.foundation.vertx.client.http.HttpClientWithContext;
+import
org.apache.servicecomb.huaweicloud.dashboard.monitor.data.MonitorConstant;
+import
org.apache.servicecomb.huaweicloud.dashboard.monitor.event.MonitorFailEvent;
+import
org.apache.servicecomb.huaweicloud.dashboard.monitor.event.MonitorSuccEvent;
+import
org.apache.servicecomb.huaweicloud.dashboard.monitor.model.MonitorDaraProvider;
+import
org.apache.servicecomb.huaweicloud.dashboard.monitor.model.MonitorDataPublisher;
+import org.apache.servicecomb.serviceregistry.RegistryUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.net.UnknownHostException;
+import java.util.HashMap;
+
+public class DefaultMonitorDataPublisher implements MonitorDataPublisher {
+ private static final Logger LOGGER =
LoggerFactory.getLogger(DefaultMonitorDataPublisher.class);
+
+ private static final String SSL_KEY = "mc.consumer";
+
+ private static final int MAX_WAIT_QUEUE_SIZE = 50;
+
+ private static ClientPoolManager<HttpClientWithContext> clientMgr;
+
+ private AddressManager addressManager = new AddressManager();
+
+ @Override
+ public void init() {
+ try {
+ deployMonitorClient();
+ } catch (Exception e) {
+ LOGGER.warn("Deploy monitor data publisher failed will not send monitor
data.");
+ }
+ }
+
+ @Override
+ public void publish(MonitorDaraProvider provider) {
+ Object data = provider.getData();
+ if (data == null) {
+ return;
+ }
+ String endpoint = addressManager.nextServer();
+ if (endpoint == null) {
+ return;
+ }
+
+ String jasonData = Json.encode(data);
+ String url = provider.getURL();
+ IpPort host = NetUtils.parseIpPortFromURI(endpoint);
+
+ doSend(endpoint, jasonData, url, host, 0);
+ }
+
+ private void doSend(String endponit, String jsonData, String url, IpPort
host, int times) {
+ clientMgr.findThreadBindClientPool().runOnContext(client -> {
+ @SuppressWarnings("deprecation")
+ HttpClientRequest request = client.post(host.getPort(),
+ host.getHostOrIp(),
+ url,
+ rsp -> {
+ rsp.exceptionHandler(e -> LOGGER.warn("publish error ", e));
+ if (rsp.statusCode() != HttpResponseStatus.OK.code()) {
+ if (times < MonitorConstant.MAX_RETRY_TIMES
+ && rsp.statusCode() ==
HttpResponseStatus.BAD_GATEWAY.code()) {
+ doSend(endponit, jsonData, url, host, times + 1);
+ return;
+ }
+ rsp.bodyHandler(buffer -> {
+ LOGGER.warn("Send data to url {} failed and status line is {}",
+ url,
+ rsp.statusCode());
+ LOGGER.warn("message: {}", buffer);
+ });
+ EventManager.post(new MonitorFailEvent("send monitor data
fail."));
+ addressManager.updateStates(endponit, false);
+ } else {
+ EventManager.post(new MonitorSuccEvent());
+ addressManager.updateStates(endponit, false);
+ }
+ });
+ request.setTimeout(MonitorConstant.getInterval() /
MonitorConstant.MAX_RETRY_TIMES);
+ request.exceptionHandler(e -> {
+ EventManager.post(new MonitorFailEvent("send monitor data fail."));
+ LOGGER.warn("Send monitor data to {} failed , {}", endponit,
e.getMessage());
+ if (e instanceof UnknownHostException) {
+ LOGGER.error("DNS resolve failed!", e);
+ }
+ addressManager.updateStates(endponit, true);
+ });
+
+ try {
+ SignRequest signReq =
SignUtil.createSignRequest(request.method().toString(),
+ endponit + url,
+ new HashMap<>(),
+ IOUtils.toInputStream(jsonData, "UTF-8"));
+ SignUtil.getAuthHeaderProviders().forEach(authHeaderProvider -> {
+
request.headers().addAll(authHeaderProvider.getSignAuthHeaders(signReq));
+ });
+ request.headers().add("environment",
RegistryUtils.getMicroservice().getEnvironment());
+ } catch (Exception e) {
+ LOGGER.error("sign request error!", e);
+ }
+ request.end(jsonData);
+ });
+ }
+
+ private void deployMonitorClient() throws InterruptedException {
+ VertxOptions vertxOptions = new VertxOptions();
+
vertxOptions.setAddressResolverOptions(AddressResolverConfig.getAddressResover(SSL_KEY));
+ Vertx vertx = VertxUtils.getOrCreateVertxByName("monitor-center",
vertxOptions);
+
+ HttpClientOptions httpClientOptions = createHttpClientOptions();
+ httpClientOptions.setMaxWaitQueueSize(MAX_WAIT_QUEUE_SIZE);
+ clientMgr = new ClientPoolManager<>(vertx, new
HttpClientPoolFactory(httpClientOptions));
+
+ DeploymentOptions deploymentOptions =
VertxUtils.createClientDeployOptions(clientMgr, 1);
+ VertxUtils.blockDeploy(vertx, ClientVerticle.class, deploymentOptions);
+ }
+
+ private HttpClientOptions createHttpClientOptions() {
+ HttpClientOptions httpClientOptions = new HttpClientOptions();
+ if (MonitorConstant.isProxyEnable()) {
+ ProxyOptions proxy = new ProxyOptions();
+ proxy.setHost(MonitorConstant.getProxyHost());
+ proxy.setPort(MonitorConstant.getProxyPort());
+ proxy.setUsername(MonitorConstant.getProxyUsername());
+ proxy.setPassword(MonitorConstant.getProxyPasswd());
+ httpClientOptions.setProxyOptions(proxy);
+ }
+
+
httpClientOptions.setConnectTimeout(MonitorConstant.getConnectionTimeout());
+ if (MonitorConstant.sslEnabled()) {
+ SSLOptionFactory factory =
SSLOptionFactory.createSSLOptionFactory(SSL_KEY, null);
+ SSLOption sslOption;
+ if (factory == null) {
+ sslOption = SSLOption.buildFromYaml(SSL_KEY);
+ } else {
+ sslOption = factory.createSSLOption();
+ }
+ SSLCustom sslCustom =
SSLCustom.createSSLCustom(sslOption.getSslCustomClass());
+ VertxTLSBuilder.buildHttpClientOptions(sslOption, sslCustom,
httpClientOptions);
+ }
+ return httpClientOptions;
+ }
+
+ public AddressManager getAddressManager() {
+ return addressManager;
+ }
+}
diff --git
a/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/HealthMonitorDataProvider.java
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/HealthMonitorDataProvider.java
new file mode 100644
index 0000000..7fa7f98
--- /dev/null
+++
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/HealthMonitorDataProvider.java
@@ -0,0 +1,134 @@
+/*
+ * 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
+ *
+ * http://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.servicecomb.huaweicloud.dashboard.monitor;
+
+import com.google.common.eventbus.Subscribe;
+import com.netflix.hystrix.HystrixCommandMetrics;
+import org.apache.servicecomb.foundation.common.event.EventManager;
+import
org.apache.servicecomb.huaweicloud.dashboard.monitor.data.CPUMonitorCalc;
+import org.apache.servicecomb.huaweicloud.dashboard.monitor.data.Diagnosis;
+import
org.apache.servicecomb.huaweicloud.dashboard.monitor.data.MonitorConstant;
+import org.apache.servicecomb.huaweicloud.dashboard.monitor.data.MonitorData;
+import
org.apache.servicecomb.huaweicloud.dashboard.monitor.model.MonitorDaraProvider;
+import org.apache.servicecomb.registry.DiscoveryManager;
+import org.apache.servicecomb.registry.api.registry.Microservice;
+import org.apache.servicecomb.registry.api.registry.MicroserviceInstance;
+import org.apache.servicecomb.serviceregistry.RegistryUtils;
+import
org.apache.servicecomb.serviceregistry.diagnosis.instance.InstanceCacheChecker;
+import
org.apache.servicecomb.serviceregistry.diagnosis.instance.InstanceCacheSummary;
+
+import javax.annotation.PostConstruct;
+import java.lang.management.ManagementFactory;
+import java.lang.management.MemoryMXBean;
+import java.lang.management.MemoryUsage;
+import java.lang.management.OperatingSystemMXBean;
+import java.lang.management.RuntimeMXBean;
+import java.lang.management.ThreadMXBean;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+public class HealthMonitorDataProvider implements MonitorDaraProvider {
+
+ private InstanceCacheSummary instanceCacheSummary;
+
+ private Object lock = new Object();
+
+ @Override
+ public String getURL() {
+ return String.format(MonitorConstant.MONITORS_URI,
RegistryUtils.getMicroservice().getServiceName());
+ }
+
+ @Override
+ public Object getData() {
+ return getMonitorData();
+ }
+
+ @PostConstruct
+ public void init() {
+ EventManager.register(this);
+ }
+
+ @Subscribe
+ public void subCacheCheck(InstanceCacheSummary instanceCacheSummary) {
+ synchronized (lock) {
+ this.instanceCacheSummary = instanceCacheSummary;
+ }
+ }
+
+ private MonitorData getMonitorData() {
+ Collection<HystrixCommandMetrics> instances =
HystrixCommandMetrics.getInstances();
+ MonitorData monitorData = new MonitorData();
+ Microservice microservice = RegistryUtils.getMicroservice();
+ MicroserviceInstance microserviceInstance =
RegistryUtils.getMicroserviceInstance();
+ monitorData.setAppId(microservice.getAppId());
+ monitorData.setName(microservice.getServiceName());
+ monitorData.setVersion(microservice.getVersion());
+ monitorData.setServiceId(microservice.getServiceId());
+ monitorData.setInstance(microserviceInstance.getHostName());
+ monitorData.setInstanceId(microserviceInstance.getInstanceId());
+
+ if (MonitorConstant.insCacheEnabled()) {
+ InstanceCacheChecker checker = new
InstanceCacheChecker(DiscoveryManager.INSTANCE.getAppManager());
+ monitorData.setProvidersCache(checker.check().getProducers());
+ }
+ exactProcessInfo(monitorData);
+ synchronized (lock) {
+ if (this.instanceCacheSummary != null) {
+ Diagnosis diagnosis = new Diagnosis();
+ diagnosis.setInstanceCache(instanceCacheSummary);
+ monitorData.setDiagnosis(diagnosis);
+ this.instanceCacheSummary = null;
+ }
+ }
+
+ if (instances.isEmpty()) {
+ return monitorData;
+ }
+ for (HystrixCommandMetrics instance : instances) {
+ monitorData.appendInterfaceInfo(instance);
+ }
+ return monitorData;
+ }
+
+ private void exactProcessInfo(MonitorData monitorData) {
+ MemoryMXBean memoryMXBean = ManagementFactory.getMemoryMXBean();
+ MemoryUsage memoryHeapUsage = memoryMXBean.getHeapMemoryUsage();
+ MemoryUsage memoryNonHeapUsage = memoryMXBean.getNonHeapMemoryUsage();
+ ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();
+ RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean();
+ int threadCount = threadMXBean.getThreadCount();
+ OperatingSystemMXBean operatingSystemMXBean =
ManagementFactory.getOperatingSystemMXBean();
+
+ double cpu = operatingSystemMXBean.getSystemLoadAverage();
+ monitorData.setCpu(CPUMonitorCalc.getInstance().getProcessCpu());
+ monitorData.setLoadAverage(cpu);
+ monitorData.setThreadCount(threadCount);
+ monitorData.setUptime(runtimeMXBean.getUptime());
+
+ Map<String, Long> memoryInfo = new HashMap<>();
+ memoryInfo.put("heapInit", memoryHeapUsage.getInit());
+ memoryInfo.put("headMax", memoryHeapUsage.getMax());
+ memoryInfo.put("heapCommit", memoryHeapUsage.getCommitted());
+ memoryInfo.put("heapUsed", memoryHeapUsage.getUsed());
+ memoryInfo.put("nonHeapInit", memoryNonHeapUsage.getInit());
+ memoryInfo.put("nonHeapCommit", memoryNonHeapUsage.getCommitted());
+ memoryInfo.put("nonHeapUsed", memoryNonHeapUsage.getUsed());
+ monitorData.setMemory(memoryInfo);
+ }
+}
diff --git
a/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/MonitorBootListener.java
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/MonitorBootListener.java
new file mode 100644
index 0000000..2ae7f21
--- /dev/null
+++
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/MonitorBootListener.java
@@ -0,0 +1,43 @@
+/*
+ * 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
+ *
+ * http://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.servicecomb.huaweicloud.dashboard.monitor;
+
+import org.apache.servicecomb.core.BootListener;
+
+import javax.inject.Inject;
+
+public class MonitorBootListener implements BootListener {
+
+ @Inject
+ private DataFactory dataFactory;
+
+ @Override
+ public void onBootEvent(BootEvent event) {
+ if (EventType.AFTER_REGISTRY == event.getEventType()) {
+ dataFactory.start();
+ }
+ }
+
+ public DataFactory getDataFactory() {
+ return dataFactory;
+ }
+
+ public void setDataFactory(DataFactory dataFactory) {
+ this.dataFactory = dataFactory;
+ }
+}
diff --git
a/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/MonitorDefaultDeploymentProvider.java
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/MonitorDefaultDeploymentProvider.java
new file mode 100644
index 0000000..643696d
--- /dev/null
+++
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/MonitorDefaultDeploymentProvider.java
@@ -0,0 +1,57 @@
+/*
+ * 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
+ *
+ * http://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.servicecomb.huaweicloud.dashboard.monitor;
+
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.commons.configuration.AbstractConfiguration;
+import org.apache.servicecomb.config.ConfigUtil;
+import org.apache.servicecomb.deployment.DeploymentProvider;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
+import
org.apache.servicecomb.huaweicloud.dashboard.monitor.data.MonitorConstant;
+
+import java.util.Arrays;
+
+public class MonitorDefaultDeploymentProvider implements DeploymentProvider {
+ private static AbstractConfiguration configuration =
ConfigUtil.createLocalConfig();
+
+ @Override
+ public int getOrder() {
+ return 2;
+ }
+
+ @Override
+ public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
+ switch (systemKey) {
+ case MonitorConstant.SYSTEM_KEY_DASHBOARD_SERVICE:
+ String[] msAddresses =
configuration.getStringArray(MonitorConstant.MONITOR_URI);
+ if (msAddresses == null || msAddresses.length == 0) {
+ return null;
+ }
+ SystemBootstrapInfo ms = new SystemBootstrapInfo();
+ ms.setAccessURL(Arrays.asList(msAddresses));
+ return ms;
+ default:
+ return null;
+ }
+ }
+
+ @VisibleForTesting
+ public static void setConfiguration(AbstractConfiguration configuration) {
+ MonitorDefaultDeploymentProvider.configuration = configuration;
+ }
+}
diff --git
a/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/MonitorInformationCollector.java
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/MonitorInformationCollector.java
new file mode 100644
index 0000000..289c8a5
--- /dev/null
+++
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/MonitorInformationCollector.java
@@ -0,0 +1,42 @@
+/*
+ * 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
+ *
+ * http://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.servicecomb.huaweicloud.dashboard.monitor;
+
+import org.apache.servicecomb.core.bootup.BootUpInformationCollector;
+import org.apache.servicecomb.deployment.Deployment;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
+import
org.apache.servicecomb.huaweicloud.dashboard.monitor.data.MonitorConstant;
+
+public class MonitorInformationCollector implements BootUpInformationCollector
{
+ @Override
+ public String collect() {
+ return "monitor center: " +
getCenterInfo(Deployment.getSystemBootStrapInfo(MonitorConstant.SYSTEM_KEY_DASHBOARD_SERVICE));
+ }
+
+ @Override
+ public int getOrder() {
+ return 100;
+ }
+
+ private String getCenterInfo(SystemBootstrapInfo systemBootstrapInfo) {
+ if (systemBootstrapInfo == null) {
+ return ("not exist");
+ }
+ return systemBootstrapInfo.getAccessURL().toString();
+ }
+}
diff --git
a/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/SignUtil.java
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/SignUtil.java
new file mode 100644
index 0000000..b950f06
--- /dev/null
+++
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/SignUtil.java
@@ -0,0 +1,81 @@
+/*
+ * 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
+ *
+ * http://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.servicecomb.huaweicloud.dashboard.monitor;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.servicecomb.foundation.auth.AuthHeaderProvider;
+import org.apache.servicecomb.foundation.auth.SignRequest;
+import org.apache.servicecomb.foundation.common.utils.SPIServiceUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class SignUtil {
+ private static final Logger LOGGER = LoggerFactory.getLogger(SignUtil.class);
+
+ private static List<AuthHeaderProvider> authHeaderProviders =
SPIServiceUtils.
+ getSortedService(AuthHeaderProvider.class);
+
+ public static SignRequest createSignRequest(String method, String endpoint,
Map<String, String>
+ headers, InputStream content) {
+ SignRequest signReq = new SignRequest();
+ try {
+ signReq.setEndpoint(new URI(endpoint));
+ } catch (URISyntaxException e) {
+ LOGGER.warn("set uri failed, uri is {}, message: {}", endpoint,
e.getMessage());
+ }
+
+ Map<String, String[]> queryParams = new HashMap<>();
+ if (endpoint.contains("?")) {
+ String parameters = endpoint.substring(endpoint.indexOf("?") + 1);
+ if (!StringUtils.isEmpty(parameters)) {
+ String[] parameterArray = parameters.split("&");
+ for (String p : parameterArray) {
+ String key = p.split("=")[0];
+ String value = p.split("=")[1];
+ if (!queryParams.containsKey(key)) {
+ queryParams.put(key, new String[]{value});
+ } else {
+ List<String> vals = new
ArrayList<>(Arrays.asList(queryParams.get(key)));
+ vals.add(value);
+ queryParams.put(key, vals.toArray(new String[vals.size()]));
+ }
+ }
+ }
+ }
+
+ signReq.setQueryParams(queryParams);
+ signReq.setHeaders(headers);
+ signReq.setHttpMethod(method);
+ signReq.setContent(content);
+ return signReq;
+ }
+
+
+ public static List<AuthHeaderProvider> getAuthHeaderProviders() {
+ return authHeaderProviders;
+ }
+}
diff --git
a/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/data/CPUMonitorCalc.java
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/data/CPUMonitorCalc.java
new file mode 100644
index 0000000..79ee974
--- /dev/null
+++
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/data/CPUMonitorCalc.java
@@ -0,0 +1,61 @@
+/*
+ * 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
+ *
+ * http://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.servicecomb.huaweicloud.dashboard.monitor.data;
+
+
+import java.lang.management.ManagementFactory;
+import java.lang.management.OperatingSystemMXBean;
+import java.lang.management.ThreadMXBean;
+
+public class CPUMonitorCalc {
+ private static final int PERCENTAGE = 100;
+
+ private static CPUMonitorCalc instance = new CPUMonitorCalc();
+
+ private OperatingSystemMXBean osMxBean;
+
+ private ThreadMXBean threadMXBean;
+
+ private long preTime = System.nanoTime();
+
+ private long preUsedTime = 0;
+
+ public CPUMonitorCalc() {
+ osMxBean = ManagementFactory.getOperatingSystemMXBean();
+ threadMXBean = ManagementFactory.getThreadMXBean();
+ }
+
+ public static CPUMonitorCalc getInstance() {
+ return instance;
+ }
+
+ public double getProcessCpu() {
+ long totalTime = 0;
+
+ for (long id : threadMXBean.getAllThreadIds()) {
+ totalTime += threadMXBean.getThreadCpuTime(id);
+ }
+
+ long curtime = System.nanoTime();
+ long usedTime = totalTime - preUsedTime;
+ long totalPassedTime = curtime - preTime;
+ preTime = curtime;
+ preUsedTime = totalTime;
+ return (((double) usedTime) / totalPassedTime /
osMxBean.getAvailableProcessors()) * PERCENTAGE;
+ }
+}
diff --git
a/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/data/Diagnosis.java
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/data/Diagnosis.java
new file mode 100644
index 0000000..0ee6605
--- /dev/null
+++
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/data/Diagnosis.java
@@ -0,0 +1,35 @@
+/*
+ * 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
+ *
+ * http://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.servicecomb.huaweicloud.dashboard.monitor.data;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import
org.apache.servicecomb.serviceregistry.diagnosis.instance.InstanceCacheSummary;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class Diagnosis {
+
+ private InstanceCacheSummary instanceCache;
+
+ public InstanceCacheSummary getInstanceCache() {
+ return instanceCache;
+ }
+
+ public void setInstanceCache(InstanceCacheSummary instanceCache) {
+ this.instanceCache = instanceCache;
+ }
+}
diff --git
a/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/data/InterfaceInfo.java
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/data/InterfaceInfo.java
new file mode 100644
index 0000000..23a35f0
--- /dev/null
+++
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/data/InterfaceInfo.java
@@ -0,0 +1,220 @@
+/*
+ * 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
+ *
+ * http://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.servicecomb.huaweicloud.dashboard.monitor.data;
+
+public class InterfaceInfo {
+ private String name;
+
+ private String desc;
+
+ private double qps;
+
+ private int latency;
+
+ private int l995;
+
+ private int l99;
+
+ private int l90;
+
+ private int l75;
+
+ private int l50;
+
+ private int l25;
+
+ private int l5;
+
+ private double rate;
+
+ private double failureRate;
+
+ private long total;
+
+ private boolean isCircuitBreakerOpen;
+
+ private long failure;
+
+ private long shortCircuited;
+
+ private long semaphoreRejected;
+
+ private long threadPoolRejected;
+
+ private long countTimeout;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDesc() {
+ return desc;
+ }
+
+ public void setDesc(String desc) {
+ this.desc = desc;
+ }
+
+ public double getQps() {
+ return qps;
+ }
+
+ public void setQps(double qps) {
+ this.qps = qps;
+ }
+
+ public int getLatency() {
+ return latency;
+ }
+
+ public void setLatency(int latency) {
+ this.latency = latency;
+ }
+
+ public int getL995() {
+ return l995;
+ }
+
+ public void setL995(int l995) {
+ this.l995 = l995;
+ }
+
+ public int getL99() {
+ return l99;
+ }
+
+ public void setL99(int l99) {
+ this.l99 = l99;
+ }
+
+ public int getL90() {
+ return l90;
+ }
+
+ public void setL90(int l90) {
+ this.l90 = l90;
+ }
+
+ public int getL75() {
+ return l75;
+ }
+
+ public void setL75(int l75) {
+ this.l75 = l75;
+ }
+
+ public int getL50() {
+ return l50;
+ }
+
+ public void setL50(int l50) {
+ this.l50 = l50;
+ }
+
+ public int getL25() {
+ return l25;
+ }
+
+ public void setL25(int l25) {
+ this.l25 = l25;
+ }
+
+ public int getL5() {
+ return l5;
+ }
+
+ public void setL5(int l5) {
+ this.l5 = l5;
+ }
+
+ public double getRate() {
+ return rate;
+ }
+
+ public void setRate(double rate) {
+ this.rate = rate;
+ }
+
+ public double getFailureRate() {
+ return failureRate;
+ }
+
+ public void setFailureRate(double failureRate) {
+ this.failureRate = failureRate;
+ }
+
+ public long getTotal() {
+ return total;
+ }
+
+ public void setTotal(long total) {
+ this.total = total;
+ }
+
+ public boolean isCircuitBreakerOpen() {
+ return isCircuitBreakerOpen;
+ }
+
+ public void setCircuitBreakerOpen(boolean circuitBreakerOpen) {
+ isCircuitBreakerOpen = circuitBreakerOpen;
+ }
+
+ public long getFailure() {
+ return failure;
+ }
+
+ public void setFailure(long failure) {
+ this.failure = failure;
+ }
+
+ public long getShortCircuited() {
+ return shortCircuited;
+ }
+
+ public void setShortCircuited(long shortCircuited) {
+ this.shortCircuited = shortCircuited;
+ }
+
+ public long getSemaphoreRejected() {
+ return semaphoreRejected;
+ }
+
+ public void setSemaphoreRejected(long semaphoreRejected) {
+ this.semaphoreRejected = semaphoreRejected;
+ }
+
+ public long getThreadPoolRejected() {
+ return threadPoolRejected;
+ }
+
+ public void setThreadPoolRejected(long threadPoolRejected) {
+ this.threadPoolRejected = threadPoolRejected;
+ }
+
+ public long getCountTimeout() {
+ return countTimeout;
+ }
+
+ public void setCountTimeout(long countTimeout) {
+ this.countTimeout = countTimeout;
+ }
+}
diff --git
a/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/data/MonitorConstant.java
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/data/MonitorConstant.java
new file mode 100644
index 0000000..42c3361
--- /dev/null
+++
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/data/MonitorConstant.java
@@ -0,0 +1,168 @@
+/*
+ * 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
+ *
+ * http://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.servicecomb.huaweicloud.dashboard.monitor.data;
+
+import com.netflix.config.DynamicBooleanProperty;
+import com.netflix.config.DynamicIntProperty;
+import com.netflix.config.DynamicPropertyFactory;
+import com.netflix.config.DynamicStringProperty;
+
+public class MonitorConstant {
+ public static final String DOMAIN_NAME = getDomainName();
+
+ public static final String CURRENT_VERSION = getApiVersion();
+
+ public static final String VERSION_V1 = "v1";
+
+ public static final String PREFIX_V2 = String.format("/v2/%s/csemonitor",
DOMAIN_NAME);
+
+ public static final String MONITORS_URI;
+
+ public static final String SYSTEM_KEY_DASHBOARD_SERVICE = "DashboardService";
+
+ public static final String MONITOR_URI =
"servicecomb.monitor.client.serverUri";
+
+ public static final String PROXY_ENABLE = "servicecomb.proxy.enable";
+
+ public static final String PROXY_HOST = "servicecomb.proxy.host";
+
+ public static final String PROXY_PORT = "servicecomb.proxy.port";
+
+ public static final String PROXY_USERNAME = "servicecomb.proxy.username";
+
+ public static final String PROXY_PASSWD = "servicecomb.proxy.passwd";
+
+ public static final int MIN_INTERVAL_MILLISECONDS = 5000;
+
+ public static final int DEFAULT_TIMEOUT = 5000;
+
+ public static final int DEFAULT_INTERVAL = 10000;
+
+ public static final int MAX_RETRY_TIMES = 3;
+
+ static {
+ if (VERSION_V1.equals(CURRENT_VERSION)) {
+ MONITORS_URI = "/csemonitor/v1/metric?service=%s";
+ } else {
+ MONITORS_URI = PREFIX_V2 + "/metric?service=%s";
+ }
+ }
+
+ public static final String TRANSACTION_URI;
+
+ static {
+ if (VERSION_V1.equals(CURRENT_VERSION)) {
+ TRANSACTION_URI = "/csemonitor/v1/transaction";
+ } else {
+ TRANSACTION_URI = PREFIX_V2 + "/transaction";
+ }
+ }
+
+ public static String getTanentName() {
+ DynamicStringProperty property = DynamicPropertyFactory.getInstance().
+ getStringProperty("servicecomb.config.client.tenantName", "default");
+ return property.getValue();
+ }
+
+ public static String getDomainName() {
+ DynamicStringProperty property = DynamicPropertyFactory.getInstance().
+ getStringProperty("servicecomb.config.client.domainName", "default");
+ return property.getValue();
+ }
+
+ public static String getApiVersion() {
+ DynamicStringProperty property = DynamicPropertyFactory.getInstance().
+ getStringProperty("servicecomb.monitor.client.api.version", "v2");
+ return property.getValue();
+ }
+
+ public static String getServerUrl() {
+ DynamicStringProperty property = DynamicPropertyFactory.getInstance().
+ getStringProperty("servicecomb.monitor.client.serverUri", null);
+ return property.getValue();
+ }
+
+ public static boolean insCacheEnabled() {
+ DynamicBooleanProperty property = DynamicPropertyFactory.getInstance().
+ getBooleanProperty("servicecomb.monitor.client.pushInsCache", false);
+ return property.getValue();
+ }
+
+ public static boolean sslEnabled() {
+ DynamicBooleanProperty property = DynamicPropertyFactory.getInstance().
+ getBooleanProperty("servicecomb.monitor.client.sslEnabled", true);
+ return property.getValue();
+ }
+
+ public static boolean isMonitorEnabled() {
+ DynamicBooleanProperty property = DynamicPropertyFactory.getInstance().
+ getBooleanProperty("servicecomb.monitor.client.enabled", true);
+ return property.getValue();
+ }
+
+ public static int getConnectionTimeout() {
+ DynamicIntProperty property = DynamicPropertyFactory.getInstance().
+ getIntProperty("servicecomb.monitor.client.timeout", DEFAULT_TIMEOUT);
+ return property.getValue();
+ }
+
+ public static int getInterval() {
+ DynamicIntProperty property = DynamicPropertyFactory.getInstance().
+ getIntProperty("servicecomb.monitor.client.interval",
DEFAULT_INTERVAL);
+ int val = property.getValue();
+ if (val < MIN_INTERVAL_MILLISECONDS) {
+ return MIN_INTERVAL_MILLISECONDS;
+ }
+ return val;
+ }
+
+ public static Boolean isProxyEnable() {
+ return Boolean.parseBoolean(getProperty("false", PROXY_ENABLE));
+ }
+
+ public static String getProxyHost() {
+ return getProperty("127.0.0.1", PROXY_HOST);
+ }
+
+ public static int getProxyPort() {
+ return Integer.parseInt(getProperty("8080", PROXY_PORT));
+ }
+
+ public static String getProxyUsername() {
+ return getProperty(null, PROXY_USERNAME);
+ }
+
+ public static String getProxyPasswd() {
+ return getProperty(null, PROXY_PASSWD);
+ }
+
+ private static String getProperty(String defaultValue, String... keys) {
+ String property = null;
+ for (String key : keys) {
+ property = DynamicPropertyFactory.getInstance().getStringProperty(key,
null).get();
+ if (property != null) {
+ break;
+ }
+ }
+
+ if (property != null) {
+ return property;
+ }
+ return defaultValue;
+ }
+}
diff --git
a/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/data/MonitorData.java
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/data/MonitorData.java
new file mode 100644
index 0000000..016ed18
--- /dev/null
+++
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/data/MonitorData.java
@@ -0,0 +1,266 @@
+/*
+ * 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
+ *
+ * http://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.servicecomb.huaweicloud.dashboard.monitor.data;
+
+import com.netflix.hystrix.HystrixCircuitBreaker;
+import com.netflix.hystrix.HystrixCommandMetrics;
+import com.netflix.hystrix.HystrixEventType;
+import
org.apache.servicecomb.serviceregistry.diagnosis.instance.InstanceCacheResult;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+public class MonitorData {
+ private static final double PERCENTAGE_995 = 99.5;
+
+ private static final double PERCENTAGE_99 = 99;
+
+ private static final double PERCENTAGE_90 = 90;
+
+ private static final double PERCENTAGE_75 = 75;
+
+ private static final double PERCENTAGE_50 = 50;
+
+ private static final double PERCENTAGE_25 = 25;
+
+ private static final double PERCENTAGE_5 = 5;
+
+ private static final int SCALE_VAL = 1;
+
+ private static final double DEFAULT_SUCCESS_RATE = 1.0d;
+
+ private String appId;
+
+ private String version;
+
+ private String name;
+
+ private String serviceId;
+
+ private String instance;
+
+ private String instanceId;
+
+ private int thread;
+
+ private double cpu;
+
+ private double loadAverage;
+
+ private long uptime;
+
+ private Map<String, Long> memory;
+
+ private List<InterfaceInfo> interfaces = new ArrayList<>();
+
+ private Diagnosis diagnosis;
+
+ private Map<String, Object> customs;
+
+ private static final int CONVERSION = 1000;
+
+ private List<InstanceCacheResult> providersCache;
+
+ public void appendInterfaceInfo(HystrixCommandMetrics metrics) {
+ InterfaceInfo interfaceInfo = new InterfaceInfo();
+ int windowTime =
metrics.getProperties().metricsRollingStatisticalWindowInMilliseconds().get() /
CONVERSION;
+ long successCount = metrics.getRollingCount(HystrixEventType.SUCCESS);
+ long failureCount = metrics.getRollingCount(HystrixEventType.FAILURE);
+ long semRejectCount =
metrics.getRollingCount(HystrixEventType.SEMAPHORE_REJECTED);
+ long threadRejectCount =
metrics.getRollingCount(HystrixEventType.THREAD_POOL_REJECTED);
+ long timeoutCount = metrics.getRollingCount(HystrixEventType.TIMEOUT);
+ long shortCircuitedCount =
metrics.getRollingCount(HystrixEventType.SHORT_CIRCUITED);
+ long rollingErrorTotal = failureCount + semRejectCount + threadRejectCount
+ timeoutCount;
+ long rollingTotal = successCount + rollingErrorTotal;
+
+ if (rollingTotal == 0) {
+ interfaceInfo.setRate(DEFAULT_SUCCESS_RATE);
+ interfaceInfo.setFailureRate(0d);
+ } else {
+ double failurePercentage = (double) rollingErrorTotal / rollingTotal;
+ interfaceInfo.setRate(DEFAULT_SUCCESS_RATE - failurePercentage);
+ interfaceInfo.setFailureRate(failurePercentage);
+ }
+
+ int latency = metrics.getTotalTimeMean();
+ int latency995 = metrics.getTotalTimePercentile(PERCENTAGE_995);
+ int latency99 = metrics.getTotalTimePercentile(PERCENTAGE_99);
+ int latency90 = metrics.getTotalTimePercentile(PERCENTAGE_90);
+ int latency75 = metrics.getTotalTimePercentile(PERCENTAGE_75);
+ int latency50 = metrics.getTotalTimePercentile(PERCENTAGE_50);
+ int latency25 = metrics.getTotalTimePercentile(PERCENTAGE_25);
+ int latency5 = metrics.getTotalTimePercentile(PERCENTAGE_5);
+
+ interfaceInfo.setName(metrics.getCommandKey().name());
+ interfaceInfo.setCircuitBreakerOpen(isOpen(metrics));
+ interfaceInfo.setShortCircuited(shortCircuitedCount);
+ interfaceInfo.setFailureRate(failureCount);
+ interfaceInfo.setSemaphoreRejected(semRejectCount);
+ interfaceInfo.setThreadPoolRejected(threadRejectCount);
+ interfaceInfo.setCountTimeout(timeoutCount);
+ interfaceInfo.setDesc(metrics.getCommandKey().name());
+ interfaceInfo.setLatency(latency);
+ interfaceInfo.setL995(latency995);
+ interfaceInfo.setL99(latency99);
+ interfaceInfo.setL90(latency90);
+ interfaceInfo.setL75(latency75);
+ interfaceInfo.setL50(latency50);
+ interfaceInfo.setL25(latency25);
+ interfaceInfo.setL5(latency5);
+ interfaceInfo.setTotal(rollingTotal);
+ double qpsVal = ((double) rollingTotal) / windowTime;
+ BigDecimal b = new BigDecimal(qpsVal);
+ BigDecimal qps = b.setScale(SCALE_VAL, RoundingMode.HALF_DOWN);
+ interfaceInfo.setQps(qps.doubleValue());
+ interfaces.add(interfaceInfo);
+ }
+
+ public boolean isOpen(HystrixCommandMetrics metrics) {
+ if (metrics.getProperties().circuitBreakerForceOpen().get()) {
+ return true;
+ }
+ if (metrics.getProperties().circuitBreakerForceClosed().get()) {
+ return false;
+ }
+ HystrixCircuitBreaker circuitBreaker =
HystrixCircuitBreaker.Factory.getInstance(metrics.getCommandKey());
+ return circuitBreaker != null && circuitBreaker.isOpen();
+ }
+
+ public String getAppId() {
+ return appId;
+ }
+
+ public void setAppId(String appId) {
+ this.appId = appId;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getServiceId() {
+ return serviceId;
+ }
+
+ public void setServiceId(String serviceId) {
+ this.serviceId = serviceId;
+ }
+
+ public String getInstance() {
+ return instance;
+ }
+
+ public void setInstance(String instance) {
+ this.instance = instance;
+ }
+
+ public String getInstanceId() {
+ return instanceId;
+ }
+
+ public void setInstanceId(String instanceId) {
+ this.instanceId = instanceId;
+ }
+
+ public int getThreadCount() {
+ return thread;
+ }
+
+ public void setThreadCount(int threadCount) {
+ this.thread = threadCount;
+ }
+
+ public double getCpu() {
+ return cpu;
+ }
+
+ public void setCpu(double cpu) {
+ this.cpu = cpu;
+ }
+
+ public double getLoadAverage() {
+ return loadAverage;
+ }
+
+ public void setLoadAverage(double loadAverage) {
+ this.loadAverage = loadAverage;
+ }
+
+ public long getUptime() {
+ return uptime;
+ }
+
+ public void setUptime(long uptime) {
+ this.uptime = uptime;
+ }
+
+ public Map<String, Long> getMemory() {
+ return memory;
+ }
+
+ public void setMemory(Map<String, Long> memory) {
+ this.memory = memory;
+ }
+
+ public List<InterfaceInfo> getInterfaces() {
+ return interfaces;
+ }
+
+ public void setInterfaces(List<InterfaceInfo> interfaces) {
+ this.interfaces = interfaces;
+ }
+
+ public Diagnosis getDiagnosis() {
+ return diagnosis;
+ }
+
+ public void setDiagnosis(Diagnosis diagnosis) {
+ this.diagnosis = diagnosis;
+ }
+
+ public Map<String, Object> getCustoms() {
+ return customs;
+ }
+
+ public void setCustoms(Map<String, Object> customs) {
+ this.customs = customs;
+ }
+
+ public List<InstanceCacheResult> getProvidersCache() {
+ return providersCache;
+ }
+
+ public void setProvidersCache(List<InstanceCacheResult> providersCache) {
+ this.providersCache = providersCache;
+ }
+}
diff --git
a/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/event/ConsoleMonitorDataEvent.java
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/event/ConsoleMonitorDataEvent.java
new file mode 100644
index 0000000..73a68f5
--- /dev/null
+++
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/event/ConsoleMonitorDataEvent.java
@@ -0,0 +1,34 @@
+/*
+ * 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
+ *
+ * http://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.servicecomb.huaweicloud.dashboard.monitor.event;
+
+public class ConsoleMonitorDataEvent {
+ private String jsonData;
+
+ public ConsoleMonitorDataEvent(String jsonData) {
+ this.setJsonData(jsonData);
+ }
+
+ public String getJsonData() {
+ return jsonData;
+ }
+
+ public void setJsonData(String jsonData) {
+ this.jsonData = jsonData;
+ }
+}
diff --git
a/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/event/MonitorFailEvent.java
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/event/MonitorFailEvent.java
new file mode 100644
index 0000000..9c43414
--- /dev/null
+++
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/event/MonitorFailEvent.java
@@ -0,0 +1,35 @@
+/*
+ * 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
+ *
+ * http://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.servicecomb.huaweicloud.dashboard.monitor.event;
+
+public class MonitorFailEvent {
+
+ private String msg;
+
+ public MonitorFailEvent(String msg) {
+ this.msg = msg;
+ }
+
+ public String getMsg() {
+ return msg;
+ }
+
+ public void setMsg(String msg) {
+ this.msg = msg;
+ }
+}
diff --git
a/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/event/MonitorSuccEvent.java
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/event/MonitorSuccEvent.java
new file mode 100644
index 0000000..c3cac1d
--- /dev/null
+++
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/event/MonitorSuccEvent.java
@@ -0,0 +1,21 @@
+/*
+ * 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
+ *
+ * http://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.servicecomb.huaweicloud.dashboard.monitor.event;
+
+public class MonitorSuccEvent {
+}
diff --git
a/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/model/MonitorDaraProvider.java
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/model/MonitorDaraProvider.java
new file mode 100644
index 0000000..40dd950
--- /dev/null
+++
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/model/MonitorDaraProvider.java
@@ -0,0 +1,24 @@
+/*
+ * 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
+ *
+ * http://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.servicecomb.huaweicloud.dashboard.monitor.model;
+
+public interface MonitorDaraProvider {
+ String getURL();
+
+ Object getData();
+}
diff --git
a/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/model/MonitorDataPublisher.java
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/model/MonitorDataPublisher.java
new file mode 100644
index 0000000..a5b1012
--- /dev/null
+++
b/huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/model/MonitorDataPublisher.java
@@ -0,0 +1,26 @@
+/*
+ * 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
+ *
+ * http://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.servicecomb.huaweicloud.dashboard.monitor.model;
+
+public interface MonitorDataPublisher {
+ void publish(MonitorDaraProvider provider);
+
+ default void init() {
+
+ }
+}
diff --git
a/huawei-cloud/dashboard/src/main/resources/META-INF/services/org.apache.servicecomb.core.bootup.BootUpInformationCollector
b/huawei-cloud/dashboard/src/main/resources/META-INF/services/org.apache.servicecomb.core.bootup.BootUpInformationCollector
new file mode 100644
index 0000000..39268d6
--- /dev/null
+++
b/huawei-cloud/dashboard/src/main/resources/META-INF/services/org.apache.servicecomb.core.bootup.BootUpInformationCollector
@@ -0,0 +1,17 @@
+#
+# 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
+#
+# http://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.
+#
+org.apache.servicecomb.huaweicloud.dashboard.monitor.MonitorInformationCollector
\ No newline at end of file
diff --git
a/huawei-cloud/dashboard/src/main/resources/META-INF/services/org.apache.servicecomb.deployment.DeploymentProvider
b/huawei-cloud/dashboard/src/main/resources/META-INF/services/org.apache.servicecomb.deployment.DeploymentProvider
new file mode 100644
index 0000000..3854707
--- /dev/null
+++
b/huawei-cloud/dashboard/src/main/resources/META-INF/services/org.apache.servicecomb.deployment.DeploymentProvider
@@ -0,0 +1,17 @@
+#
+# 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
+#
+# http://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.
+#
+org.apache.servicecomb.huaweicloud.dashboard.monitor.MonitorDefaultDeploymentProvider
\ No newline at end of file
diff --git a/huawei-cloud/pom.xml
b/huawei-cloud/dashboard/src/main/resources/META-INF/spring/services.bean.xml
similarity index 52%
copy from huawei-cloud/pom.xml
copy to
huawei-cloud/dashboard/src/main/resources/META-INF/spring/services.bean.xml
index ecbbe59..89a1599 100644
--- a/huawei-cloud/pom.xml
+++
b/huawei-cloud/dashboard/src/main/resources/META-INF/spring/services.bean.xml
@@ -15,25 +15,11 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <groupId>org.apache.servicecomb</groupId>
- <artifactId>java-chassis-parent</artifactId>
- <version>2.2.0-SNAPSHOT</version>
- <relativePath>../parents/default</relativePath>
- </parent>
+<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
- <artifactId>huawei-cloud</artifactId>
- <name>Java Chassis::Huawei Cloud</name>
- <packaging>pom</packaging>
- <modelVersion>4.0.0</modelVersion>
-
- <modules>
- <module>servicestage</module>
- <module>environment</module>
- <module>dtm</module>
- </modules>
-
-</project>
\ No newline at end of file
+ <bean id="monitorStarterListener"
class="org.apache.servicecomb.huaweicloud.dashboard.monitor.MonitorBootListener"></bean>
+ <bean id="dataFactory"
class="org.apache.servicecomb.huaweicloud.dashboard.monitor.DataFactory"></bean>
+ <bean id="healthmonitorDataProvider"
class="org.apache.servicecomb.huaweicloud.dashboard.monitor.HealthMonitorDataProvider"></bean>
+ <bean id="defaultMonitorDataPublisher"
class="org.apache.servicecomb.huaweicloud.dashboard.monitor.DefaultMonitorDataPublisher"></bean>
+</beans>
diff --git a/huawei-cloud/pom.xml b/huawei-cloud/pom.xml
index ecbbe59..ec700fe 100644
--- a/huawei-cloud/pom.xml
+++ b/huawei-cloud/pom.xml
@@ -34,6 +34,7 @@
<module>servicestage</module>
<module>environment</module>
<module>dtm</module>
+ <module>dashboard</module>
</modules>
</project>
\ No newline at end of file