servicecomb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] zhengyangyong closed pull request #531: [SCB-252] Overwatch Integration
Date Thu, 01 Jan 1970 00:00:00 GMT
zhengyangyong closed pull request #531: [SCB-252] Overwatch Integration
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/531
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/java-chassis-dependencies/pom.xml b/java-chassis-dependencies/pom.xml
index 7e8aae035..717f6b831 100644
--- a/java-chassis-dependencies/pom.xml
+++ b/java-chassis-dependencies/pom.xml
@@ -983,11 +983,21 @@
         <artifactId>metrics-common</artifactId>
         <version>0.6.0-SNAPSHOT</version>
       </dependency>
+      <dependency>
+        <groupId>org.apache.servicecomb</groupId>
+        <artifactId>metrics-push</artifactId>
+        <version>0.6.0-SNAPSHOT</version>
+      </dependency>
       <dependency>
         <groupId>org.apache.servicecomb</groupId>
         <artifactId>metrics-prometheus</artifactId>
         <version>0.6.0-SNAPSHOT</version>
       </dependency>
+      <dependency>
+        <groupId>org.apache.servicecomb</groupId>
+        <artifactId>metrics-overwatch</artifactId>
+        <version>0.6.0-SNAPSHOT</version>
+      </dependency>
     </dependencies>
   </dependencyManagement>
 
diff --git a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/health/DefaultMicroserviceHealthChecker.java b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/health/DefaultMicroserviceHealthChecker.java
index 301bf157b..b8f777d6d 100644
--- a/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/health/DefaultMicroserviceHealthChecker.java
+++ b/metrics/metrics-core/src/main/java/org/apache/servicecomb/metrics/core/health/DefaultMicroserviceHealthChecker.java
@@ -34,7 +34,7 @@
 @Component
 public class DefaultMicroserviceHealthChecker implements HealthChecker {
 
-  private static Logger logger = LoggerFactory.getLogger(DefaultMicroserviceHealthChecker.class);
+  private static Logger LOGGER = LoggerFactory.getLogger(DefaultMicroserviceHealthChecker.class);
 
   @Override
   public String getName() {
@@ -59,7 +59,7 @@ private String getExtraData() {
           String.join(",", instance.getEndpoints())));
     } catch (Exception e) {
       String error = "unable load microservice info from RegistryUtils";
-      logger.error(error, e);
+      LOGGER.error(error, e);
       throw new InvocationException(Status.INTERNAL_SERVER_ERROR, error);
     }
   }
diff --git a/metrics/metrics-extension/metrics-push/pom.xml b/metrics/metrics-extension/metrics-push/pom.xml
new file mode 100644
index 000000000..24f76e410
--- /dev/null
+++ b/metrics/metrics-extension/metrics-push/pom.xml
@@ -0,0 +1,39 @@
+<?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>metrics-extension</artifactId>
+    <groupId>org.apache.servicecomb</groupId>
+    <version>0.6.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>metrics-push</artifactId>
+  <name>Java Chassis::Metrics::Extension::Push</name>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.servicecomb</groupId>
+      <artifactId>metrics-core</artifactId>
+    </dependency>
+  </dependencies>
+
+</project>
\ No newline at end of file
diff --git a/metrics/metrics-extension/metrics-push/src/main/java/org/apache/servicecomb/metrics/push/MetricsBootListener.java b/metrics/metrics-extension/metrics-push/src/main/java/org/apache/servicecomb/metrics/push/MetricsBootListener.java
new file mode 100644
index 000000000..7065fe466
--- /dev/null
+++ b/metrics/metrics-extension/metrics-push/src/main/java/org/apache/servicecomb/metrics/push/MetricsBootListener.java
@@ -0,0 +1,65 @@
+/*
+ * 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.metrics.push;
+
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+
+import java.util.concurrent.Executors;
+
+import org.apache.servicecomb.core.BootListener;
+import org.apache.servicecomb.metrics.core.publish.DataSource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class MetricsBootListener implements BootListener {
+  private static final Logger LOGGER = LoggerFactory.getLogger(MetricsBootListener.class);
+
+  private final MetricsPusher pusher;
+
+  private final DataSource dataSource;
+
+  private final long windowTime;
+
+  @Autowired
+  public MetricsBootListener(MetricsPusher pusher, DataSource dataSource) {
+    this.pusher = pusher;
+    this.dataSource = dataSource;
+    long windowTime = pusher.getWindowTime();
+    if (windowTime <= 0 || !dataSource.getAppliedWindowTime().contains(windowTime)) {
+      this.windowTime = dataSource.getAppliedWindowTime().get(0);
+      LOGGER.error("window time no set or illegal value, use datasource first window time : " + this.windowTime);
+    } else {
+      this.windowTime = windowTime;
+    }
+  }
+
+  @Override
+  public void onBootEvent(BootEvent event) {
+    if (EventType.BEFORE_REGISTRY.equals(event.getEventType())) {
+      final Runnable executor = this::push;
+      Executors.newScheduledThreadPool(1).scheduleWithFixedDelay(executor, 0, windowTime, MILLISECONDS);
+    }
+  }
+
+  private void push() {
+    pusher.push(dataSource.getRegistryMetric(windowTime));
+  }
+}
\ No newline at end of file
diff --git a/metrics/metrics-extension/metrics-push/src/main/java/org/apache/servicecomb/metrics/push/MetricsPusher.java b/metrics/metrics-extension/metrics-push/src/main/java/org/apache/servicecomb/metrics/push/MetricsPusher.java
new file mode 100644
index 000000000..df1cd1268
--- /dev/null
+++ b/metrics/metrics-extension/metrics-push/src/main/java/org/apache/servicecomb/metrics/push/MetricsPusher.java
@@ -0,0 +1,33 @@
+/*
+ * 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.metrics.push;
+
+import org.apache.servicecomb.metrics.common.RegistryMetric;
+
+//push metrics data to Monitor System such as zabbix
+public interface MetricsPusher {
+  //What's window time used for push,choose one from metrics window time
+  //If return less or equal 0,will auto select first metrics window time set as default
+  long getWindowTime();
+
+  //Service Name
+  String getServiceName();
+
+  //push implement
+  void push(RegistryMetric metric);
+}
diff --git a/metrics/metrics-extension/pom.xml b/metrics/metrics-extension/pom.xml
index ecd2f6e3a..e718b5f56 100644
--- a/metrics/metrics-extension/pom.xml
+++ b/metrics/metrics-extension/pom.xml
@@ -28,6 +28,9 @@
 
   <artifactId>metrics-extension</artifactId>
   <name>Java Chassis::Metrics::Extension</name>
+  <modules>
+    <module>metrics-push</module>
+  </modules>
   <packaging>pom</packaging>
 
 </project>
\ No newline at end of file
diff --git a/metrics/metrics-integration/metrics-overwatch/pom.xml b/metrics/metrics-integration/metrics-overwatch/pom.xml
new file mode 100644
index 000000000..427640881
--- /dev/null
+++ b/metrics/metrics-integration/metrics-overwatch/pom.xml
@@ -0,0 +1,39 @@
+<?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>metrics-integration</artifactId>
+    <groupId>org.apache.servicecomb</groupId>
+    <version>0.6.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>metrics-overwatch</artifactId>
+  <name>Java Chassis::Metrics::Integration::Overwatch</name>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.servicecomb</groupId>
+      <artifactId>metrics-push</artifactId>
+    </dependency>
+  </dependencies>
+
+</project>
\ No newline at end of file
diff --git a/metrics/metrics-integration/metrics-overwatch/src/main/java/org/apache/servicecomb/metrics/overwatch/OverwatchMetricsPublisher.java b/metrics/metrics-integration/metrics-overwatch/src/main/java/org/apache/servicecomb/metrics/overwatch/OverwatchMetricsPublisher.java
new file mode 100644
index 000000000..a3b0798cf
--- /dev/null
+++ b/metrics/metrics-integration/metrics-overwatch/src/main/java/org/apache/servicecomb/metrics/overwatch/OverwatchMetricsPublisher.java
@@ -0,0 +1,136 @@
+/*
+ * 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.metrics.overwatch;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.servicecomb.foundation.common.net.NetUtils;
+import org.apache.servicecomb.foundation.common.utils.JsonUtils;
+import org.apache.servicecomb.metrics.common.ConsumerInvocationMetric;
+import org.apache.servicecomb.metrics.common.HealthCheckResult;
+import org.apache.servicecomb.metrics.common.MetricsDimension;
+import org.apache.servicecomb.metrics.common.RegistryMetric;
+import org.apache.servicecomb.metrics.core.publish.HealthCheckerManager;
+import org.apache.servicecomb.metrics.overwatch.dto.InstanceStatus;
+import org.apache.servicecomb.metrics.overwatch.dto.SystemFailure;
+import org.apache.servicecomb.metrics.overwatch.dto.SystemStatus;
+import org.apache.servicecomb.metrics.push.MetricsPusher;
+import org.apache.servicecomb.provider.springmvc.reference.RestTemplateBuilder;
+import org.apache.servicecomb.serviceregistry.RegistryUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Component;
+import org.springframework.web.client.RestTemplate;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.netflix.config.DynamicPropertyFactory;
+
+@Component
+public class OverwatchMetricsPublisher implements MetricsPusher {
+  private static final Logger LOGGER = LoggerFactory.getLogger(OverwatchMetricsPublisher.class);
+
+  private static final String METRICS_OVERWATCH_ADDRESS = "servicecomb.metrics.overwatch.address";
+
+  private static final String METRICS_OVERWATCH_WINDOW_TIME = "servicecomb.metrics.overwatch.window_time";
+
+  private final String overwatchURL;
+
+  private final String overwatchFailureURL;
+
+  private final RestTemplate template;
+
+  private final HealthCheckerManager checkerManager;
+
+  public OverwatchMetricsPublisher(HealthCheckerManager checkerManager) {
+    this.checkerManager = checkerManager;
+    String url = DynamicPropertyFactory.getInstance()
+        .getStringProperty(METRICS_OVERWATCH_ADDRESS, "http://localhost:3000").get();
+
+    this.overwatchURL = url + "/stats/";
+    this.overwatchFailureURL = url + "/failure/";
+    this.template = RestTemplateBuilder.create();
+  }
+
+  @Override
+  public long getWindowTime() {
+    return DynamicPropertyFactory.getInstance().getLongProperty(METRICS_OVERWATCH_WINDOW_TIME, 0).get();
+  }
+
+  @Override
+  public String getServiceName() {
+    return RegistryUtils.getMicroservice().getServiceName();
+  }
+
+  @Override
+  public void push(RegistryMetric metric) {
+    SystemStatus systemStatus = convert(metric);
+    try {
+      send(this.overwatchURL, JsonUtils.writeValueAsString(systemStatus));
+    } catch (JsonProcessingException e) {
+      LOGGER.error("format status error", e);
+    }
+
+    Map<String, HealthCheckResult> checkResults = checkerManager.check();
+    for (Entry<String, HealthCheckResult> checkResult : checkResults.entrySet()) {
+      if (!checkResult.getValue().isHealthy()) {
+        SystemFailure failure = new SystemFailure((int) (System.currentTimeMillis() / 1000),
+            checkResult.getKey(), NetUtils.getHostAddress(), checkResult.getValue().getInformation(),
+            checkResult.getValue().getExtraData());
+        try {
+          send(this.overwatchFailureURL, JsonUtils.writeValueAsString(failure));
+        } catch (JsonProcessingException e) {
+          LOGGER.error("format status error", e);
+        }
+      }
+    }
+  }
+
+  private void send(String url, String content) {
+    HttpHeaders headers = new HttpHeaders();
+    headers.setContentType(MediaType.APPLICATION_JSON);
+    HttpEntity request = new HttpEntity<>(content, headers);
+    ResponseEntity<String> result = this.template.postForEntity(url, request, String.class);
+    if (result.getStatusCodeValue() != 200) {
+      LOGGER.error("push overwatch error : " + result.toString());
+    }
+  }
+
+  private SystemStatus convert(RegistryMetric metric) {
+    Map<String, Map<String, Map<String, InstanceStatus>>> allStatus = new HashMap<>();
+    Map<String, Map<String, InstanceStatus>> callServiceStatus = new HashMap<>();
+    allStatus.put(getServiceName(), callServiceStatus);
+    for (Entry<String, ConsumerInvocationMetric> entry : metric.getConsumerMetrics().entrySet()) {
+      String callServiceName = entry.getKey().split("\\.")[0];
+      Map<String, InstanceStatus> instanceStatus = callServiceStatus
+          .computeIfAbsent(callServiceName, s -> new HashMap<>());
+      InstanceStatus status = instanceStatus.computeIfAbsent(NetUtils.getHostAddress(), s -> new InstanceStatus(0, 0));
+      instanceStatus.put(NetUtils.getHostAddress(), new InstanceStatus(
+          (int) (entry.getValue().getConsumerCall().getTpsValue(MetricsDimension.DIMENSION_STATUS,
+              MetricsDimension.DIMENSION_STATUS_ALL).getValue() * 60) + status.getRpm(),
+          (int) (entry.getValue().getConsumerCall().getTpsValue(MetricsDimension.DIMENSION_STATUS,
+              MetricsDimension.DIMENSION_STATUS_SUCCESS_FAILED_FAILED).getValue() * 60) + status.getFpm()));
+    }
+    return new SystemStatus((int) (System.currentTimeMillis() / 1000), allStatus);
+  }
+}
diff --git a/metrics/metrics-integration/metrics-overwatch/src/main/java/org/apache/servicecomb/metrics/overwatch/dto/InstanceStatus.java b/metrics/metrics-integration/metrics-overwatch/src/main/java/org/apache/servicecomb/metrics/overwatch/dto/InstanceStatus.java
new file mode 100644
index 000000000..2da620fb3
--- /dev/null
+++ b/metrics/metrics-integration/metrics-overwatch/src/main/java/org/apache/servicecomb/metrics/overwatch/dto/InstanceStatus.java
@@ -0,0 +1,37 @@
+/*
+ * 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.metrics.overwatch.dto;
+
+public class InstanceStatus {
+  private final Integer rpm;
+
+  private final Integer fpm;
+
+  public Integer getRpm() {
+    return rpm;
+  }
+
+  public Integer getFpm() {
+    return fpm;
+  }
+
+  public InstanceStatus(Integer rpm, Integer fpm) {
+    this.rpm = rpm;
+    this.fpm = fpm;
+  }
+}
diff --git a/metrics/metrics-integration/metrics-overwatch/src/main/java/org/apache/servicecomb/metrics/overwatch/dto/SystemFailure.java b/metrics/metrics-integration/metrics-overwatch/src/main/java/org/apache/servicecomb/metrics/overwatch/dto/SystemFailure.java
new file mode 100644
index 000000000..638580542
--- /dev/null
+++ b/metrics/metrics-integration/metrics-overwatch/src/main/java/org/apache/servicecomb/metrics/overwatch/dto/SystemFailure.java
@@ -0,0 +1,58 @@
+/*
+ * 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.metrics.overwatch.dto;
+
+public class SystemFailure {
+  private final Integer time;
+
+  private final String system;
+
+  private final String host;
+
+  private final String url;
+
+  private final String status;
+
+  public Integer getTime() {
+    return time;
+  }
+
+  public String getSystem() {
+    return system;
+  }
+
+  public String getHost() {
+    return host;
+  }
+
+  public String getUrl() {
+    return url;
+  }
+
+  public String getStatus() {
+    return status;
+  }
+
+  public SystemFailure(Integer time, String system, String host, String url, String status) {
+    this.time = time;
+    this.system = system;
+    this.host = host;
+    this.url = url;
+    this.status = status;
+  }
+}
diff --git a/metrics/metrics-integration/metrics-overwatch/src/main/java/org/apache/servicecomb/metrics/overwatch/dto/SystemStatus.java b/metrics/metrics-integration/metrics-overwatch/src/main/java/org/apache/servicecomb/metrics/overwatch/dto/SystemStatus.java
new file mode 100644
index 000000000..09c98452f
--- /dev/null
+++ b/metrics/metrics-integration/metrics-overwatch/src/main/java/org/apache/servicecomb/metrics/overwatch/dto/SystemStatus.java
@@ -0,0 +1,40 @@
+/*
+ * 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.metrics.overwatch.dto;
+
+import java.util.Map;
+
+public class SystemStatus {
+  private final Integer time;
+
+  private final Map<String, Map<String, Map<String, InstanceStatus>>> stats;
+
+  public Integer getTime() {
+    return time;
+  }
+
+  public Map<String, Map<String, Map<String, InstanceStatus>>> getStats() {
+    return stats;
+  }
+
+  public SystemStatus(Integer time,
+      Map<String, Map<String, Map<String, InstanceStatus>>> stats) {
+    this.time = time;
+    this.stats = stats;
+  }
+}
diff --git a/metrics/metrics-integration/metrics-prometheus/pom.xml b/metrics/metrics-integration/metrics-prometheus/pom.xml
index 0ff0beaaa..f8db4b609 100644
--- a/metrics/metrics-integration/metrics-prometheus/pom.xml
+++ b/metrics/metrics-integration/metrics-prometheus/pom.xml
@@ -27,7 +27,7 @@
   <modelVersion>4.0.0</modelVersion>
 
   <artifactId>metrics-prometheus</artifactId>
-  <name>Java Chassis::Metrics::Prometheus Integration</name>
+  <name>Java Chassis::Metrics::Integration::Prometheus</name>
 
   <dependencies>
     <dependency>
diff --git a/metrics/metrics-integration/pom.xml b/metrics/metrics-integration/pom.xml
index 32375035b..b12f8e204 100644
--- a/metrics/metrics-integration/pom.xml
+++ b/metrics/metrics-integration/pom.xml
@@ -32,6 +32,7 @@
 
   <modules>
     <module>metrics-prometheus</module>
+    <module>metrics-overwatch</module>
   </modules>
 
 </project>
diff --git a/samples/metrics-overwatch-sample/metrics-overwatch-approver/pom.xml b/samples/metrics-overwatch-sample/metrics-overwatch-approver/pom.xml
new file mode 100644
index 000000000..7497457cf
--- /dev/null
+++ b/samples/metrics-overwatch-sample/metrics-overwatch-approver/pom.xml
@@ -0,0 +1,32 @@
+<?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>metrics-overwatch-sample</artifactId>
+    <groupId>org.apache.servicecomb.samples</groupId>
+    <version>0.6.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>metrics-overwatch-approver</artifactId>
+
+
+</project>
\ No newline at end of file
diff --git a/samples/metrics-overwatch-sample/metrics-overwatch-approver/src/main/java/org/apache/servicecomb/samples/overwatch/approver/ApproverService.java b/samples/metrics-overwatch-sample/metrics-overwatch-approver/src/main/java/org/apache/servicecomb/samples/overwatch/approver/ApproverService.java
new file mode 100644
index 000000000..21ef85286
--- /dev/null
+++ b/samples/metrics-overwatch-sample/metrics-overwatch-approver/src/main/java/org/apache/servicecomb/samples/overwatch/approver/ApproverService.java
@@ -0,0 +1,44 @@
+/*
+ * 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.samples.overwatch.approver;
+
+import org.apache.servicecomb.provider.rest.common.RestSchema;
+import org.apache.servicecomb.provider.springmvc.reference.RestTemplateBuilder;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.client.RestTemplate;
+
+@RestSchema(schemaId = "approverServiceEndpoint")
+@RequestMapping(path = "/")
+public class ApproverService {
+
+  private static RestTemplate restTemplate = RestTemplateBuilder.create();
+
+  @GetMapping(path = "/audit")
+  public Boolean audit(double amount) {
+    if (amount <= 10000) {
+      boolean resultSupervisor = restTemplate.getForObject("cse://Supervisor/audit?amount=" +
+          String.format("%.2f", amount), Boolean.class);
+
+      boolean resultFinance = restTemplate.getForObject("cse://Finance/audit?amount=" +
+          String.format("%.2f", amount), Boolean.class);
+      return resultFinance && resultSupervisor;
+    }
+    return false;
+  }
+}
diff --git a/samples/metrics-overwatch-sample/metrics-overwatch-approver/src/main/java/org/apache/servicecomb/samples/overwatch/approver/ApproverServiceApplication.java b/samples/metrics-overwatch-sample/metrics-overwatch-approver/src/main/java/org/apache/servicecomb/samples/overwatch/approver/ApproverServiceApplication.java
new file mode 100644
index 000000000..a0028c24c
--- /dev/null
+++ b/samples/metrics-overwatch-sample/metrics-overwatch-approver/src/main/java/org/apache/servicecomb/samples/overwatch/approver/ApproverServiceApplication.java
@@ -0,0 +1,30 @@
+/*
+ * 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.samples.overwatch.approver;
+
+import org.apache.servicecomb.springboot.starter.provider.EnableServiceComb;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+@EnableServiceComb
+public class ApproverServiceApplication {
+  public static void main(String[] args) {
+    SpringApplication.run(ApproverServiceApplication.class, args);
+  }
+}
diff --git a/samples/metrics-overwatch-sample/metrics-overwatch-approver/src/main/java/org/apache/servicecomb/samples/overwatch/approver/MySQLHealthChecker.java b/samples/metrics-overwatch-sample/metrics-overwatch-approver/src/main/java/org/apache/servicecomb/samples/overwatch/approver/MySQLHealthChecker.java
new file mode 100644
index 000000000..da8a3e7df
--- /dev/null
+++ b/samples/metrics-overwatch-sample/metrics-overwatch-approver/src/main/java/org/apache/servicecomb/samples/overwatch/approver/MySQLHealthChecker.java
@@ -0,0 +1,72 @@
+/*
+ * 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.samples.overwatch.approver;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+
+import org.apache.servicecomb.metrics.common.HealthCheckResult;
+import org.apache.servicecomb.metrics.common.HealthChecker;
+import org.springframework.stereotype.Component;
+
+import com.netflix.config.DynamicPropertyFactory;
+
+@Component
+public class MySQLHealthChecker implements HealthChecker {
+
+  private final String address;
+
+  private final String user;
+
+  private final String password;
+
+  public MySQLHealthChecker() {
+    this.address = DynamicPropertyFactory.getInstance().getStringProperty("mysql.address",
+        "jdbc:mysql://localhost:3306/approver_db?useSSL=false").get();
+    this.user = DynamicPropertyFactory.getInstance().getStringProperty("mysql.user",
+        "root").get();
+    this.password = DynamicPropertyFactory.getInstance().getStringProperty("mysql.password",
+        "password").get();
+  }
+
+  @Override
+  public String getName() {
+    return "approver_db";
+  }
+
+  @Override
+  public HealthCheckResult check() {
+    Connection connection = null;
+    try {
+      connection = DriverManager.getConnection(address, user, password);
+      return new HealthCheckResult(true, "mysql health check", "");
+    } catch (SQLException e) {
+      e.printStackTrace();
+      return new HealthCheckResult(false, "mysql health check", e.toString());
+    } finally {
+      if (connection != null) {
+        try {
+          connection.close();
+        } catch (SQLException e) {
+          e.printStackTrace();
+        }
+      }
+    }
+  }
+}
diff --git a/samples/metrics-overwatch-sample/metrics-overwatch-approver/src/main/resources/microservice.yaml b/samples/metrics-overwatch-sample/metrics-overwatch-approver/src/main/resources/microservice.yaml
new file mode 100644
index 000000000..a2b836f48
--- /dev/null
+++ b/samples/metrics-overwatch-sample/metrics-overwatch-approver/src/main/resources/microservice.yaml
@@ -0,0 +1,37 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+APPLICATION_ID: overwatch
+service_description:
+  name: Approver
+  version: 0.0.1
+cse:
+  service:
+    registry:
+      address: http://127.0.0.1:30100
+  rest:
+    address: 0.0.0.0:9092
+
+servicecomb:
+  metrics:
+    overwatch:
+      address: http://192.241.237.48:3000
+
+mysql:
+  address: jdbc:mysql://192.168.99.100:32702/approver_db?useSSL=false
+  user: root
+  password: pwd
diff --git a/samples/metrics-overwatch-sample/metrics-overwatch-finance/pom.xml b/samples/metrics-overwatch-sample/metrics-overwatch-finance/pom.xml
new file mode 100644
index 000000000..7439f02ac
--- /dev/null
+++ b/samples/metrics-overwatch-sample/metrics-overwatch-finance/pom.xml
@@ -0,0 +1,32 @@
+<?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>metrics-overwatch-sample</artifactId>
+    <groupId>org.apache.servicecomb.samples</groupId>
+    <version>0.6.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>metrics-overwatch-finance</artifactId>
+
+
+</project>
\ No newline at end of file
diff --git a/samples/metrics-overwatch-sample/metrics-overwatch-finance/src/main/java/org/apache/servicecomb/samples/overwatch/finance/FinanceService.java b/samples/metrics-overwatch-sample/metrics-overwatch-finance/src/main/java/org/apache/servicecomb/samples/overwatch/finance/FinanceService.java
new file mode 100644
index 000000000..2d8cdb831
--- /dev/null
+++ b/samples/metrics-overwatch-sample/metrics-overwatch-finance/src/main/java/org/apache/servicecomb/samples/overwatch/finance/FinanceService.java
@@ -0,0 +1,33 @@
+/*
+ * 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.samples.overwatch.finance;
+
+import org.apache.servicecomb.provider.rest.common.RestSchema;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+@RestSchema(schemaId = "financeServiceEndpoint")
+@RequestMapping(path = "/")
+public class FinanceService {
+
+  @GetMapping(path = "/audit")
+  public Boolean audit(double amount) {
+    return amount <= 6000;
+  }
+}
diff --git a/samples/metrics-overwatch-sample/metrics-overwatch-finance/src/main/java/org/apache/servicecomb/samples/overwatch/finance/FinanceServiceApplication.java b/samples/metrics-overwatch-sample/metrics-overwatch-finance/src/main/java/org/apache/servicecomb/samples/overwatch/finance/FinanceServiceApplication.java
new file mode 100644
index 000000000..d128e0241
--- /dev/null
+++ b/samples/metrics-overwatch-sample/metrics-overwatch-finance/src/main/java/org/apache/servicecomb/samples/overwatch/finance/FinanceServiceApplication.java
@@ -0,0 +1,30 @@
+/*
+ * 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.samples.overwatch.finance;
+
+import org.apache.servicecomb.springboot.starter.provider.EnableServiceComb;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+@EnableServiceComb
+public class FinanceServiceApplication {
+  public static void main(String[] args) {
+    SpringApplication.run(FinanceServiceApplication.class, args);
+  }
+}
diff --git a/samples/metrics-overwatch-sample/metrics-overwatch-finance/src/main/java/org/apache/servicecomb/samples/overwatch/finance/MySQLHealthChecker.java b/samples/metrics-overwatch-sample/metrics-overwatch-finance/src/main/java/org/apache/servicecomb/samples/overwatch/finance/MySQLHealthChecker.java
new file mode 100644
index 000000000..53861ab10
--- /dev/null
+++ b/samples/metrics-overwatch-sample/metrics-overwatch-finance/src/main/java/org/apache/servicecomb/samples/overwatch/finance/MySQLHealthChecker.java
@@ -0,0 +1,72 @@
+/*
+ * 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.samples.overwatch.finance;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+
+import org.apache.servicecomb.metrics.common.HealthCheckResult;
+import org.apache.servicecomb.metrics.common.HealthChecker;
+import org.springframework.stereotype.Component;
+
+import com.netflix.config.DynamicPropertyFactory;
+
+@Component
+public class MySQLHealthChecker implements HealthChecker {
+
+  private final String address;
+
+  private final String user;
+
+  private final String password;
+
+  public MySQLHealthChecker() {
+    this.address = DynamicPropertyFactory.getInstance().getStringProperty("mysql.address",
+        "jdbc:mysql://localhost:3306/finance_db?useSSL=false").get();
+    this.user = DynamicPropertyFactory.getInstance().getStringProperty("mysql.user",
+        "root").get();
+    this.password = DynamicPropertyFactory.getInstance().getStringProperty("mysql.password",
+        "password").get();
+  }
+
+  @Override
+  public String getName() {
+    return "finance_db";
+  }
+
+  @Override
+  public HealthCheckResult check() {
+    Connection connection = null;
+    try {
+      connection = DriverManager.getConnection(address, user, password);
+      return new HealthCheckResult(true, "mysql health check", "");
+    } catch (SQLException e) {
+      e.printStackTrace();
+      return new HealthCheckResult(false, "mysql health check", e.toString());
+    } finally {
+      if (connection != null) {
+        try {
+          connection.close();
+        } catch (SQLException e) {
+          e.printStackTrace();
+        }
+      }
+    }
+  }
+}
diff --git a/samples/metrics-overwatch-sample/metrics-overwatch-finance/src/main/resources/microservice.yaml b/samples/metrics-overwatch-sample/metrics-overwatch-finance/src/main/resources/microservice.yaml
new file mode 100644
index 000000000..a557aa63e
--- /dev/null
+++ b/samples/metrics-overwatch-sample/metrics-overwatch-finance/src/main/resources/microservice.yaml
@@ -0,0 +1,37 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+APPLICATION_ID: overwatch
+service_description:
+  name: Finance
+  version: 0.0.1
+cse:
+  service:
+    registry:
+      address: http://127.0.0.1:30100
+  rest:
+    address: 0.0.0.0:9094
+
+servicecomb:
+  metrics:
+    overwatch:
+      address: http://192.241.237.48:3000
+
+mysql:
+  address: jdbc:mysql://192.168.99.100:32704/finance_db?useSSL=false
+  user: root
+  password: pwd
\ No newline at end of file
diff --git a/samples/metrics-overwatch-sample/metrics-overwatch-gateway/pom.xml b/samples/metrics-overwatch-sample/metrics-overwatch-gateway/pom.xml
new file mode 100644
index 000000000..ce45a76a4
--- /dev/null
+++ b/samples/metrics-overwatch-sample/metrics-overwatch-gateway/pom.xml
@@ -0,0 +1,32 @@
+<?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>metrics-overwatch-sample</artifactId>
+    <groupId>org.apache.servicecomb.samples</groupId>
+    <version>0.6.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>metrics-overwatch-gateway</artifactId>
+
+
+</project>
\ No newline at end of file
diff --git a/samples/metrics-overwatch-sample/metrics-overwatch-gateway/src/main/java/org/apache/servicecomb/samples/overwatch/gateway/GatewayService.java b/samples/metrics-overwatch-sample/metrics-overwatch-gateway/src/main/java/org/apache/servicecomb/samples/overwatch/gateway/GatewayService.java
new file mode 100644
index 000000000..be9332f04
--- /dev/null
+++ b/samples/metrics-overwatch-sample/metrics-overwatch-gateway/src/main/java/org/apache/servicecomb/samples/overwatch/gateway/GatewayService.java
@@ -0,0 +1,39 @@
+/*
+ * 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.samples.overwatch.gateway;
+
+import org.apache.servicecomb.provider.rest.common.RestSchema;
+import org.apache.servicecomb.provider.springmvc.reference.RestTemplateBuilder;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.client.RestTemplate;
+
+@RestSchema(schemaId = "gatewayServiceEndpoint")
+@RequestMapping(path = "/")
+public class GatewayService {
+
+  private static RestTemplate restTemplate = RestTemplateBuilder.create();
+
+  @GetMapping(path = "/audit")
+  public Boolean audit(double amount) {
+    boolean result = restTemplate.getForObject("cse://Approver/audit?amount=" +
+        String.format("%.2f", amount), Boolean.class);
+    return result;
+  }
+}
diff --git a/samples/metrics-overwatch-sample/metrics-overwatch-gateway/src/main/java/org/apache/servicecomb/samples/overwatch/gateway/GatewayServiceApplication.java b/samples/metrics-overwatch-sample/metrics-overwatch-gateway/src/main/java/org/apache/servicecomb/samples/overwatch/gateway/GatewayServiceApplication.java
new file mode 100644
index 000000000..b145c1c59
--- /dev/null
+++ b/samples/metrics-overwatch-sample/metrics-overwatch-gateway/src/main/java/org/apache/servicecomb/samples/overwatch/gateway/GatewayServiceApplication.java
@@ -0,0 +1,30 @@
+/*
+ * 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.samples.overwatch.gateway;
+
+import org.apache.servicecomb.springboot.starter.provider.EnableServiceComb;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+@EnableServiceComb
+public class GatewayServiceApplication {
+  public static void main(String[] args) {
+    SpringApplication.run(GatewayServiceApplication.class, args);
+  }
+}
diff --git a/samples/metrics-overwatch-sample/metrics-overwatch-gateway/src/main/java/org/apache/servicecomb/samples/overwatch/gateway/MySQLHealthChecker.java b/samples/metrics-overwatch-sample/metrics-overwatch-gateway/src/main/java/org/apache/servicecomb/samples/overwatch/gateway/MySQLHealthChecker.java
new file mode 100644
index 000000000..462e6880f
--- /dev/null
+++ b/samples/metrics-overwatch-sample/metrics-overwatch-gateway/src/main/java/org/apache/servicecomb/samples/overwatch/gateway/MySQLHealthChecker.java
@@ -0,0 +1,72 @@
+/*
+ * 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.samples.overwatch.gateway;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+
+import org.apache.servicecomb.metrics.common.HealthCheckResult;
+import org.apache.servicecomb.metrics.common.HealthChecker;
+import org.springframework.stereotype.Component;
+
+import com.netflix.config.DynamicPropertyFactory;
+
+@Component
+public class MySQLHealthChecker implements HealthChecker {
+
+  private final String address;
+
+  private final String user;
+
+  private final String password;
+
+  public MySQLHealthChecker() {
+    this.address = DynamicPropertyFactory.getInstance().getStringProperty("mysql.address",
+        "jdbc:mysql://localhost:3306/gateway_db?useSSL=false").get();
+    this.user = DynamicPropertyFactory.getInstance().getStringProperty("mysql.user",
+        "root").get();
+    this.password = DynamicPropertyFactory.getInstance().getStringProperty("mysql.password",
+        "password").get();
+  }
+
+  @Override
+  public String getName() {
+    return "gateway_db";
+  }
+
+  @Override
+  public HealthCheckResult check() {
+    Connection connection = null;
+    try {
+      connection = DriverManager.getConnection(address, user, password);
+      return new HealthCheckResult(true, "mysql health check", "");
+    } catch (SQLException e) {
+      e.printStackTrace();
+      return new HealthCheckResult(false, "mysql health check", e.toString());
+    } finally {
+      if (connection != null) {
+        try {
+          connection.close();
+        } catch (SQLException e) {
+          e.printStackTrace();
+        }
+      }
+    }
+  }
+}
diff --git a/samples/metrics-overwatch-sample/metrics-overwatch-gateway/src/main/resources/microservice.yaml b/samples/metrics-overwatch-sample/metrics-overwatch-gateway/src/main/resources/microservice.yaml
new file mode 100644
index 000000000..bab258450
--- /dev/null
+++ b/samples/metrics-overwatch-sample/metrics-overwatch-gateway/src/main/resources/microservice.yaml
@@ -0,0 +1,37 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+APPLICATION_ID: overwatch
+service_description:
+  name: Gateway
+  version: 0.0.1
+cse:
+  service:
+    registry:
+      address: http://127.0.0.1:30100
+  rest:
+    address: 0.0.0.0:9091
+
+servicecomb:
+  metrics:
+    overwatch:
+      address: http://192.241.237.48:3000
+
+mysql:
+  address: jdbc:mysql://192.168.99.100:32701/gateway_db?useSSL=false
+  user: root
+  password: pwd
\ No newline at end of file
diff --git a/samples/metrics-overwatch-sample/metrics-overwatch-supervisor/pom.xml b/samples/metrics-overwatch-sample/metrics-overwatch-supervisor/pom.xml
new file mode 100644
index 000000000..166c300b8
--- /dev/null
+++ b/samples/metrics-overwatch-sample/metrics-overwatch-supervisor/pom.xml
@@ -0,0 +1,32 @@
+<?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>metrics-overwatch-sample</artifactId>
+    <groupId>org.apache.servicecomb.samples</groupId>
+    <version>0.6.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>metrics-overwatch-supervisor</artifactId>
+
+
+</project>
\ No newline at end of file
diff --git a/samples/metrics-overwatch-sample/metrics-overwatch-supervisor/src/main/java/org/apache/servicecomb/samples/overwatch/supervisor/MySQLHealthChecker.java b/samples/metrics-overwatch-sample/metrics-overwatch-supervisor/src/main/java/org/apache/servicecomb/samples/overwatch/supervisor/MySQLHealthChecker.java
new file mode 100644
index 000000000..f9baae7f2
--- /dev/null
+++ b/samples/metrics-overwatch-sample/metrics-overwatch-supervisor/src/main/java/org/apache/servicecomb/samples/overwatch/supervisor/MySQLHealthChecker.java
@@ -0,0 +1,72 @@
+/*
+ * 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.samples.overwatch.supervisor;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+
+import org.apache.servicecomb.metrics.common.HealthCheckResult;
+import org.apache.servicecomb.metrics.common.HealthChecker;
+import org.springframework.stereotype.Component;
+
+import com.netflix.config.DynamicPropertyFactory;
+
+@Component
+public class MySQLHealthChecker implements HealthChecker {
+
+  private final String address;
+
+  private final String user;
+
+  private final String password;
+
+  public MySQLHealthChecker() {
+    this.address = DynamicPropertyFactory.getInstance().getStringProperty("mysql.address",
+        "jdbc:mysql://localhost:3306/supervisor_db?useSSL=false").get();
+    this.user = DynamicPropertyFactory.getInstance().getStringProperty("mysql.user",
+        "root").get();
+    this.password = DynamicPropertyFactory.getInstance().getStringProperty("mysql.password",
+        "password").get();
+  }
+
+  @Override
+  public String getName() {
+    return "supervisor_db";
+  }
+
+  @Override
+  public HealthCheckResult check() {
+    Connection connection = null;
+    try {
+      connection = DriverManager.getConnection(address, user, password);
+      return new HealthCheckResult(true, "mysql health check", "");
+    } catch (SQLException e) {
+      e.printStackTrace();
+      return new HealthCheckResult(false, "mysql health check", e.toString());
+    } finally {
+      if (connection != null) {
+        try {
+          connection.close();
+        } catch (SQLException e) {
+          e.printStackTrace();
+        }
+      }
+    }
+  }
+}
diff --git a/samples/metrics-overwatch-sample/metrics-overwatch-supervisor/src/main/java/org/apache/servicecomb/samples/overwatch/supervisor/SupervisorService.java b/samples/metrics-overwatch-sample/metrics-overwatch-supervisor/src/main/java/org/apache/servicecomb/samples/overwatch/supervisor/SupervisorService.java
new file mode 100644
index 000000000..8ef71a5f1
--- /dev/null
+++ b/samples/metrics-overwatch-sample/metrics-overwatch-supervisor/src/main/java/org/apache/servicecomb/samples/overwatch/supervisor/SupervisorService.java
@@ -0,0 +1,33 @@
+/*
+ * 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.samples.overwatch.supervisor;
+
+import org.apache.servicecomb.provider.rest.common.RestSchema;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+@RestSchema(schemaId = "supervisorServiceEndpoint")
+@RequestMapping(path = "/")
+public class SupervisorService {
+
+  @GetMapping(path = "/audit")
+  public Boolean audit(double amount) {
+    return amount <= 8000;
+  }
+}
diff --git a/samples/metrics-overwatch-sample/metrics-overwatch-supervisor/src/main/java/org/apache/servicecomb/samples/overwatch/supervisor/SupervisorServiceApplication.java b/samples/metrics-overwatch-sample/metrics-overwatch-supervisor/src/main/java/org/apache/servicecomb/samples/overwatch/supervisor/SupervisorServiceApplication.java
new file mode 100644
index 000000000..548d2fa01
--- /dev/null
+++ b/samples/metrics-overwatch-sample/metrics-overwatch-supervisor/src/main/java/org/apache/servicecomb/samples/overwatch/supervisor/SupervisorServiceApplication.java
@@ -0,0 +1,30 @@
+/*
+ * 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.samples.overwatch.supervisor;
+
+import org.apache.servicecomb.springboot.starter.provider.EnableServiceComb;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+@EnableServiceComb
+public class SupervisorServiceApplication {
+  public static void main(String[] args) {
+    SpringApplication.run(SupervisorServiceApplication.class, args);
+  }
+}
diff --git a/samples/metrics-overwatch-sample/metrics-overwatch-supervisor/src/main/resources/microservice.yaml b/samples/metrics-overwatch-sample/metrics-overwatch-supervisor/src/main/resources/microservice.yaml
new file mode 100644
index 000000000..8e0cf7eff
--- /dev/null
+++ b/samples/metrics-overwatch-sample/metrics-overwatch-supervisor/src/main/resources/microservice.yaml
@@ -0,0 +1,37 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+APPLICATION_ID: overwatch
+service_description:
+  name: Supervisor
+  version: 0.0.1
+cse:
+  service:
+    registry:
+      address: http://127.0.0.1:30100
+  rest:
+    address: 0.0.0.0:9093
+
+servicecomb:
+  metrics:
+    overwatch:
+      address: http://192.241.237.48:3000
+
+mysql:
+  address: jdbc:mysql://192.168.99.100:32703/supervisor_db?useSSL=false
+  user: root
+  password: pwd
\ No newline at end of file
diff --git a/samples/metrics-overwatch-sample/pom.xml b/samples/metrics-overwatch-sample/pom.xml
new file mode 100644
index 000000000..875cb3aa0
--- /dev/null
+++ b/samples/metrics-overwatch-sample/pom.xml
@@ -0,0 +1,90 @@
+<?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>samples</artifactId>
+    <groupId>org.apache.servicecomb.samples</groupId>
+    <version>0.6.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <name>Java Chassis::Samples::Overwatch</name>
+  <modules>
+    <module>metrics-overwatch-gateway</module>
+    <module>metrics-overwatch-approver</module>
+    <module>metrics-overwatch-supervisor</module>
+    <module>metrics-overwatch-finance</module>
+  </modules>
+  <packaging>pom</packaging>
+
+  <artifactId>metrics-overwatch-sample</artifactId>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.servicecomb</groupId>
+      <artifactId>spring-boot-starter-provider</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.hibernate</groupId>
+      <artifactId>hibernate-validator</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>mysql</groupId>
+      <artifactId>mysql-connector-java</artifactId>
+      <version>6.0.6</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.servicecomb</groupId>
+      <artifactId>metrics-overwatch</artifactId>
+    </dependency>
+
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <goals>
+              <goal>repackage</goal>
+            </goals>
+            <configuration>
+              <outputDirectory>${project.build.directory}/bin</outputDirectory>
+              <classifier>exec</classifier>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.commonjava.maven.plugins</groupId>
+        <artifactId>directory-maven-plugin</artifactId>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>
\ No newline at end of file
diff --git a/samples/pom.xml b/samples/pom.xml
index 2c60a7ced..e00cd36b3 100644
--- a/samples/pom.xml
+++ b/samples/pom.xml
@@ -37,6 +37,7 @@
     <module>metrics-write-file-sample</module>
     <module>metrics-extend-healthcheck</module>
     <module>config-apollo-sample</module>
+    <module>metrics-overwatch-sample</module>
     <module>custom-business-metrics</module>
   </modules>
 
diff --git a/samples/springmvc-sample/springmvc-consumer/pom.xml b/samples/springmvc-sample/springmvc-consumer/pom.xml
index 669d8c609..ac15127d3 100644
--- a/samples/springmvc-sample/springmvc-consumer/pom.xml
+++ b/samples/springmvc-sample/springmvc-consumer/pom.xml
@@ -60,5 +60,11 @@
             <groupId>org.apache.servicecomb.samples</groupId>
             <artifactId>common-schema</artifactId>
         </dependency>
+
+        <dependency>
+          <groupId>org.apache.servicecomb</groupId>
+          <artifactId>metrics-overwatch</artifactId>
+        </dependency>
+
       </dependencies>
 </project>
diff --git a/samples/springmvc-sample/springmvc-consumer/src/main/java/org/apache/servicecomb/samples/springmvc/consumer/SpringmvcConsumerMain.java b/samples/springmvc-sample/springmvc-consumer/src/main/java/org/apache/servicecomb/samples/springmvc/consumer/SpringmvcConsumerMain.java
index d47454f5c..9dc215a63 100644
--- a/samples/springmvc-sample/springmvc-consumer/src/main/java/org/apache/servicecomb/samples/springmvc/consumer/SpringmvcConsumerMain.java
+++ b/samples/springmvc-sample/springmvc-consumer/src/main/java/org/apache/servicecomb/samples/springmvc/consumer/SpringmvcConsumerMain.java
@@ -16,6 +16,8 @@
  */
 package org.apache.servicecomb.samples.springmvc.consumer;
 
+import java.util.Random;
+
 import org.apache.servicecomb.foundation.common.utils.BeanUtils;
 import org.apache.servicecomb.foundation.common.utils.Log4jUtils;
 import org.apache.servicecomb.provider.pojo.RpcReference;
@@ -35,21 +37,33 @@
 
   public static void main(String[] args) throws Exception {
     init();
-    Person person = new Person();
-    person.setName("ServiceComb/Java Chassis");
-
-    // RestTemplate Consumer or POJO Consumer. You can choose whatever you like
-    // RestTemplate Consumer
-    String sayHiResult =
-        restTemplate.postForObject("cse://springmvc/springmvchello/sayhi?name=Java Chassis", null, String.class);
-    String sayHelloResult = restTemplate.postForObject("cse://springmvc/springmvchello/sayhello", person, String.class);
-    System.out.println("RestTemplate Consumer or POJO Consumer.  You can choose whatever you like.");
-    System.out.println("RestTemplate consumer sayhi services: " + sayHiResult);
-    System.out.println("RestTemplate consumer sayhello services: " + sayHelloResult);
-
-    // POJO Consumer
-    System.out.println("POJO consumer sayhi services: " + hello.sayHi("Java Chassis"));
-    System.out.println("POJO consumer sayhi services: " + hello.sayHello(person));
+
+    Random r = new Random();
+
+    while (true) {
+
+      Thread.sleep(r.nextInt(1000));
+
+      try {
+        Person person = new Person();
+        person.setName("ServiceComb/Java Chassis");
+
+        // RestTemplate Consumer or POJO Consumer. You can choose whatever you like
+        // RestTemplate Consumer
+        String sayHiResult =
+            restTemplate.postForObject("cse://springmvc/springmvchello/sayhi?name=Java Chassis", null, String.class);
+        String sayHelloResult = restTemplate
+            .postForObject("cse://springmvc/springmvchello/sayhello", person, String.class);
+        System.out.println("RestTemplate Consumer or POJO Consumer.  You can choose whatever you like.");
+        System.out.println("RestTemplate consumer sayhi services: " + sayHiResult);
+        System.out.println("RestTemplate consumer sayhello services: " + sayHelloResult);
+
+        // POJO Consumer
+        System.out.println("POJO consumer sayhi services: " + hello.sayHi("Java Chassis"));
+        System.out.println("POJO consumer sayhi services: " + hello.sayHello(person));
+      }
+      catch (Exception e){}
+    }
   }
 
   public static void init() throws Exception {
diff --git a/samples/springmvc-sample/springmvc-consumer/src/main/resources/microservice.yaml b/samples/springmvc-sample/springmvc-consumer/src/main/resources/microservice.yaml
index 8c25b99cb..744ffd52f 100644
--- a/samples/springmvc-sample/springmvc-consumer/src/main/resources/microservice.yaml
+++ b/samples/springmvc-sample/springmvc-consumer/src/main/resources/microservice.yaml
@@ -30,3 +30,8 @@ cse:
   isolation:
     Consumer:
       enabled: false
+
+servicecomb:
+  metrics:
+    overwatch:
+      address: 192.241.237.48:3000


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message