You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2022/01/27 07:41:18 UTC

[skywalking] branch master updated: E2E verify OAP cluster model data aggregation and fix `SelfRemoteClient` self observing metrics. (#8481)

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git


The following commit(s) were added to refs/heads/master by this push:
     new 473debf  E2E verify OAP cluster model data aggregation and fix `SelfRemoteClient` self observing metrics. (#8481)
473debf is described below

commit 473debfee363b782cfe6b18dcb7ec54da5b29f77
Author: wankai123 <wa...@foxmail.com>
AuthorDate: Thu Jan 27 15:40:20 2022 +0800

    E2E verify OAP cluster model data aggregation and fix `SelfRemoteClient` self observing metrics. (#8481)
    
    * E2E: verify OAP cluster model data aggregation.
    * Fix `SelfRemoteClient` self observing metrics.
    * Remove unnecessary storage cases in the cluster e2e.
    * Add steps in cluster e2e to verify the whole cluster is up
    * update the doc
---
 .github/workflows/e2e.cluster.yaml                 |   3 -
 CHANGES.md                                         |   6 +-
 docs/en/setup/backend/backend-cluster.md           |   4 +-
 docs/en/setup/backend/configuration-vocabulary.md  |  15 +-
 .../core/remote/client/SelfRemoteClient.java       |  21 ++-
 .../src/main/resources/application.yml             |  10 ++
 test/e2e-v2/cases/cluster/cluster-cases.yaml       | 135 +++++-----------
 .../{traces-list.yml => cluster-up-oap1.yml}       |  14 +-
 ...e-endpoint-provider.yml => cluster-up-oap2.yml} |   6 +-
 .../cases/cluster/expected/dependency-endpoint.yml |  40 -----
 .../cases/cluster/expected/dependency-instance.yml |  41 -----
 .../cases/cluster/expected/dependency-services.yml |  48 ------
 ...metrics-has-value.yml => metrics-day-first.yml} |   9 +-
 ...etrics-has-value.yml => metrics-day-second.yml} |   9 +-
 .../expected/metrics-has-value-percentile.yml      |  47 ------
 ...ndpoint-provider.yml => metrics-hour-first.yml} |  14 +-
 ...dpoint-provider.yml => metrics-hour-second.yml} |  14 +-
 ...point-provider.yml => metrics-minute-first.yml} |  10 +-
 ...oint-consumer.yml => metrics-minute-second.yml} |  10 +-
 ...{metrics-has-value.yml => send-metrics-rsp.yml} |   5 +-
 .../cluster/expected/service-instance-provider.yml |  41 -----
 ...-instance-consumer.yml => service-instance.yml} |  26 +--
 test/e2e-v2/cases/cluster/expected/service.yml     |  13 +-
 .../cases/cluster/expected/trace-users-detail.yml  | 177 ---------------------
 ...ndpoint-provider.yml => test-downsampling.yaml} |   9 +-
 test/e2e-v2/cases/cluster/zk/es/docker-compose.yml |  72 +++++++--
 test/e2e-v2/cases/cluster/zk/es/e2e.yaml           |  10 --
 .../cases/cluster/zk/influxdb/docker-compose.yml   | 111 -------------
 test/e2e-v2/cases/cluster/zk/influxdb/e2e.yaml     |  48 ------
 .../cases/cluster/zk/iotdb/docker-compose.yml      | 111 -------------
 test/e2e-v2/cases/cluster/zk/iotdb/e2e.yaml        |  48 ------
 .../cases/cluster/zk/mysql/docker-compose.yml      | 118 --------------
 test/e2e-v2/cases/cluster/zk/mysql/e2e.yaml        |  48 ------
 .../controller/MeterMetricSenderController.java    |  20 +++
 34 files changed, 225 insertions(+), 1088 deletions(-)

diff --git a/.github/workflows/e2e.cluster.yaml b/.github/workflows/e2e.cluster.yaml
index bbbafcb..ecd1f99 100644
--- a/.github/workflows/e2e.cluster.yaml
+++ b/.github/workflows/e2e.cluster.yaml
@@ -38,9 +38,6 @@ jobs:
       matrix:
         config-file:
           - cluster/zk/es/e2e.yaml
-          - cluster/zk/mysql/e2e.yaml
-          - cluster/zk/influxdb/e2e.yaml
-          - cluster/zk/iotdb/e2e.yaml
     steps:
       - uses: actions/checkout@v2
         with:
diff --git a/CHANGES.md b/CHANGES.md
index 4d2e63b..53c9213 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -39,8 +39,12 @@ Release Notes.
 * Add `normal` to V9 service meta query.
 * Support `scope=ALL` catalog for metrics.
 * Bump up H2 to 2.1.210 to fix CVE-2022-23221.
-* E2e: Add `normal` field to Service.
+* E2E: Add `normal` field to Service.
 * Add FreeSql component ID(3017) of dotnet agent.
+* E2E: verify OAP cluster model data aggregation.
+* Fix `SelfRemoteClient` self observing metrics.
+* Add env variables `SW_CLUSTER_INTERNAL_COM_HOST` and `SW_CLUSTER_INTERNAL_COM_PORT` for cluster selectors `zookeeper`,`consul`,`etcd` and `nacos`.
+* Doc update: `configuration-vocabulary`,`backend-cluster` about env variables `SW_CLUSTER_INTERNAL_COM_HOST` and `SW_CLUSTER_INTERNAL_COM_PORT`.
 
 #### UI
 
diff --git a/docs/en/setup/backend/backend-cluster.md b/docs/en/setup/backend/backend-cluster.md
index bb829a9..a2032f2 100644
--- a/docs/en/setup/backend/backend-cluster.md
+++ b/docs/en/setup/backend/backend-cluster.md
@@ -52,8 +52,8 @@ zookeeper:
   #Retry Policy
   baseSleepTimeMs: ${SW_CLUSTER_ZK_SLEEP_TIME:1000} # initial amount of time to wait between retries
   maxRetries: ${SW_CLUSTER_ZK_MAX_RETRIES:3} # max number of times to retry
-  internalComHost: 172.10.4.10
-  internalComPort: 11800
+  internalComHost: ${SW_CLUSTER_INTERNAL_COM_HOST:172.10.4.10}
+  internalComPort: ${SW_CLUSTER_INTERNAL_COM_PORT:11800}
   # Enable ACL
   enableACL: ${SW_ZK_ENABLE_ACL:false} # disable ACL in default
   schema: ${SW_ZK_SCHEMA:digest} # only support digest schema
diff --git a/docs/en/setup/backend/configuration-vocabulary.md b/docs/en/setup/backend/configuration-vocabulary.md
index 496ac71..22b935b 100644
--- a/docs/en/setup/backend/configuration-vocabulary.md
+++ b/docs/en/setup/backend/configuration-vocabulary.md
@@ -27,6 +27,7 @@ core|default|role|Option values: `Mixed/Receiver/Aggregator`. **Receiver** mode
 | - | - | metricsDataTTL| The lifecycle of metrics data (in days), including metadata. We recommend setting metricsDataTTL >= recordDataTTL. Minimum value is 2. | SW_CORE_METRICS_DATA_TTL|7|
 | - | - | l1FlushPeriod| The period of L1 aggregation flush to L2 aggregation (in milliseconds). | SW_CORE_L1_AGGREGATION_FLUSH_PERIOD | 500 |
 | - | - | storageSessionTimeout| The threshold of session time (in milliseconds). Default value is 70000. | SW_CORE_STORAGE_SESSION_TIMEOUT | 70000 |
+| - | - | persistentPeriod| The period of doing data persistence. Unit is second.Default value is 25s | SW_CORE_PERSISTENT_PERIOD | 25 |
 | - | - | enableDatabaseSession| Cache metrics data for 1 minute to reduce database queries, and if the OAP cluster changes within that minute. |SW_CORE_ENABLE_DATABASE_SESSION|true|
 | - | - | topNReportPeriod|The execution period (in minutes) of top N sampler, which saves sampled data into the storage. |SW_CORE_TOPN_REPORT_PERIOD|10|
 | - | - | activeExtraModelColumns|Appends entity names (e.g. service names) into metrics storage entities. |SW_CORE_ACTIVE_EXTRA_MODEL_COLUMNS|false|
@@ -54,27 +55,29 @@ core|default|role|Option values: `Mixed/Receiver/Aggregator`. **Receiver** mode
 | - | - | enableACL| Opens ACL using `schema` and `expression`. |SW_ZK_ENABLE_ACL| false|
 | - | - | schema | Schema for the authorization. |SW_ZK_SCHEMA|digest|
 | - | - | expression | Expression for the authorization. |SW_ZK_EXPRESSION|skywalking:skywalking|
-| - | - | internalComHost| The hostname registered in Zookeeper for the internal communication of OAP cluster. | - | -|
-| - | - | internalComPort| The port registered in Zookeeper for the internal communication of OAP cluster. | - | -1|
+| - | - | internalComHost| The hostname registered in Zookeeper for the internal communication of OAP cluster. | SW_CLUSTER_INTERNAL_COM_HOST | -|
+| - | - | internalComPort| The port registered in Zookeeper for the internal communication of OAP cluster. | SW_CLUSTER_INTERNAL_COM_PORT | -1|
 | - | kubernetes| namespace| Namespace deployed by SkyWalking in k8s. |SW_CLUSTER_K8S_NAMESPACE|default|
 | - | - | labelSelector| Labels used for filtering OAP deployment in k8s. |SW_CLUSTER_K8S_LABEL| app=collector,release=skywalking|
 | - | - | uidEnvName| Environment variable name for reading uid. | SW_CLUSTER_K8S_UID|SKYWALKING_COLLECTOR_UID|
 | - | consul| serviceName| Service name for SkyWalking cluster. |SW_SERVICE_NAME|SkyWalking_OAP_Cluster|
 | - | - | hostPort| Hosts and ports for Consul cluster.| SW_CLUSTER_CONSUL_HOST_PORT|localhost:8500|
 | - | - | aclToken| ACL Token of Consul. Empty string means `without ALC token`. | SW_CLUSTER_CONSUL_ACLTOKEN | - |
-| - | - | internalComHost| The hostname registered in Consul for internal communications of the OAP cluster. | - | -|
-| - | - | internalComPort| The port registered in Consul for internal communications of the OAP cluster. | - | -1|
+| - | - | internalComHost| The hostname registered in Consul for internal communications of the OAP cluster. | SW_CLUSTER_INTERNAL_COM_HOST | -|
+| - | - | internalComPort| The port registered in Consul for internal communications of the OAP cluster. | SW_CLUSTER_INTERNAL_COM_PORT | -1|
 | - | etcd| serviceName| Service name for SkyWalking cluster. |SW_CLUSTER_ETCD_SERVICE_NAME|SkyWalking_OAP_Cluster|
 | - | - | endpoints| Hosts and ports for etcd cluster. | SW_CLUSTER_ETCD_ENDPOINTS|localhost:2379|
 | - | - | namespace | Namespace for SkyWalking cluster. |SW_CLUSTER_ETCD_NAMESPACE | /skywalking |
 | - | - | authentication | Indicates whether there is authentication. | SW_CLUSTER_ETCD_AUTHENTICATION | false |
 | - | - | user | Etcd auth username. | SW_CLUSTER_ETCD_USER | |
 | - | - | password | Etcd auth password. | SW_CLUSTER_ETCD_PASSWORD | |
+| - | - | internalComHost| The hostname registered in etcd for internal communications of the OAP cluster. | SW_CLUSTER_INTERNAL_COM_HOST | -|
+| - | - | internalComPort| The port registered in etcd for internal communications of the OAP cluster. | SW_CLUSTER_INTERNAL_COM_PORT | -1|
 | - | Nacos| serviceName| Service name for SkyWalking cluster. |SW_SERVICE_NAME|SkyWalking_OAP_Cluster|
 | - | - | hostPort| Hosts and ports for Nacos cluster.| SW_CLUSTER_NACOS_HOST_PORT|localhost:8848|
 | - | - | namespace| Namespace used by SkyWalking node coordination. | SW_CLUSTER_NACOS_NAMESPACE|public|
-| - | - | internalComHost| The hostname registered in Nacos for internal communications of the OAP cluster. | - | -|
-| - | - | internalComPort| The port registered in Nacos for internal communications of the OAP cluster. | - | -1|
+| - | - | internalComHost| The hostname registered in Nacos for internal communications of the OAP cluster. | SW_CLUSTER_INTERNAL_COM_HOST | -|
+| - | - | internalComPort| The port registered in Nacos for internal communications of the OAP cluster. | SW_CLUSTER_INTERNAL_COM_PORT | -1|
 | - | - | username | Nacos Auth username. | SW_CLUSTER_NACOS_USERNAME | - |
 | - | - | password | Nacos Auth password. | SW_CLUSTER_NACOS_PASSWORD | - |
 | - | - | accessKey | Nacos Auth accessKey. | SW_CLUSTER_NACOS_ACCESSKEY | - |
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/remote/client/SelfRemoteClient.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/remote/client/SelfRemoteClient.java
index 7d445fd..46cceaf 100644
--- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/remote/client/SelfRemoteClient.java
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/remote/client/SelfRemoteClient.java
@@ -18,6 +18,7 @@
 
 package org.apache.skywalking.oap.server.core.remote.client;
 
+import lombok.extern.slf4j.Slf4j;
 import org.apache.skywalking.oap.server.core.CoreModule;
 import org.apache.skywalking.oap.server.core.UnexpectedException;
 import org.apache.skywalking.oap.server.core.remote.data.StreamData;
@@ -28,10 +29,12 @@ import org.apache.skywalking.oap.server.telemetry.api.CounterMetrics;
 import org.apache.skywalking.oap.server.telemetry.api.MetricsCreator;
 import org.apache.skywalking.oap.server.telemetry.api.MetricsTag;
 
+@Slf4j
 public class SelfRemoteClient implements RemoteClient {
 
     private final Address address;
     private CounterMetrics remoteOutCounter;
+    private CounterMetrics remoteOutErrorCounter;
     private final IWorkerInstanceGetter workerInstanceGetter;
 
     public SelfRemoteClient(ModuleDefineHolder moduleDefineHolder, Address address) {
@@ -44,6 +47,16 @@ public class SelfRemoteClient implements RemoteClient {
                                              .getService(MetricsCreator.class)
                                              .createCounter("remote_out_count", "The number(client side) of inside remote inside aggregate rpc.", new MetricsTag.Keys("dest", "self"), new MetricsTag.Values(address
                                                  .toString(), "Y"));
+        remoteOutErrorCounter = moduleDefineHolder.find(TelemetryModule.NAME)
+                                                  .provider()
+                                                  .getService(MetricsCreator.class)
+                                                  .createCounter(
+                                                      "remote_out_error_count",
+                                                      "The error number(client side) of inside remote inside aggregate rpc.",
+                                                      new MetricsTag.Keys("dest", "self"), new MetricsTag.Values(
+                                                          address
+                                                              .toString(), "Y")
+                                                  );
     }
 
     @Override
@@ -62,7 +75,13 @@ public class SelfRemoteClient implements RemoteClient {
 
     @Override
     public void push(String nextWorkerName, StreamData streamData) {
-        workerInstanceGetter.get(nextWorkerName).getWorker().in(streamData);
+        try {
+            workerInstanceGetter.get(nextWorkerName).getWorker().in(streamData);
+            remoteOutCounter.inc();
+        } catch (Throwable t) {
+            remoteOutErrorCounter.inc();
+            log.error(t.getMessage(), t);
+        }
     }
 
     @Override
diff --git a/oap-server/server-starter/src/main/resources/application.yml b/oap-server/server-starter/src/main/resources/application.yml
index b9a99c0..f0855e4 100755
--- a/oap-server/server-starter/src/main/resources/application.yml
+++ b/oap-server/server-starter/src/main/resources/application.yml
@@ -28,6 +28,8 @@ cluster:
     enableACL: ${SW_ZK_ENABLE_ACL:false} # disable ACL in default
     schema: ${SW_ZK_SCHEMA:digest} # only support digest schema
     expression: ${SW_ZK_EXPRESSION:skywalking:skywalking}
+    internalComHost: ${SW_CLUSTER_INTERNAL_COM_HOST:""}
+    internalComPort: ${SW_CLUSTER_INTERNAL_COM_PORT:-1}
   kubernetes:
     namespace: ${SW_CLUSTER_K8S_NAMESPACE:default}
     labelSelector: ${SW_CLUSTER_K8S_LABEL:app=collector,release=skywalking}
@@ -37,6 +39,8 @@ cluster:
     # Consul cluster nodes, example: 10.0.0.1:8500,10.0.0.2:8500,10.0.0.3:8500
     hostPort: ${SW_CLUSTER_CONSUL_HOST_PORT:localhost:8500}
     aclToken: ${SW_CLUSTER_CONSUL_ACLTOKEN:""}
+    internalComHost: ${SW_CLUSTER_INTERNAL_COM_HOST:""}
+    internalComPort: ${SW_CLUSTER_INTERNAL_COM_PORT:-1}
   etcd:
     # etcd cluster nodes, example: 10.0.0.1:2379,10.0.0.2:2379,10.0.0.3:2379
     endpoints: ${SW_CLUSTER_ETCD_ENDPOINTS:localhost:2379}
@@ -45,6 +49,8 @@ cluster:
     authentication: ${SW_CLUSTER_ETCD_AUTHENTICATION:false}
     user: ${SW_CLUSTER_ETCD_USER:}
     password: ${SW_CLUSTER_ETCD_PASSWORD:}
+    internalComHost: ${SW_CLUSTER_INTERNAL_COM_HOST:""}
+    internalComPort: ${SW_CLUSTER_INTERNAL_COM_PORT:-1}
   nacos:
     serviceName: ${SW_SERVICE_NAME:"SkyWalking_OAP_Cluster"}
     hostPort: ${SW_CLUSTER_NACOS_HOST_PORT:localhost:8848}
@@ -56,6 +62,8 @@ cluster:
     # Nacos auth accessKey
     accessKey: ${SW_CLUSTER_NACOS_ACCESSKEY:""}
     secretKey: ${SW_CLUSTER_NACOS_SECRETKEY:""}
+    internalComHost: ${SW_CLUSTER_INTERNAL_COM_HOST:""}
+    internalComPort: ${SW_CLUSTER_INTERNAL_COM_PORT:-1}
 core:
   selector: ${SW_CORE:default}
   default:
@@ -94,6 +102,8 @@ core:
     l1FlushPeriod: ${SW_CORE_L1_AGGREGATION_FLUSH_PERIOD:500}
     # The threshold of session time. Unit is ms. Default value is 70s.
     storageSessionTimeout: ${SW_CORE_STORAGE_SESSION_TIMEOUT:70000}
+    # The period of doing data persistence. Unit is second.Default value is 25s
+    persistentPeriod: ${SW_CORE_PERSISTENT_PERIOD:25}
     # Cache metrics data for 1 minute to reduce database queries, and if the OAP cluster changes within that minute,
     # the metrics may not be accurate within that minute.
     enableDatabaseSession: ${SW_CORE_ENABLE_DATABASE_SESSION:true}
diff --git a/test/e2e-v2/cases/cluster/cluster-cases.yaml b/test/e2e-v2/cases/cluster/cluster-cases.yaml
index a81c543..56d5215 100644
--- a/test/e2e-v2/cases/cluster/cluster-cases.yaml
+++ b/test/e2e-v2/cases/cluster/cluster-cases.yaml
@@ -16,98 +16,51 @@
 # This file is used to show how to write configuration files and can be used to test.
 
   cases:
-    # service list
+    # send metrics to each oap, just verify OAP cluster is up,
+    - query: |
+        curl -s -XPOST http://${sender1_host}:${sender1_9093}/sendBatchMetrics/1642647600000/100 > /dev/null;
+        curl -s -XPOST http://${sender2_host}:${sender2_9093}/sendBatchMetrics/1642647600000/100 > /dev/null;
+        sleep 10;
+        curl -s http://${oap1_host}:${oap1_1234} | grep remote_out_count{ | awk '{print $1}'
+      expected: expected/cluster-up-oap1.yml
+    - query: |
+        curl -s -XPOST http://${sender1_host}:${sender1_9093}/sendBatchMetrics/1642647600000/100 > /dev/null;
+        curl -s -XPOST http://${sender2_host}:${sender2_9093}/sendBatchMetrics/1642647600000/100 > /dev/null;
+        sleep 5;
+        curl -s http://${oap2_host}:${oap2_1234} | grep remote_out_count{ | awk '{print $1}'
+      expected: expected/cluster-up-oap2.yml
+    # send metrics to each oap first time, UTC 2022-01-26 03:00:00
+    - query: |
+        curl -s -XPOST http://${sender1_host}:${sender1_9093}/sendBatchMetrics/1643166000000/100;
+        curl -s -XPOST http://${sender2_host}:${sender2_9093}/sendBatchMetrics/1643166000000/100;
+        sleep 10;
+      expected: expected/send-metrics-rsp.yml
     - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql service ls
       expected: expected/service.yml
     # service instance list
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql instance list --service-name=e2e-service-provider
-      expected: expected/service-instance-provider.yml
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql instance list --service-name=e2e-service-consumer
-      expected: expected/service-instance-consumer.yml
-    # service endpoint
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql endpoint list --keyword=users --service-name=e2e-service-provider
-      expected: expected/service-endpoint-provider.yml
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql endpoint list --keyword=users --service-name=e2e-service-consumer
-      expected: expected/service-endpoint-consumer.yml
-    # trace segment list
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql trace ls
-      expected: expected/traces-list.yml
-    # trace detail
+    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql instance list --service-name=test-service
+      expected: expected/service-instance.yml
+    # metrics minute
+    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=test_meter_downsampling_sum --instance-name=test-instance --service-name=test-service --start "2022-01-26 0259" --end "2022-01-26 0301" |yq e 'to_entries' -
+      expected: expected/metrics-minute-first.yml
+    # metrics toHour
+    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=test_meter_downsampling_sum --instance-name=test-instance --service-name=test-service --start "2022-01-26 01" --end "2022-01-26 05" |yq e 'to_entries' -
+      expected: expected/metrics-hour-first.yml
+    # metrics toDay
+    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=test_meter_downsampling_sum --instance-name=test-instance --service-name=test-service --start "2022-01-26" --end "2022-01-27" |yq e 'to_entries' -
+      expected: expected/metrics-day-first.yml
+    # send metrics to each oap second time UTC 2022-01-26 03:10:00
     - query: |
-        swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql trace $( \
-          swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql trace ls --service-name=e2e-service-consumer \
-            | yq e '.traces | select(.[].endpointnames[0]=="POST:/users") | .[0].traceids[0]' -
-        )
-      expected: expected/trace-users-detail.yml
-    # dependency service
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql dependency service --service-name=e2e-service-provider
-      expected: expected/dependency-services.yml
-    # dependency instance
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql dependency instance --service-name=e2e-service-consumer --dest-service-name=e2e-service-provider
-      expected: expected/dependency-instance.yml
-    # service metrics linear
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=service_sla --service-name=e2e-service-provider |yq e 'to_entries' -
-      expected: expected/metrics-has-value.yml
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=service_cpm --service-name=e2e-service-provider |yq e 'to_entries' -
-      expected: expected/metrics-has-value.yml
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=service_resp_time --service-name=e2e-service-provider |yq e 'to_entries' -
-      expected: expected/metrics-has-value.yml
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=service_apdex --service-name=e2e-service-provider |yq e 'to_entries' -
-      expected: expected/metrics-has-value.yml
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=service_sla --service-name=e2e-service-consumer |yq e 'to_entries' -
-      expected: expected/metrics-has-value.yml
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=service_cpm --service-name=e2e-service-consumer |yq e 'to_entries' -
-      expected: expected/metrics-has-value.yml
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=service_resp_time --service-name=e2e-service-consumer |yq e 'to_entries' -
-      expected: expected/metrics-has-value.yml
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=service_apdex --service-name=e2e-service-consumer |yq e 'to_entries' -
-      expected: expected/metrics-has-value.yml
-    # service metrics percentile
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics multiple-linear --name=service_percentile --service-name=e2e-service-provider |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
-      expected: expected/metrics-has-value-percentile.yml
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics multiple-linear --name=service_percentile --service-name=e2e-service-consumer |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
-      expected: expected/metrics-has-value-percentile.yml
-    # service instance metrics
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=service_instance_resp_time --instance-name=provider1 --service-name=e2e-service-provider |yq e 'to_entries' -
-      expected: expected/metrics-has-value.yml
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=service_instance_cpm --instance-name=provider1 --service-name=e2e-service-provider |yq e 'to_entries' -
-      expected: expected/metrics-has-value.yml
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=service_instance_sla --instance-name=provider1 --service-name=e2e-service-provider |yq e 'to_entries' -
-      expected: expected/metrics-has-value.yml
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=service_instance_resp_time --instance-name=consumer1 --service-name=e2e-service-consumer |yq e 'to_entries' -
-      expected: expected/metrics-has-value.yml
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=service_instance_cpm --instance-name=consumer1 --service-name=e2e-service-consumer |yq e 'to_entries' -
-      expected: expected/metrics-has-value.yml
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=service_instance_sla --instance-name=consumer1 --service-name=e2e-service-consumer |yq e 'to_entries' -
-      expected: expected/metrics-has-value.yml
-    # service endpoint metrics
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=endpoint_cpm --endpoint-name=POST:/users --service-name=e2e-service-provider |yq e 'to_entries' -
-      expected: expected/metrics-has-value.yml
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=endpoint_avg --endpoint-name=POST:/users --service-name=e2e-service-provider |yq e 'to_entries' -
-      expected: expected/metrics-has-value.yml
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=endpoint_sla --endpoint-name=POST:/users --service-name=e2e-service-provider |yq e 'to_entries' -
-      expected: expected/metrics-has-value.yml
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=endpoint_cpm --endpoint-name=POST:/users --service-name=e2e-service-consumer |yq e 'to_entries' -
-      expected: expected/metrics-has-value.yml
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=endpoint_avg --endpoint-name=POST:/users --service-name=e2e-service-consumer |yq e 'to_entries' -
-      expected: expected/metrics-has-value.yml
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=endpoint_sla --endpoint-name=POST:/users --service-name=e2e-service-consumer |yq e 'to_entries' -
-      expected: expected/metrics-has-value.yml
-    # service endpoint metrics percentile
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics multiple-linear --name=endpoint_percentile --endpoint-name=POST:/users --service-name=e2e-service-consumer |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
-      expected: expected/metrics-has-value-percentile.yml
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics multiple-linear --name=endpoint_percentile --endpoint-name=POST:/users --service-name=e2e-service-consumer |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
-      expected: expected/metrics-has-value-percentile.yml
-    # service relation metrics
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=service_relation_client_cpm --service-name=e2e-service-consumer --dest-service-name=e2e-service-provider |yq e 'to_entries' -
-      expected: expected/metrics-has-value.yml
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=service_relation_server_cpm --service-name=e2e-service-consumer --dest-service-name=e2e-service-provider |yq e 'to_entries' -
-      expected: expected/metrics-has-value.yml
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=service_relation_client_cpm --service-name=e2e-service-provider --dest-service-id=bG9jYWxob3N0Oi0x.0 |yq e 'to_entries' -
-      expected: expected/metrics-has-value.yml
-    # service instance relation metrics
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=service_instance_relation_server_cpm --instance-name=consumer1 --service-name=e2e-service-consumer --dest-instance-name=provider1 --dest-service-name=e2e-service-provider |yq e 'to_entries' -
-      expected: expected/metrics-has-value.yml
-    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=service_instance_relation_client_cpm --instance-name=consumer1 --service-name=e2e-service-consumer --dest-instance-name=provider1 --dest-service-name=e2e-service-provider |yq e 'to_entries' -
-      expected: expected/metrics-has-value.yml
-
+        curl -s -XPOST http://${sender1_host}:${sender1_9093}/sendBatchMetrics/1643166600000/100;
+        curl -s -XPOST http://${sender2_host}:${sender2_9093}/sendBatchMetrics/1643166600000/100;
+        sleep 10;
+      expected: expected/send-metrics-rsp.yml
+    # metrics minute
+    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=test_meter_downsampling_sum --instance-name=test-instance --service-name=test-service --start "2022-01-26 0309" --end "2022-01-26 0311" |yq e 'to_entries' -
+      expected: expected/metrics-minute-second.yml
+    # metrics toHour
+    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=test_meter_downsampling_sum --instance-name=test-instance --service-name=test-service --start "2022-01-26 01" --end "2022-01-26 05" |yq e 'to_entries' -
+      expected: expected/metrics-hour-second.yml
+    # metrics toDay
+    - query: swctl --display yaml --base-url=http://${ui_host}:${ui_8080}/graphql metrics linear --name=test_meter_downsampling_sum --instance-name=test-instance --service-name=test-service --start "2022-01-26" --end "2022-01-27" |yq e 'to_entries' -
+      expected: expected/metrics-day-second.yml
diff --git a/test/e2e-v2/cases/cluster/expected/traces-list.yml b/test/e2e-v2/cases/cluster/expected/cluster-up-oap1.yml
similarity index 74%
rename from test/e2e-v2/cases/cluster/expected/traces-list.yml
rename to test/e2e-v2/cases/cluster/expected/cluster-up-oap1.yml
index 876508f..c02b4a5 100644
--- a/test/e2e-v2/cases/cluster/expected/traces-list.yml
+++ b/test/e2e-v2/cases/cluster/expected/cluster-up-oap1.yml
@@ -13,15 +13,5 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-traces:
-{{- contains .traces }}
-- segmentid: {{ notEmpty .segmentid }}
-  endpointnames:
-    - POST:/users
-  duration: {{ ge .duration 0 }}
-  start: "{{ notEmpty .start}}"
-  iserror: false
-  traceids:
-    - {{ index .traceids 0 }}
-{{- end }}
-total: {{ gt .total 0 }}
+remote_out_count{sw_backend_instance="0.0.0.0_11800",dest="oap1_11800",self="Y",}
+remote_out_count{sw_backend_instance="0.0.0.0_11800",dest="oap2_11800",self="N",}
diff --git a/test/e2e-v2/cases/cluster/expected/service-endpoint-provider.yml b/test/e2e-v2/cases/cluster/expected/cluster-up-oap2.yml
similarity index 82%
copy from test/e2e-v2/cases/cluster/expected/service-endpoint-provider.yml
copy to test/e2e-v2/cases/cluster/expected/cluster-up-oap2.yml
index 0303f51..0dceddf 100644
--- a/test/e2e-v2/cases/cluster/expected/service-endpoint-provider.yml
+++ b/test/e2e-v2/cases/cluster/expected/cluster-up-oap2.yml
@@ -13,7 +13,5 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-{{- contains . }}
-- id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "POST:/users" }}
-  name: POST:/users
-{{- end}}
\ No newline at end of file
+remote_out_count{sw_backend_instance="0.0.0.0_11800",dest="oap2_11800",self="Y",}
+remote_out_count{sw_backend_instance="0.0.0.0_11800",dest="oap1_11800",self="N",}
diff --git a/test/e2e-v2/cases/cluster/expected/dependency-endpoint.yml b/test/e2e-v2/cases/cluster/expected/dependency-endpoint.yml
deleted file mode 100644
index 3835336..0000000
--- a/test/e2e-v2/cases/cluster/expected/dependency-endpoint.yml
+++ /dev/null
@@ -1,40 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     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.
-
-nodes:
-{{- contains .nodes }}
-- id: {{ b64enc "e2e-service-consumer" }}.1_{{ b64enc "POST:/users" }}
-  name: POST:/users
-  serviceid: {{ b64enc "e2e-service-consumer" }}.1
-  servicename: e2e-service-consumer
-  type: ""
-  isreal: true
-- id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "POST:/users" }}
-  name: POST:/users
-  serviceid: {{ b64enc "e2e-service-provider" }}.1
-  servicename: e2e-service-provider
-  type: ""
-  isreal: true
-{{- end }}
-calls:
-{{- contains .calls }}
-- source: {{ b64enc "e2e-service-consumer" }}.1_{{ b64enc "POST:/users" }}
-  sourcecomponents: []
-  target: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "POST:/users" }}
-  targetcomponents: []
-  id: {{ b64enc "e2e-service-consumer" }}.1-{{ b64enc "POST:/users" }}-{{ b64enc "e2e-service-provider" }}.1-{{ b64enc "POST:/users" }}
-  detectpoints:
-    - SERVER
-{{- end }}
diff --git a/test/e2e-v2/cases/cluster/expected/dependency-instance.yml b/test/e2e-v2/cases/cluster/expected/dependency-instance.yml
deleted file mode 100644
index d3b9547..0000000
--- a/test/e2e-v2/cases/cluster/expected/dependency-instance.yml
+++ /dev/null
@@ -1,41 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     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.
-
-nodes:
-{{- contains .nodes }}
-- id: {{ b64enc "e2e-service-consumer" }}.1_{{ b64enc "consumer1" }}
-  name: consumer1
-  serviceid: {{ b64enc "e2e-service-consumer" }}.1
-  servicename: e2e-service-consumer
-  type: ""
-  isreal: true
-- id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "provider1" }}
-  name: provider1
-  serviceid: {{ b64enc "e2e-service-provider" }}.1
-  servicename: e2e-service-provider
-  type: "Tomcat"
-  isreal: true
-{{- end }}
-calls:
-{{- contains .calls }}
-- source: {{ b64enc "e2e-service-consumer" }}.1_{{ b64enc "consumer1" }}
-  sourcecomponents: []
-  target: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "provider1" }}
-  targetcomponents: []
-  id: {{ b64enc "e2e-service-consumer" }}.1_{{ b64enc "consumer1" }}-{{ b64enc "e2e-service-provider" }}.1_{{ b64enc "provider1" }}
-  detectpoints:
-    - CLIENT
-    - SERVER
-{{- end }}
diff --git a/test/e2e-v2/cases/cluster/expected/dependency-services.yml b/test/e2e-v2/cases/cluster/expected/dependency-services.yml
deleted file mode 100644
index 600dd6d..0000000
--- a/test/e2e-v2/cases/cluster/expected/dependency-services.yml
+++ /dev/null
@@ -1,48 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     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.
-
-nodes:
-{{- contains .nodes }}
-- id: {{ b64enc "e2e-service-provider"}}.1
-  name: e2e-service-provider
-  type: Tomcat
-  isreal: true
-- id: {{ b64enc "e2e-service-consumer"}}.1
-  name: e2e-service-consumer
-  type: Tomcat
-  isreal: true
-- id: {{ b64enc "localhost:-1" }}.0
-  name: localhost:-1
-  type: H2
-  isreal: false
-{{- end }}
-calls:
-{{- contains .calls }}
-- source: {{ b64enc "e2e-service-consumer"}}.1
-  sourcecomponents: []
-  target: {{ b64enc "e2e-service-provider"}}.1
-  targetcomponents: []
-  id: {{ b64enc "e2e-service-consumer"}}.1-{{ b64enc "e2e-service-provider"}}.1
-  detectpoints:
-    - CLIENT
-    - SERVER
-- source: {{ b64enc "e2e-service-provider" }}.1
-  sourcecomponents: []
-  target: {{ b64enc "localhost:-1"}}.0
-  targetcomponents: []
-  id: {{ b64enc "e2e-service-provider" }}.1-{{ b64enc "localhost:-1"}}.0
-  detectpoints:
-    - CLIENT
-{{- end }}
diff --git a/test/e2e-v2/cases/cluster/expected/metrics-has-value.yml b/test/e2e-v2/cases/cluster/expected/metrics-day-first.yml
similarity index 90%
copy from test/e2e-v2/cases/cluster/expected/metrics-has-value.yml
copy to test/e2e-v2/cases/cluster/expected/metrics-day-first.yml
index d9c4985..53bb3c9 100644
--- a/test/e2e-v2/cases/cluster/expected/metrics-has-value.yml
+++ b/test/e2e-v2/cases/cluster/expected/metrics-day-first.yml
@@ -12,8 +12,7 @@
 # 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.
-
-{{- contains . }}
-- key: {{ notEmpty .key }}
-  value: {{ ge .value 1 }}
-{{- end }}
\ No newline at end of file
+- key: 2022-01-26
+  value: 200
+- key: 2022-01-27
+  value: 0
diff --git a/test/e2e-v2/cases/cluster/expected/metrics-has-value.yml b/test/e2e-v2/cases/cluster/expected/metrics-day-second.yml
similarity index 90%
copy from test/e2e-v2/cases/cluster/expected/metrics-has-value.yml
copy to test/e2e-v2/cases/cluster/expected/metrics-day-second.yml
index d9c4985..abd06f5 100644
--- a/test/e2e-v2/cases/cluster/expected/metrics-has-value.yml
+++ b/test/e2e-v2/cases/cluster/expected/metrics-day-second.yml
@@ -12,8 +12,7 @@
 # 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.
-
-{{- contains . }}
-- key: {{ notEmpty .key }}
-  value: {{ ge .value 1 }}
-{{- end }}
\ No newline at end of file
+- key: 2022-01-26
+  value: 400
+- key: 2022-01-27
+  value: 0
diff --git a/test/e2e-v2/cases/cluster/expected/metrics-has-value-percentile.yml b/test/e2e-v2/cases/cluster/expected/metrics-has-value-percentile.yml
deleted file mode 100644
index ef17490..0000000
--- a/test/e2e-v2/cases/cluster/expected/metrics-has-value-percentile.yml
+++ /dev/null
@@ -1,47 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     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.
-
-{{- contains . }}
-- key: 0
-  value:
-  {{- contains .value }}
-  - key: {{ notEmpty .key }}
-    value: {{ ge .value 1 }}
-  {{- end }}
-- key: 1
-  value:
-  {{- contains .value }}
-  - key: {{ notEmpty .key }}
-    value: {{ ge .value 1 }}
-  {{- end }}
-- key: 2
-  value:
-  {{- contains .value }}
-  - key: {{ notEmpty .key }}
-    value: {{ ge .value 1 }}
-  {{- end }}
-- key: 3
-  value:
-  {{- contains .value }}
-  - key: {{ notEmpty .key }}
-    value: {{ ge .value 1 }}
-  {{- end }}
-- key: 4
-  value:
-  {{- contains .value }}
-  - key: {{ notEmpty .key }}
-    value: {{ ge .value 1 }}
-  {{- end }}
-{{- end }}
diff --git a/test/e2e-v2/cases/cluster/expected/service-endpoint-provider.yml b/test/e2e-v2/cases/cluster/expected/metrics-hour-first.yml
similarity index 82%
copy from test/e2e-v2/cases/cluster/expected/service-endpoint-provider.yml
copy to test/e2e-v2/cases/cluster/expected/metrics-hour-first.yml
index 0303f51..096ffa7 100644
--- a/test/e2e-v2/cases/cluster/expected/service-endpoint-provider.yml
+++ b/test/e2e-v2/cases/cluster/expected/metrics-hour-first.yml
@@ -13,7 +13,13 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-{{- contains . }}
-- id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "POST:/users" }}
-  name: POST:/users
-{{- end}}
\ No newline at end of file
+- key: 2022-01-26 01
+  value: 0
+- key: 2022-01-26 02
+  value: 0
+- key: 2022-01-26 03
+  value: 200
+- key: 2022-01-26 04
+  value: 0
+- key: 2022-01-26 05
+  value: 0
diff --git a/test/e2e-v2/cases/cluster/expected/service-endpoint-provider.yml b/test/e2e-v2/cases/cluster/expected/metrics-hour-second.yml
similarity index 82%
copy from test/e2e-v2/cases/cluster/expected/service-endpoint-provider.yml
copy to test/e2e-v2/cases/cluster/expected/metrics-hour-second.yml
index 0303f51..414d886 100644
--- a/test/e2e-v2/cases/cluster/expected/service-endpoint-provider.yml
+++ b/test/e2e-v2/cases/cluster/expected/metrics-hour-second.yml
@@ -13,7 +13,13 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-{{- contains . }}
-- id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "POST:/users" }}
-  name: POST:/users
-{{- end}}
\ No newline at end of file
+- key: 2022-01-26 01
+  value: 0
+- key: 2022-01-26 02
+  value: 0
+- key: 2022-01-26 03
+  value: 400
+- key: 2022-01-26 04
+  value: 0
+- key: 2022-01-26 05
+  value: 0
diff --git a/test/e2e-v2/cases/cluster/expected/service-endpoint-provider.yml b/test/e2e-v2/cases/cluster/expected/metrics-minute-first.yml
similarity index 86%
copy from test/e2e-v2/cases/cluster/expected/service-endpoint-provider.yml
copy to test/e2e-v2/cases/cluster/expected/metrics-minute-first.yml
index 0303f51..2ab5e65 100644
--- a/test/e2e-v2/cases/cluster/expected/service-endpoint-provider.yml
+++ b/test/e2e-v2/cases/cluster/expected/metrics-minute-first.yml
@@ -13,7 +13,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-{{- contains . }}
-- id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "POST:/users" }}
-  name: POST:/users
-{{- end}}
\ No newline at end of file
+- key: 2022-01-26 0259
+  value: 0
+- key: 2022-01-26 0300
+  value: 200
+- key: 2022-01-26 0301
+  value: 0
diff --git a/test/e2e-v2/cases/cluster/expected/service-endpoint-consumer.yml b/test/e2e-v2/cases/cluster/expected/metrics-minute-second.yml
similarity index 86%
rename from test/e2e-v2/cases/cluster/expected/service-endpoint-consumer.yml
rename to test/e2e-v2/cases/cluster/expected/metrics-minute-second.yml
index cedf79a..6a3c4aa 100644
--- a/test/e2e-v2/cases/cluster/expected/service-endpoint-consumer.yml
+++ b/test/e2e-v2/cases/cluster/expected/metrics-minute-second.yml
@@ -13,7 +13,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-{{- contains . }}
-- id: {{ b64enc "e2e-service-consumer" }}.1_{{ b64enc "POST:/users" }}
-  name: POST:/users
-{{- end}}
+- key: 2022-01-26 0309
+  value: 0
+- key: 2022-01-26 0310
+  value: 200
+- key: 2022-01-26 0311
+  value: 0
diff --git a/test/e2e-v2/cases/cluster/expected/metrics-has-value.yml b/test/e2e-v2/cases/cluster/expected/send-metrics-rsp.yml
similarity index 90%
rename from test/e2e-v2/cases/cluster/expected/metrics-has-value.yml
rename to test/e2e-v2/cases/cluster/expected/send-metrics-rsp.yml
index d9c4985..4ee053f 100644
--- a/test/e2e-v2/cases/cluster/expected/metrics-has-value.yml
+++ b/test/e2e-v2/cases/cluster/expected/send-metrics-rsp.yml
@@ -13,7 +13,4 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-{{- contains . }}
-- key: {{ notEmpty .key }}
-  value: {{ ge .value 1 }}
-{{- end }}
\ No newline at end of file
+Metrics send success!Metrics send success!
diff --git a/test/e2e-v2/cases/cluster/expected/service-instance-provider.yml b/test/e2e-v2/cases/cluster/expected/service-instance-provider.yml
deleted file mode 100644
index d862e0c..0000000
--- a/test/e2e-v2/cases/cluster/expected/service-instance-provider.yml
+++ /dev/null
@@ -1,41 +0,0 @@
-# Licensed to 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. Apache Software Foundation (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.
-
-{{- contains . }}
-- id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "provider1" }}
-  name: provider1
-  attributes:
-  {{- contains .attributes }}
-  - name: OS Name
-    value: Linux
-  - name: hostname
-    value: {{ notEmpty .value }}
-  - name: Process No.
-    value: "1"
-  - name: Start Time
-    value: {{ notEmpty .value }}
-  - name: JVM Arguments
-    value: '{{ notEmpty .value }}'
-  - name: Jar Dependencies
-    value: '{{ notEmpty .value }}'
-  - name: ipv4s
-    value: {{ notEmpty .value }}
-  {{- end}}
-  language: JAVA
-  instanceuuid: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "provider1" }}
-  layer: GENERAL
-{{- end}}
diff --git a/test/e2e-v2/cases/cluster/expected/service-instance-consumer.yml b/test/e2e-v2/cases/cluster/expected/service-instance.yml
similarity index 59%
rename from test/e2e-v2/cases/cluster/expected/service-instance-consumer.yml
rename to test/e2e-v2/cases/cluster/expected/service-instance.yml
index 9b5f754..02fa200 100644
--- a/test/e2e-v2/cases/cluster/expected/service-instance-consumer.yml
+++ b/test/e2e-v2/cases/cluster/expected/service-instance.yml
@@ -16,26 +16,10 @@
 # under the License.
 
 {{- contains . }}
-- id: {{ b64enc "e2e-service-consumer" }}.1_{{ b64enc "consumer1" }}
-  name: consumer1
-  attributes:
-  {{- contains .attributes }}
-  - name: OS Name
-    value: Linux
-  - name: hostname
-    value: {{ notEmpty .value }}
-  - name: Process No.
-    value: "1"
-  - name: Start Time
-    value: {{ notEmpty .value }}
-  - name: JVM Arguments
-    value: '{{ notEmpty .value }}'
-  - name: Jar Dependencies
-    value: '{{ notEmpty .value }}'
-  - name: ipv4s
-    value: {{ notEmpty .value }}
-  {{- end}}
-  language: JAVA
-  instanceuuid: {{ b64enc "e2e-service-consumer" }}.1_{{ b64enc "consumer1" }}
+- id: {{ b64enc "test-service" }}.1_{{ b64enc "test-instance" }}
+  name: test-instance
+  attributes: []
+  language: UNKNOWN
+  instanceuuid: {{ b64enc "test-service" }}.1_{{ b64enc "test-instance" }}
   layer: GENERAL
 {{- end}}
diff --git a/test/e2e-v2/cases/cluster/expected/service.yml b/test/e2e-v2/cases/cluster/expected/service.yml
index 8b2684e..248534d 100644
--- a/test/e2e-v2/cases/cluster/expected/service.yml
+++ b/test/e2e-v2/cases/cluster/expected/service.yml
@@ -14,17 +14,10 @@
 # limitations under the License.
 
 {{- contains . }}
-- id: {{ b64enc "e2e-service-provider" }}.1
-  name: e2e-service-provider
+- id: {{ b64enc "test-service" }}.1
+  name: test-service
   group: ""
-  shortname: e2e-service-provider
-  normal: true
-  layers:
-    - GENERAL
-- id: {{ b64enc "e2e-service-consumer" }}.1
-  name: e2e-service-consumer
-  group: ""
-  shortname: e2e-service-consumer
+  shortname: test-service
   normal: true
   layers:
     - GENERAL
diff --git a/test/e2e-v2/cases/cluster/expected/trace-users-detail.yml b/test/e2e-v2/cases/cluster/expected/trace-users-detail.yml
deleted file mode 100644
index e533d1d..0000000
--- a/test/e2e-v2/cases/cluster/expected/trace-users-detail.yml
+++ /dev/null
@@ -1,177 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     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.
-
-spans:
-  {{- contains .spans }}
-  - traceid: {{ notEmpty .traceid }}
-    segmentid: {{ notEmpty .segmentid }}
-    spanid: {{ .spanid }}
-    parentspanid: {{ .parentspanid }}
-    refs: []
-    servicecode: e2e-service-consumer
-    serviceinstancename: consumer1
-    starttime: {{ gt .starttime 0 }}
-    endtime: {{ gt .endtime 0 }}
-    endpointname: POST:/users
-    type: Entry
-    peer: ""
-    component: Tomcat
-    iserror: false
-    layer: Http
-    tags:
-      {{- contains .tags }}
-      - key: url
-        value: {{ notEmpty .value }}
-      - key: http.method
-        value: POST
-      {{- end }}
-    logs: []
-  - traceid: {{ notEmpty .traceid }}
-    segmentid: {{ notEmpty .segmentid }}
-    spanid: {{ .spanid }}
-    parentspanid: {{ .parentspanid }}
-    refs: []
-    servicecode: e2e-service-consumer
-    serviceinstancename: consumer1
-    starttime: {{ gt .starttime 0 }}
-    endtime: {{ gt .endtime 0 }}
-    endpointname: /users
-    type: Exit
-    peer: provider1:9090
-    component: SpringRestTemplate
-    iserror: false
-    layer: Http
-    tags:
-      {{- contains .tags }}
-      - key: url
-        value: http://provider1:9090/users
-      - key: http.method
-        value: POST
-      {{- end }}
-    logs: []
-  - traceid: {{ notEmpty .traceid }}
-    segmentid: {{ notEmpty .segmentid }}
-    spanid: {{ .spanid }}
-    parentspanid: {{ .parentspanid }}
-    refs:
-      {{- contains .refs }}
-      - traceid: {{ notEmpty .traceid }}
-        parentsegmentid: {{ .parentsegmentid }}
-        parentspanid: {{ .parentspanid }}
-        type: CROSS_PROCESS
-      {{- end }}
-    servicecode: e2e-service-provider
-    serviceinstancename: provider1
-    starttime: {{ gt .starttime 0 }}
-    endtime: {{ gt .endtime 0 }}
-    endpointname: POST:/users
-    type: Entry
-    peer: ""
-    component: Tomcat
-    iserror: false
-    layer: Http
-    tags:
-      {{- contains .tags }}
-      - key: url
-        value: http://provider1:9090/users
-      - key: http.method
-        value: POST
-      {{- end }}
-    logs: []
-  - traceid: {{ notEmpty .traceid }}
-    segmentid: {{ notEmpty .segmentid }}
-    spanid: {{ .spanid }}
-    parentspanid: {{ .parentspanid }}
-    refs: []
-    servicecode: e2e-service-provider
-    serviceinstancename: provider1
-    starttime: {{ gt .starttime 0 }}
-    endtime: {{ gt .endtime 0 }}
-    endpointname: HikariCP/Connection/getConnection
-    type: Local
-    peer: ""
-    component: HikariCP
-    iserror: false
-    layer: Unknown
-    tags: []
-    logs: []
-  - traceid: {{ notEmpty .traceid }}
-    segmentid: {{ notEmpty .segmentid }}
-    spanid: {{ .spanid }}
-    parentspanid: {{ .parentspanid }}
-    refs: []
-    servicecode: e2e-service-provider
-    serviceinstancename: provider1
-    starttime: {{ gt .starttime 0 }}
-    endtime: {{ gt .endtime 0 }}
-    endpointname: H2/JDBI/PreparedStatement/executeQuery
-    type: Exit
-    peer: localhost:-1
-    component: h2-jdbc-driver
-    iserror: false
-    layer: Database
-    tags:
-      {{- contains .tags }}
-      - key: db.type
-        value: sql
-      - key: db.instance
-        value: testdb
-      - key: db.statement
-        value: {{ notEmpty .value }}
-      {{- end }}
-    logs: []
-  - traceid: {{ notEmpty .traceid }}
-    segmentid: {{ notEmpty .segmentid }}
-    spanid: {{ .spanid }}
-    parentspanid: {{ .parentspanid }}
-    refs: []
-    servicecode: e2e-service-provider
-    serviceinstancename: provider1
-    starttime: {{ gt .starttime 0 }}
-    endtime: {{ gt .endtime 0 }}
-    endpointname: H2/JDBI/Connection/commit
-    type: Exit
-    peer: localhost:-1
-    component: h2-jdbc-driver
-    iserror: false
-    layer: Database
-    tags:
-      {{- contains .tags }}
-      - key: db.type
-        value: sql
-      - key: db.instance
-        value: testdb
-      - key: db.statement
-        value: ""
-      {{- end }}
-    logs: []
-  - traceid: {{ notEmpty .traceid }}
-    segmentid: {{ notEmpty .segmentid }}
-    spanid: {{ .spanid }}
-    parentspanid: {{ .parentspanid }}
-    refs: []
-    servicecode: e2e-service-provider
-    serviceinstancename: provider1
-    starttime: {{ gt .starttime 0 }}
-    endtime: {{ gt .endtime 0 }}
-    endpointname: HikariCP/Connection/close
-    type: Local
-    peer: ""
-    component: HikariCP
-    iserror: false
-    layer: Unknown
-    tags: []
-    logs: []
-  {{- end }}
diff --git a/test/e2e-v2/cases/cluster/expected/service-endpoint-provider.yml b/test/e2e-v2/cases/cluster/test-downsampling.yaml
similarity index 82%
rename from test/e2e-v2/cases/cluster/expected/service-endpoint-provider.yml
rename to test/e2e-v2/cases/cluster/test-downsampling.yaml
index 0303f51..5adaceb 100644
--- a/test/e2e-v2/cases/cluster/expected/service-endpoint-provider.yml
+++ b/test/e2e-v2/cases/cluster/test-downsampling.yaml
@@ -13,7 +13,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-{{- contains . }}
-- id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "POST:/users" }}
-  name: POST:/users
-{{- end}}
\ No newline at end of file
+expSuffix: instance(['service'], ['instance'], Layer.GENERAL)
+metricPrefix: test_meter_downsampling
+metricsRules:
+  - name: sum
+    exp: batch_test.downsampling(SUM)
diff --git a/test/e2e-v2/cases/cluster/zk/es/docker-compose.yml b/test/e2e-v2/cases/cluster/zk/es/docker-compose.yml
index 9822db9..ae4ccac 100644
--- a/test/e2e-v2/cases/cluster/zk/es/docker-compose.yml
+++ b/test/e2e-v2/cases/cluster/zk/es/docker-compose.yml
@@ -47,9 +47,20 @@ services:
     extends:
       file: ../../../../script/docker-compose/base-compose.yml
       service: oap
+    volumes:
+      - ../../test-downsampling.yaml:/skywalking/config/meter-analyzer-config/test-downsampling.yaml
     environment:
       SW_CLUSTER: zookeeper
       SW_STORAGE: elasticsearch
+      SW_CORE_PERSISTENT_PERIOD: 5
+      SW_METER_ANALYZER_ACTIVE_FILES: test-downsampling
+      SW_CLUSTER_ZK_HOST_PORT: zk:2181
+      SW_CLUSTER_INTERNAL_COM_HOST: oap1
+      SW_CLUSTER_INTERNAL_COM_PORT: 11800
+      SW_CORE_DATA_KEEPER_EXECUTE_PERIOD: 100
+      SW_TELEMETRY: prometheus
+    ports:
+      - 1234
     depends_on:
       zk:
         condition: service_healthy
@@ -60,9 +71,20 @@ services:
     extends:
       file: ../../../../script/docker-compose/base-compose.yml
       service: oap
+    volumes:
+      - ../../test-downsampling.yaml:/skywalking/config/meter-analyzer-config/test-downsampling.yaml
     environment:
       SW_CLUSTER: zookeeper
       SW_STORAGE: elasticsearch
+      SW_CORE_PERSISTENT_PERIOD: 5
+      SW_METER_ANALYZER_ACTIVE_FILES: test-downsampling
+      SW_CLUSTER_ZK_HOST_PORT: zk:2181
+      SW_CLUSTER_INTERNAL_COM_HOST: oap2
+      SW_CLUSTER_INTERNAL_COM_PORT: 11800
+      SW_CORE_DATA_KEEPER_EXECUTE_PERIOD: 100
+      SW_TELEMETRY: prometheus
+    ports:
+      - 1234
     depends_on:
       zk:
         condition: service_healthy
@@ -85,30 +107,50 @@ services:
     ports:
     - 8080
 
-  provider1:
-    extends:
-      file: ../../../../script/docker-compose/base-compose.yml
-      service: provider
+  sender1:
+    image: "eclipse-temurin:8-jre"
+    volumes:
+      - ../../../../java-test-service/e2e-mock-sender/target/e2e-mock-sender-2.0.0.jar:/e2e-mock-sender-2.0.0.jar
+    command: [ "java", "-jar", "/e2e-mock-sender-2.0.0.jar" ]
     environment:
-      SW_AGENT_COLLECTOR_BACKEND_SERVICES: oap2:11800
-      SW_AGENT_INSTANCE_NAME: provider1
+      OAP_HOST: oap1
+      OAP_GRPC_PORT: 11800
+    networks:
+      - e2e
+    ports:
+      - 9093
+    healthcheck:
+      test: [ "CMD", "sh", "-c", "nc -nz 127.0.0.1 9093" ]
+      interval: 5s
+      timeout: 60s
+      retries: 120
     depends_on:
+      oap1:
+        condition: service_healthy
       oap2:
         condition: service_healthy
 
-  consumer:
-    extends:
-      file: ../../../../script/docker-compose/base-compose.yml
-      service: consumer
+  sender2:
+    image: "eclipse-temurin:8-jre"
+    volumes:
+      - ../../../../java-test-service/e2e-mock-sender/target/e2e-mock-sender-2.0.0.jar:/e2e-mock-sender-2.0.0.jar
+    command: [ "java", "-jar", "/e2e-mock-sender-2.0.0.jar" ]
     environment:
-      SW_AGENT_COLLECTOR_BACKEND_SERVICES: oap1:11800
-      PROVIDER_URL: http://provider1:9090
+      OAP_HOST: oap2
+      OAP_GRPC_PORT: 11800
+    networks:
+      - e2e
+    ports:
+      - 9093
+    healthcheck:
+      test: [ "CMD", "sh", "-c", "nc -nz 127.0.0.1 9093" ]
+      interval: 5s
+      timeout: 60s
+      retries: 120
     depends_on:
       oap1:
         condition: service_healthy
-      provider1:
+      oap2:
         condition: service_healthy
-    ports:
-      - 9092
 networks:
   e2e:
diff --git a/test/e2e-v2/cases/cluster/zk/es/e2e.yaml b/test/e2e-v2/cases/cluster/zk/es/e2e.yaml
index f7b4fee..98fd730 100644
--- a/test/e2e-v2/cases/cluster/zk/es/e2e.yaml
+++ b/test/e2e-v2/cases/cluster/zk/es/e2e.yaml
@@ -26,16 +26,6 @@ setup:
     - name: install swctl
       command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh swctl
 
-trigger:
-  action: http
-  interval: 3s
-  times: 10
-  url: http://${consumer_host}:${consumer_9092}/users
-  method: POST
-  body: '{"id":"123","name":"skywalking"}'
-  headers:
-    "Content-Type": "application/json"
-
 verify:
   # verify with retry strategy
   retry:
diff --git a/test/e2e-v2/cases/cluster/zk/influxdb/docker-compose.yml b/test/e2e-v2/cases/cluster/zk/influxdb/docker-compose.yml
deleted file mode 100644
index 8a63f5c..0000000
--- a/test/e2e-v2/cases/cluster/zk/influxdb/docker-compose.yml
+++ /dev/null
@@ -1,111 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     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.
-
-version: '2.1'
-
-services:
-  zk:
-    image: zookeeper:3.5
-    expose:
-      - 2181
-    networks:
-      - e2e
-    healthcheck:
-      test: [ "CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/2181" ]
-      interval: 5s
-      timeout: 60s
-      retries: 120
-
-  influxdb:
-    image: influxdb:1.7.9
-    expose:
-      - 8086
-    networks:
-      - e2e
-    healthcheck:
-      test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/8086"]
-      interval: 5s
-      timeout: 60s
-      retries: 120
-
-  oap1:
-    extends:
-      file: ../../../../script/docker-compose/base-compose.yml
-      service: oap
-    environment:
-      SW_CLUSTER: zookeeper
-      SW_STORAGE: influxdb
-    depends_on:
-      zk:
-        condition: service_healthy
-      influxdb:
-        condition: service_healthy
-
-  oap2:
-    extends:
-      file: ../../../../script/docker-compose/base-compose.yml
-      service: oap
-    environment:
-      SW_CLUSTER: zookeeper
-      SW_STORAGE: influxdb
-    depends_on:
-      zk:
-        condition: service_healthy
-      influxdb:
-        condition: service_healthy
-      oap1:
-        condition: service_healthy
-
-  ui:
-    extends:
-      file: ../../../../script/docker-compose/base-compose.yml
-      service: ui
-    environment:
-      - SW_OAP_ADDRESS=http://oap1:12800,http://oap2:12800
-    depends_on:
-      oap1:
-        condition: service_healthy
-      oap2:
-        condition: service_healthy
-    ports:
-    - 8080
-
-  provider1:
-    extends:
-      file: ../../../../script/docker-compose/base-compose.yml
-      service: provider
-    environment:
-      SW_AGENT_COLLECTOR_BACKEND_SERVICES: oap2:11800
-      SW_AGENT_INSTANCE_NAME: provider1
-    depends_on:
-      oap2:
-        condition: service_healthy
-
-  consumer:
-    extends:
-      file: ../../../../script/docker-compose/base-compose.yml
-      service: consumer
-    environment:
-      SW_AGENT_COLLECTOR_BACKEND_SERVICES: oap1:11800
-      PROVIDER_URL: http://provider1:9090
-    depends_on:
-      oap1:
-        condition: service_healthy
-      provider1:
-        condition: service_healthy
-    ports:
-      - 9092
-networks:
-  e2e:
diff --git a/test/e2e-v2/cases/cluster/zk/influxdb/e2e.yaml b/test/e2e-v2/cases/cluster/zk/influxdb/e2e.yaml
deleted file mode 100644
index f7b4fee..0000000
--- a/test/e2e-v2/cases/cluster/zk/influxdb/e2e.yaml
+++ /dev/null
@@ -1,48 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     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.
-
-# This file is used to show how to write configuration files and can be used to test.
-
-setup:
-  env: compose
-  file: docker-compose.yml
-  timeout: 20m
-  init-system-environment: ../../../../script/env
-  steps:
-    - name: install yq
-      command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh yq
-    - name: install swctl
-      command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh swctl
-
-trigger:
-  action: http
-  interval: 3s
-  times: 10
-  url: http://${consumer_host}:${consumer_9092}/users
-  method: POST
-  body: '{"id":"123","name":"skywalking"}'
-  headers:
-    "Content-Type": "application/json"
-
-verify:
-  # verify with retry strategy
-  retry:
-    # max retry count
-    count: 20
-    # the interval between two retries, in millisecond.
-    interval: 3s
-  cases:
-    - includes:
-        - ../../cluster-cases.yaml
diff --git a/test/e2e-v2/cases/cluster/zk/iotdb/docker-compose.yml b/test/e2e-v2/cases/cluster/zk/iotdb/docker-compose.yml
deleted file mode 100644
index 0abf7ee..0000000
--- a/test/e2e-v2/cases/cluster/zk/iotdb/docker-compose.yml
+++ /dev/null
@@ -1,111 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     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.
-
-version: '2.1'
-
-services:
-  zk:
-    image: zookeeper:3.5
-    expose:
-      - 2181
-    networks:
-      - e2e
-    healthcheck:
-      test: [ "CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/2181" ]
-      interval: 5s
-      timeout: 60s
-      retries: 120
-
-  iotdb:
-    image: apache/iotdb:0.12.3-node
-    expose:
-      - 6667
-    networks:
-      - e2e
-    healthcheck:
-      test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/6667"]
-      interval: 5s
-      timeout: 60s
-      retries: 120
-
-  oap1:
-    extends:
-      file: ../../../../script/docker-compose/base-compose.yml
-      service: oap
-    environment:
-      SW_CLUSTER: zookeeper
-      SW_STORAGE: iotdb
-    depends_on:
-      zk:
-        condition: service_healthy
-      iotdb:
-        condition: service_healthy
-
-  oap2:
-    extends:
-      file: ../../../../script/docker-compose/base-compose.yml
-      service: oap
-    environment:
-      SW_CLUSTER: zookeeper
-      SW_STORAGE: iotdb
-    depends_on:
-      zk:
-        condition: service_healthy
-      iotdb:
-        condition: service_healthy
-      oap1:
-        condition: service_healthy
-
-  ui:
-    extends:
-      file: ../../../../script/docker-compose/base-compose.yml
-      service: ui
-    environment:
-      - SW_OAP_ADDRESS=http://oap1:12800,http://oap2:12800
-    depends_on:
-      oap1:
-        condition: service_healthy
-      oap2:
-        condition: service_healthy
-    ports:
-    - 8080
-
-  provider1:
-    extends:
-      file: ../../../../script/docker-compose/base-compose.yml
-      service: provider
-    environment:
-      SW_AGENT_COLLECTOR_BACKEND_SERVICES: oap2:11800
-      SW_AGENT_INSTANCE_NAME: provider1
-    depends_on:
-      oap2:
-        condition: service_healthy
-
-  consumer:
-    extends:
-      file: ../../../../script/docker-compose/base-compose.yml
-      service: consumer
-    environment:
-      SW_AGENT_COLLECTOR_BACKEND_SERVICES: oap1:11800
-      PROVIDER_URL: http://provider1:9090
-    depends_on:
-      oap1:
-        condition: service_healthy
-      provider1:
-        condition: service_healthy
-    ports:
-      - 9092
-networks:
-  e2e:
diff --git a/test/e2e-v2/cases/cluster/zk/iotdb/e2e.yaml b/test/e2e-v2/cases/cluster/zk/iotdb/e2e.yaml
deleted file mode 100644
index f7b4fee..0000000
--- a/test/e2e-v2/cases/cluster/zk/iotdb/e2e.yaml
+++ /dev/null
@@ -1,48 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     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.
-
-# This file is used to show how to write configuration files and can be used to test.
-
-setup:
-  env: compose
-  file: docker-compose.yml
-  timeout: 20m
-  init-system-environment: ../../../../script/env
-  steps:
-    - name: install yq
-      command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh yq
-    - name: install swctl
-      command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh swctl
-
-trigger:
-  action: http
-  interval: 3s
-  times: 10
-  url: http://${consumer_host}:${consumer_9092}/users
-  method: POST
-  body: '{"id":"123","name":"skywalking"}'
-  headers:
-    "Content-Type": "application/json"
-
-verify:
-  # verify with retry strategy
-  retry:
-    # max retry count
-    count: 20
-    # the interval between two retries, in millisecond.
-    interval: 3s
-  cases:
-    - includes:
-        - ../../cluster-cases.yaml
diff --git a/test/e2e-v2/cases/cluster/zk/mysql/docker-compose.yml b/test/e2e-v2/cases/cluster/zk/mysql/docker-compose.yml
deleted file mode 100644
index 4c63056..0000000
--- a/test/e2e-v2/cases/cluster/zk/mysql/docker-compose.yml
+++ /dev/null
@@ -1,118 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     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.
-
-version: '2.1'
-
-services:
-  zk:
-    image: zookeeper:3.5
-    expose:
-      - 2181
-    networks:
-      - e2e
-    healthcheck:
-      test: [ "CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/2181" ]
-      interval: 5s
-      timeout: 60s
-      retries: 120
-
-  mysql:
-    image: mysql/mysql-server:8.0.13
-    networks:
-      - e2e
-    expose:
-      - 3306
-    environment:
-      - MYSQL_ROOT_PASSWORD=root@1234
-      - MYSQL_DATABASE=swtest
-      - MYSQL_ROOT_HOST=%
-    healthcheck:
-      test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/3306"]
-      interval: 5s
-      timeout: 60s
-      retries: 120
-
-  oap1:
-    extends:
-      file: ../../../../script/docker-compose/base-compose.yml
-      service: oap
-    environment:
-      SW_CLUSTER: zookeeper
-      SW_STORAGE: mysql
-    entrypoint: ['sh', '-c', '/download-mysql.sh && /skywalking/docker-entrypoint.sh']
-    depends_on:
-      zk:
-        condition: service_healthy
-      mysql:
-        condition: service_healthy
-
-  oap2:
-    extends:
-      file: ../../../../script/docker-compose/base-compose.yml
-      service: oap
-    environment:
-      SW_CLUSTER: zookeeper
-      SW_STORAGE: mysql
-    entrypoint: ['sh', '-c', '/download-mysql.sh && /skywalking/docker-entrypoint.sh']
-    depends_on:
-      zk:
-        condition: service_healthy
-      mysql:
-        condition: service_healthy
-      oap1:
-        condition: service_healthy
-
-  ui:
-    extends:
-      file: ../../../../script/docker-compose/base-compose.yml
-      service: ui
-    environment:
-      - SW_OAP_ADDRESS=http://oap1:12800,http://oap2:12800
-    depends_on:
-      oap1:
-        condition: service_healthy
-      oap2:
-        condition: service_healthy
-    ports:
-    - 8080
-
-  provider1:
-    extends:
-      file: ../../../../script/docker-compose/base-compose.yml
-      service: provider
-    environment:
-      SW_AGENT_COLLECTOR_BACKEND_SERVICES: oap2:11800
-      SW_AGENT_INSTANCE_NAME: provider1
-    depends_on:
-      oap2:
-        condition: service_healthy
-
-  consumer:
-    extends:
-      file: ../../../../script/docker-compose/base-compose.yml
-      service: consumer
-    environment:
-      SW_AGENT_COLLECTOR_BACKEND_SERVICES: oap1:11800
-      PROVIDER_URL: http://provider1:9090
-    depends_on:
-      oap1:
-        condition: service_healthy
-      provider1:
-        condition: service_healthy
-
-    ports:
-      - 9092
-networks:
-  e2e:
diff --git a/test/e2e-v2/cases/cluster/zk/mysql/e2e.yaml b/test/e2e-v2/cases/cluster/zk/mysql/e2e.yaml
deleted file mode 100644
index f7b4fee..0000000
--- a/test/e2e-v2/cases/cluster/zk/mysql/e2e.yaml
+++ /dev/null
@@ -1,48 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     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.
-
-# This file is used to show how to write configuration files and can be used to test.
-
-setup:
-  env: compose
-  file: docker-compose.yml
-  timeout: 20m
-  init-system-environment: ../../../../script/env
-  steps:
-    - name: install yq
-      command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh yq
-    - name: install swctl
-      command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh swctl
-
-trigger:
-  action: http
-  interval: 3s
-  times: 10
-  url: http://${consumer_host}:${consumer_9092}/users
-  method: POST
-  body: '{"id":"123","name":"skywalking"}'
-  headers:
-    "Content-Type": "application/json"
-
-verify:
-  # verify with retry strategy
-  retry:
-    # max retry count
-    count: 20
-    # the interval between two retries, in millisecond.
-    interval: 3s
-  cases:
-    - includes:
-        - ../../cluster-cases.yaml
diff --git a/test/e2e-v2/java-test-service/e2e-mock-sender/src/main/java/org/apache/skywalking/e2e/controller/MeterMetricSenderController.java b/test/e2e-v2/java-test-service/e2e-mock-sender/src/main/java/org/apache/skywalking/e2e/controller/MeterMetricSenderController.java
index 876ed23..af02f46 100644
--- a/test/e2e-v2/java-test-service/e2e-mock-sender/src/main/java/org/apache/skywalking/e2e/controller/MeterMetricSenderController.java
+++ b/test/e2e-v2/java-test-service/e2e-mock-sender/src/main/java/org/apache/skywalking/e2e/controller/MeterMetricSenderController.java
@@ -29,6 +29,7 @@ import org.apache.skywalking.apm.network.language.agent.v3.MeterDataCollection;
 import org.apache.skywalking.apm.network.language.agent.v3.MeterReportServiceGrpc;
 import org.apache.skywalking.apm.network.language.agent.v3.MeterSingleValue;
 import org.apache.skywalking.e2e.E2EConfiguration;
+import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -67,6 +68,25 @@ public class MeterMetricSenderController {
         return "Metrics send success!";
     }
 
+    @PostMapping("/sendBatchMetrics/{timestamp}/{value}")
+    public String sendBatchMetrics(@PathVariable("timestamp") long timestamp, @PathVariable("value") double value) throws Exception {
+        final MeterDataCollection.Builder builder =
+            MeterDataCollection.newBuilder()
+                               .addMeterData(MeterData.newBuilder()
+                                                      .setService("test-service")
+                                                      .setTimestamp(timestamp)
+                                                      .setServiceInstance("test-instance")
+                                                      .setSingleValue(MeterSingleValue.newBuilder()
+                                                                                      .setName("batch_test")
+                                                                                      .setValue(value)
+                                                                                      .build())
+                                                      .build());
+
+        sendMetrics(builder.build());
+
+        return "Metrics send success!";
+    }
+
     void sendMetrics(final MeterDataCollection metrics) throws InterruptedException {
         final CountDownLatch latch = new CountDownLatch(1);