You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by li...@apache.org on 2021/10/18 06:34:07 UTC

[skywalking-satellite] branch main updated: Some enhancement (#78)

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

liuhan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-satellite.git


The following commit(s) were added to refs/heads/main by this push:
     new d971b7b  Some enhancement (#78)
d971b7b is described below

commit d971b7b78bc7591adc64ef103b41685769f08d89
Author: mrproliu <74...@qq.com>
AuthorDate: Mon Oct 18 14:34:01 2021 +0800

    Some enhancement (#78)
---
 CHANGES.md                                         |  3 +
 docs/menu.yml                                      | 66 +++++++++----------
 internal/satellite/tools/generate_plugin_doc.go    |  2 +-
 .../forwarder/grpc/nativemanagement/forwarder.go   |  2 +-
 .../expected/service-endpoint.yml => base/env}     | 10 ++-
 .../prepare/setup-e2e-shell/install-etcdctl.sh     | 38 +++++++++++
 .../prepare/setup-e2e-shell/install-swctl.sh       | 31 +++++++++
 .../scripts/prepare/setup-e2e-shell/install-yq.sh  | 30 +++++++++
 .../scripts/prepare/setup-e2e-shell/install.sh     | 35 ++++++++++
 test/e2e/case/envoy/e2e.yaml                       | 28 ++------
 test/e2e/case/native-protocols/e2e.yaml            | 74 ++++++----------------
 .../case/native-protocols/expected/event-list.yml  |  6 +-
 .../case/native-protocols/expected/logs-list.yml   | 12 +---
 .../expected/metrics-has-value.yml                 |  2 -
 .../native-protocols/expected/profile-list.yml     |  4 +-
 .../expected/profile-segment-analyze.yml           | 16 +----
 .../expected/profile-segment-detail.yml            |  8 +--
 .../expected/profile-segment-list.yml              |  4 +-
 .../native-protocols/expected/service-endpoint.yml |  4 +-
 .../native-protocols/expected/service-instance.yml | 18 +-----
 .../e2e/case/native-protocols/expected/service.yml |  6 +-
 .../expected/trace-info-detail.yml                 | 10 +--
 .../expected/trace-users-detail.yml                |  8 +--
 .../case/native-protocols/expected/traces-list.yml | 16 +----
 24 files changed, 226 insertions(+), 207 deletions(-)

diff --git a/CHANGES.md b/CHANGES.md
index 0907a31..dca13ba 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -5,6 +5,9 @@ Release Notes.
 0.3.0
 ------------------
 #### Features
+* Support load-balance GRPC client with the static server list.
+* Support load-balance GRPC client with the Kubernetes selector.
+* Support transmit Envoy ALS v2/v3 protocol.
 
 #### Bug Fixes
 * Fix errors when converting meter data from histogram and summary.[#75](https://github.com/apache/skywalking-satellite/pull/75)
diff --git a/docs/menu.yml b/docs/menu.yml
index 299e78b..f346f70 100644
--- a/docs/menu.yml
+++ b/docs/menu.yml
@@ -59,83 +59,83 @@ catalog:
           catalog:
             - name: client
               catalog:
-                - name: grpc-client
+                - name: grpc client
                   path: /en/setup/plugins/client_grpc-client
-                - name: kafka-client
+                - name: kafka client
                   path: /en/setup/plugins/client_kafka-client
             - name: fallbacker
               catalog:
-                - name: none-fallbacker
+                - name: none fallbacker
                   path: /en/setup/plugins/fallbacker_none-fallbacker
-                - name: timer-fallbacker
+                - name: timer fallbacker
                   path: /en/setup/plugins/fallbacker_timer-fallbacker
             - name: fetcher
               catalog:
-                - name: prometheus-metrics-fetcher
+                - name: prometheus metrics fetcher
                   path: /en/setup/plugins/fetcher_prometheus-metrics-fetcher
             - name: forwarder
               catalog:
-                - name: envoy-als-v2-grpc-forwarder
+                - name: envoy als v2 grpc forwarder
                   path: /en/setup/plugins/forwarder_envoy-als-v2-grpc-forwarder
-                - name: envoy-als-v3-grpc-forwarder
+                - name: envoy als v3 grpc forwarder
                   path: /en/setup/plugins/forwarder_envoy-als-v3-grpc-forwarder
-                - name: nativecds-grpc-forwarder
+                - name: nativecds grpc forwarder
                   path: /en/setup/plugins/forwarder_nativecds-grpc-forwarder
-                - name: nativeevent-grpc-forwarder
+                - name: nativeevent grpc forwarder
                   path: /en/setup/plugins/forwarder_nativeevent-grpc-forwarder
-                - name: nativejvm-grpc-forwarder
+                - name: nativejvm grpc forwarder
                   path: /en/setup/plugins/forwarder_nativejvm-grpc-forwarder
-                - name: nativelog-grpc-forwarder
+                - name: nativelog grpc forwarder
                   path: /en/setup/plugins/forwarder_nativelog-grpc-forwarder
-                - name: nativelog-kafka-forwarder
+                - name: nativelog kafka forwarder
                   path: /en/setup/plugins/forwarder_nativelog-kafka-forwarder
-                - name: nativemanagement-grpc-forwarder
+                - name: nativemanagement grpc forwarder
                   path: /en/setup/plugins/forwarder_nativemanagement-grpc-forwarder
-                - name: nativemeter-grpc-forwarder
+                - name: nativemeter grpc forwarder
                   path: /en/setup/plugins/forwarder_nativemeter-grpc-forwarder
-                - name: nativeprofile-grpc-forwarder
+                - name: nativeprofile grpc forwarder
                   path: /en/setup/plugins/forwarder_nativeprofile-grpc-forwarder
-                - name: nativetracing-grpc-forwarder
+                - name: nativetracing grpc forwarder
                   path: /en/setup/plugins/forwarder_nativetracing-grpc-forwarder
             - name: queue
               catalog:
-                - name: memory-queue
+                - name: memory queue
                   path: /en/setup/plugins/queue_memory-queue
-                - name: mmap-queue
+                - name: mmap queue
                   path: /en/setup/plugins/queue_mmap-queue
-                - name: none-queue
+                - name: none queue
                   path: /en/setup/plugins/queue_none-queue
             - name: receiver
               catalog:
-                - name: grpc-envoy-als-v2-receiver
+                - name: grpc envoy als v2 receiver
                   path: /en/setup/plugins/receiver_grpc-envoy-als-v2-receiver
-                - name: grpc-envoy-als-v3-receiver
+                - name: grpc envoy als v3 receiver
                   path: /en/setup/plugins/receiver_grpc-envoy-als-v3-receiver
-                - name: grpc-nativecds-receiver
+                - name: grpc nativecds receiver
                   path: /en/setup/plugins/receiver_grpc-nativecds-receiver
-                - name: grpc-nativeevent-receiver
+                - name: grpc nativeevent receiver
                   path: /en/setup/plugins/receiver_grpc-nativeevent-receiver
-                - name: grpc-nativejvm-receiver
+                - name: grpc nativejvm receiver
                   path: /en/setup/plugins/receiver_grpc-nativejvm-receiver
-                - name: grpc-nativelog-receiver
+                - name: grpc nativelog receiver
                   path: /en/setup/plugins/receiver_grpc-nativelog-receiver
-                - name: grpc-nativemanagement-receiver
+                - name: grpc nativemanagement receiver
                   path: /en/setup/plugins/receiver_grpc-nativemanagement-receiver
-                - name: grpc-nativemeter-receiver
+                - name: grpc nativemeter receiver
                   path: /en/setup/plugins/receiver_grpc-nativemeter-receiver
-                - name: grpc-nativeprofile-receiver
+                - name: grpc nativeprofile receiver
                   path: /en/setup/plugins/receiver_grpc-nativeprofile-receiver
-                - name: grpc-nativetracing-receiver
+                - name: grpc nativetracing receiver
                   path: /en/setup/plugins/receiver_grpc-nativetracing-receiver
-                - name: http-nativelog-receiver
+                - name: http nativelog receiver
                   path: /en/setup/plugins/receiver_http-nativelog-receiver
             - name: server
               catalog:
-                - name: grpc-server
+                - name: grpc server
                   path: /en/setup/plugins/server_grpc-server
-                - name: http-server
+                - name: http server
                   path: /en/setup/plugins/server_http-server
-                - name: prometheus-server
+                - name: prometheus server
                   path: /en/setup/plugins/server_prometheus-server
     - name: Guides
       catalog:
diff --git a/internal/satellite/tools/generate_plugin_doc.go b/internal/satellite/tools/generate_plugin_doc.go
index 12444e2..0fd5e43 100644
--- a/internal/satellite/tools/generate_plugin_doc.go
+++ b/internal/satellite/tools/generate_plugin_doc.go
@@ -109,7 +109,7 @@ func updateMenuPluginListDoc(outputRootPath, menuFilePath, pluginFilePath string
 		pluginList := getPluginsByCategory(category)
 		for _, pluginName := range pluginList {
 			implements = append(implements, &Catalog{
-				Name: pluginName,
+				Name: strings.ReplaceAll(pluginName, "-", " "),
 				Path: strings.TrimRight(fmt.Sprintf("%s/%s", pluginFilePath, getPluginDocFileName(category, pluginName)), markdownSuffix),
 			})
 		}
diff --git a/plugins/forwarder/grpc/nativemanagement/forwarder.go b/plugins/forwarder/grpc/nativemanagement/forwarder.go
index fac0494..52409ad 100644
--- a/plugins/forwarder/grpc/nativemanagement/forwarder.go
+++ b/plugins/forwarder/grpc/nativemanagement/forwarder.go
@@ -49,7 +49,7 @@ func (f *Forwarder) Name() string {
 }
 
 func (f *Forwarder) Description() string {
-	return "This is a synchronization grpc forwarder with the SkyWalking native mangement protocol."
+	return "This is a synchronization grpc forwarder with the SkyWalking native management protocol."
 }
 
 func (f *Forwarder) DefaultConfig() string {
diff --git a/test/e2e/case/native-protocols/expected/service-endpoint.yml b/test/e2e/base/env
similarity index 81%
copy from test/e2e/case/native-protocols/expected/service-endpoint.yml
copy to test/e2e/base/env
index 76bf688..1fc1b59 100644
--- a/test/e2e/case/native-protocols/expected/service-endpoint.yml
+++ b/test/e2e/base/env
@@ -13,9 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-{{- range .}}
-{{- if eq .name "/info" }}
-- id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "/info" }}
-  name: /info
-{{- end}}
-{{- end}}
\ No newline at end of file
+SW_AGENT_JAVA_COMMIT=3997f0256056788bd054ee37e4603c11c0fd6756
+SW_OAP_COMMIT=b5578b68fd0d5d8e4543ad7d8fc9c3066ace456c
+
+SW_CTL_COMMIT=b90255132f916f53eb90955cc8a6445b03a4bec3
diff --git a/test/e2e/base/scripts/prepare/setup-e2e-shell/install-etcdctl.sh b/test/e2e/base/scripts/prepare/setup-e2e-shell/install-etcdctl.sh
new file mode 100644
index 0000000..da8bebd
--- /dev/null
+++ b/test/e2e/base/scripts/prepare/setup-e2e-shell/install-etcdctl.sh
@@ -0,0 +1,38 @@
+#!/usr/bin/env bash
+
+# ----------------------------------------------------------------------------
+# 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.
+# ----------------------------------------------------------------------------
+
+BASE_DIR=$1
+BIN_DIR=$2
+
+if ! command -v etcdctl &> /dev/null; then
+  mkdir -p $BASE_DIR/etcdctl && cd $BASE_DIR/etcdctl
+  utype=$(uname | awk '{print tolower($0)}')
+  suffix=
+  if [ $utype = "darwin" ]
+  then
+      suffix="zip"
+  else
+      suffix="tar.gz"
+  fi
+  curl -kLo etcdctl.$suffix https://github.com/coreos/etcd/releases/download/v3.5.0/etcd-v3.5.0-$utype-amd64.$suffix
+  tar -zxf etcdctl.$suffix --strip=1
+  cp etcdctl $BIN_DIR/
+fi
\ No newline at end of file
diff --git a/test/e2e/base/scripts/prepare/setup-e2e-shell/install-swctl.sh b/test/e2e/base/scripts/prepare/setup-e2e-shell/install-swctl.sh
new file mode 100644
index 0000000..5893252
--- /dev/null
+++ b/test/e2e/base/scripts/prepare/setup-e2e-shell/install-swctl.sh
@@ -0,0 +1,31 @@
+#!/usr/bin/env bash
+
+# ----------------------------------------------------------------------------
+# 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.
+# ----------------------------------------------------------------------------
+
+BASE_DIR=$1
+BIN_DIR=$2
+
+if ! command -v swctl &> /dev/null; then
+  mkdir -p $BASE_DIR/swctl && cd $BASE_DIR/swctl
+  curl -kLo skywalking-cli.tar.gz https://github.com/apache/skywalking-cli/archive/${SW_CTL_COMMIT}.tar.gz
+  tar -zxf skywalking-cli.tar.gz --strip=1
+  utype=$(uname | awk '{print tolower($0)}')
+  make $utype && mv bin/swctl-*-$utype-amd64 $BIN_DIR/swctl
+fi
\ No newline at end of file
diff --git a/test/e2e/base/scripts/prepare/setup-e2e-shell/install-yq.sh b/test/e2e/base/scripts/prepare/setup-e2e-shell/install-yq.sh
new file mode 100644
index 0000000..28fd299
--- /dev/null
+++ b/test/e2e/base/scripts/prepare/setup-e2e-shell/install-yq.sh
@@ -0,0 +1,30 @@
+#!/usr/bin/env bash
+
+# ----------------------------------------------------------------------------
+# 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.
+# ----------------------------------------------------------------------------
+
+BASE_DIR=$1
+BIN_DIR=$2
+
+if ! command -v yq &> /dev/null; then
+  mkdir -p $BASE_DIR/yq && cd $BASE_DIR/yq
+  curl -kLo yq.tar.gz https://github.com/mikefarah/yq/archive/v4.11.1.tar.gz
+  tar -zxf yq.tar.gz --strip=1
+  go install && go build -ldflags -s && cp yq $BIN_DIR/
+fi
\ No newline at end of file
diff --git a/test/e2e/base/scripts/prepare/setup-e2e-shell/install.sh b/test/e2e/base/scripts/prepare/setup-e2e-shell/install.sh
new file mode 100644
index 0000000..3d440fa
--- /dev/null
+++ b/test/e2e/base/scripts/prepare/setup-e2e-shell/install.sh
@@ -0,0 +1,35 @@
+#!/usr/bin/env bash
+
+# ----------------------------------------------------------------------------
+# 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.
+# ----------------------------------------------------------------------------
+
+set -ex
+
+NAME=$1
+CURRENT_DIR="$(cd "$(dirname $0)"; pwd)"
+
+# prepare base dir
+TMP_DIR=/tmp/skywalking-infra-e2e
+BIN_DIR=/usr/local/bin
+mkdir -p $TMP_DIR && cd $TMP_DIR
+
+# execute install
+bash $CURRENT_DIR/install-$NAME.sh $TMP_DIR $BIN_DIR
+
+echo "success to install $NAME"
\ No newline at end of file
diff --git a/test/e2e/case/envoy/e2e.yaml b/test/e2e/case/envoy/e2e.yaml
index 3d651a3..a2815ef 100644
--- a/test/e2e/case/envoy/e2e.yaml
+++ b/test/e2e/case/envoy/e2e.yaml
@@ -19,32 +19,16 @@ setup:
   env: compose
   file: docker-compose.yml
   timeout: 1200
+  init-system-environment: ../../base/env
   steps:
     - name: install yq
-      command: |
-        if ! command -v yq &> /dev/null; then
-          mkdir -p /tmp/skywalking-infra-e2e/bin && cd /tmp/skywalking-infra-e2e
-          mkdir -p yq && cd yq
-          curl -kLo yq.tar.gz https://github.com/mikefarah/yq/archive/v4.11.1.tar.gz
-          tar -zxf yq.tar.gz --strip=1
-          go install && go build -ldflags -s && mv yq ../bin/yq
-          export PATH="$PATH:/tmp/skywalking-infra-e2e/bin"
-          echo "success to install yq"
-        fi
+      command: bash test/e2e/base/scripts/prepare/setup-e2e-shell/install.sh yq
     - name: install swctl
-      command: |
-        if ! command -v swctl &> /dev/null; then
-          mkdir -p /tmp/skywalking-infra-e2e/bin && cd /tmp/skywalking-infra-e2e
-          mkdir -p swctl && cd swctl
-          curl -kLo skywalking-cli.tar.gz https://github.com/apache/skywalking-cli/archive/76f9f848b3142d14c6ab6fa7910d408b92bced64.tar.gz
-          tar -zxf skywalking-cli.tar.gz --strip=1
-          make install DESTDIR=/usr/local/bin
-          echo "success to install swctl"
-        fi
+      command: bash test/e2e/base/scripts/prepare/setup-e2e-shell/install.sh swctl
 
 cleanup:
   # always never success failure
-  on: always
+  on: no
 
 trigger:
   action: http
@@ -65,8 +49,8 @@ verify:
     - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls
       expected: expected/service.yml
     # basic check: service instance list
-    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=test-app-v1
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name test-app-v1
       expected: expected/service-instance.yml
     # als: logs list
-    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-name=test-app-v1 |yq e 'del(.. | select(has("content")).content)' -
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-name test-app-v1 |yq e 'del(.. | select(has("content")).content)' -
       expected: expected/logs-list.yml
\ No newline at end of file
diff --git a/test/e2e/case/native-protocols/e2e.yaml b/test/e2e/case/native-protocols/e2e.yaml
index 1d050bc..efba2a2 100644
--- a/test/e2e/case/native-protocols/e2e.yaml
+++ b/test/e2e/case/native-protocols/e2e.yaml
@@ -19,49 +19,14 @@ setup:
   env: compose
   file: docker-compose.yml
   timeout: 1200
+  init-system-environment: ../../base/env
   steps:
     - name: install yq
-      command: |
-        if ! command -v yq &> /dev/null; then
-          mkdir -p /tmp/skywalking-infra-e2e/bin && cd /tmp/skywalking-infra-e2e
-          mkdir -p yq && cd yq
-          curl -kLo yq.tar.gz https://github.com/mikefarah/yq/archive/v4.11.1.tar.gz
-          tar -zxf yq.tar.gz --strip=1
-          go install && go build -ldflags -s && mv yq ../bin/yq
-          export PATH="$PATH:/tmp/skywalking-infra-e2e/bin"
-          echo "success to install yq"
-        fi
+      command: bash test/e2e/base/scripts/prepare/setup-e2e-shell/install.sh yq
     - name: install swctl
-      command: |
-        if ! command -v swctl &> /dev/null; then
-          mkdir -p /tmp/skywalking-infra-e2e/bin && cd /tmp/skywalking-infra-e2e
-          mkdir -p swctl && cd swctl
-          curl -kLo skywalking-cli.tar.gz https://github.com/apache/skywalking-cli/archive/4d1cb83e24ff58988f4aba0daa50259593b11670.tar.gz
-          tar -zxf skywalking-cli.tar.gz --strip=1
-          utype=$(uname | awk '{print tolower($0)}')
-          make $utype && mv bin/swctl-*-$utype-amd64 ../bin/swctl
-          export PATH="$PATH:/tmp/skywalking-infra-e2e/bin"
-          echo "success to install swctl"
-        fi
+      command: bash test/e2e/base/scripts/prepare/setup-e2e-shell/install.sh swctl
     - name: install etcdctl
-      command: |
-        if ! command -v etcdctl &> /dev/null; then
-          mkdir -p /tmp/skywalking-infra-e2e/bin && cd /tmp/skywalking-infra-e2e
-          mkdir -p etcdctl && cd etcdctl
-          utype=$(uname | awk '{print tolower($0)}')
-          suffix=
-          if [ $utype = "darwin" ]
-          then
-              suffix="zip"
-          else
-              suffix="tar.gz"
-          fi
-          curl -kLo etcdctl.$suffix https://github.com/coreos/etcd/releases/download/v3.5.0/etcd-v3.5.0-$utype-amd64.$suffix
-          tar -zxf etcdctl.$suffix --strip=1
-          cp etcdctl ../bin/
-          export PATH="$PATH:/tmp/skywalking-infra-e2e/bin"
-          echo "success to install etcdctl"
-        fi
+      command: bash test/e2e/base/scripts/prepare/setup-e2e-shell/install.sh etcdctl
 
 cleanup:
   # always never success failure
@@ -86,21 +51,21 @@ verify:
     - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls
       expected: expected/service.yml
     # basic check: service metrics
-    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name service_sla --service=e2e-service-provider |yq e 'to_entries' -
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name service_sla --service-name e2e-service-provider |yq e 'to_entries' -
       expected: expected/metrics-has-value.yml
     # basic check: service endpoint
-    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-id=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls|grep -B 1 'provider'|yq e '.[0].id' -)
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-name e2e-service-provider
       expected: expected/service-endpoint.yml
     # basic check: service endpoint metrics
-    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name endpoint_cpm --endpoint=/info --service=e2e-service-provider |yq e 'to_entries' -
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name endpoint_cpm --endpoint-name /info --service-name e2e-service-provider |yq e 'to_entries' -
       expected: expected/metrics-has-value.yml
 
     # native management: service instance list
-    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name e2e-service-provider
       expected: expected/service-instance.yml
 
     # native jvm: service instance jvm metrics
-    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name instance_jvm_thread_live_count --instance=provider1 --service=e2e-service-provider |yq e 'to_entries' -
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name instance_jvm_thread_live_count --service-name e2e-service-provider --instance-name provider1 |yq e 'to_entries' -
       expected: expected/metrics-has-value.yml
 
     # native tracing: trace segment list
@@ -111,35 +76,38 @@ verify:
       expected: expected/trace-info-detail.yml
 
     # native meter: instance meter
-    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name meter_jvm_classes_loaded --instance=provider1 --service=e2e-service-provider |yq e 'to_entries' -
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name meter_jvm_classes_loaded --instance-name provider1 --service-name e2e-service-provider |yq e 'to_entries' -
       expected: expected/metrics-has-value.yml
 
     # native event: event list
-    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql event list --service=e2e-service-provider --instance=provider1
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql event list --service-name e2e-service-provider --instance-name provider1
       expected: expected/event-list.yml
 
     # native log: logs list
-    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-id=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls|grep -B 1 'provider'|yq e '.[0].id' -) --trace-id=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls|grep -A 5 '/info'|tail -n1|awk -F ' ' '{print $2}')
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-name e2e-service-provider --trace-id=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls|grep -A 5 '/info'|tail -n1|awk -F ' ' '{print $2}')
       expected: expected/logs-list.yml
 
     # native profile: create task
-    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile create --service-name=e2e-service-provider --endpoint=/info --start-time=$((($(date +%s)+5)*1000)) --duration=1 --min-duration-threshold=0 --dump-period=10 --max-sampling-count=9
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile create --service-name e2e-service-provider --endpoint-name /info --start-time=$((($(date +%s)+5)*1000)) --duration=1 --min-duration-threshold=0 --dump-period=10 --max-sampling-count=9
       expected: expected/profile-create.yml
     # native profile: sleep to wait agent notices and query profile list
-    - query: sleep 10 && swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile list -service-name=e2e-service-provider --endpoint=/info
+    - query: sleep 10 && swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile list --service-name e2e-service-provider --endpoint-name /info
       expected: expected/profile-list.yml
     # native profile: sleep to wait segment report and query profiled segment list
     - query: |
         curl -X POST http://${consumer_host}:${consumer_9090}/info > /dev/null;
         sleep 5;
-        swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile segment-list --task-id=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile list --service-name=e2e-service-provider --endpoint=/info|yq e '.[0].id' -)
+        swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile segment-list --task-id=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile list --service-name e2e-service-provider --endpoint-name /info|yq e '.[0].id' -)
       expected: expected/profile-segment-list.yml
     # native profile: query profiled segment
-    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile profiled-segment --segment-id=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile segment-list --task-id=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile list --service-name=e2e-service-provider --endpoint=/info|yq e '.[0].id' -) | yq e '.[0].segmentid' -)
+    - query: |
+        task_id=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile list --service-name e2e-service-provider --endpoint-name /info|yq e '.[0].id' -)
+        segment_id=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile segment-list --task-id=$task_id | yq e '.[0].segmentid' -)
+        swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile profiled-segment --segment-id=$segment_id
       expected: expected/profile-segment-detail.yml
     # native profile: query profiled segment
     - query: |
-        segmentid=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile segment-list --task-id=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile list --service-name=e2e-service-provider --endpoint=/info|yq e '.[0].id' -) |yq e '.[0].segmentid' -);
+        segmentid=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile segment-list --task-id=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile list --service-name e2e-service-provider --endpoint-name /info|yq e '.[0].id' -) |yq e '.[0].segmentid' -);
         start=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile profiled-segment --segment-id=$segmentid|yq e '.spans.[0].starttime' -);
         end=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile profiled-segment --segment-id=$segmentid|yq e '.spans.[0].endtime' -);
         swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile profiled-analyze --segment-id=$segmentid --time-ranges=$(echo $start"-"$end)
@@ -155,5 +123,5 @@ verify:
         sleep 5;
         curl -X POST http://${provider_host}:${provider_9090}/users > /dev/null;
         sleep 5;
-        swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace $(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace list --step=SECOND --service-id=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls|grep -B 1 'provider'|yq e '.[0].id' -)|grep -A 5 "/users"|head -n 6|tail -n1|awk -F ' ' '{print $2}')
+        swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace $(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace list --step=SECOND --service-name e2e-service-provider |grep -A 5 "/users"|head -n 6|tail -n1|awk -F ' ' '{print $2}')
       expected: expected/trace-users-detail.yml
\ No newline at end of file
diff --git a/test/e2e/case/native-protocols/expected/event-list.yml b/test/e2e/case/native-protocols/expected/event-list.yml
index 8c41d3d..e5a19bf 100644
--- a/test/e2e/case/native-protocols/expected/event-list.yml
+++ b/test/e2e/case/native-protocols/expected/event-list.yml
@@ -14,7 +14,7 @@
 # limitations under the License.
 
 events:
-{{- range .events }}
+{{- contains .events }}
 - uuid: {{ notEmpty .uuid }}
   source:
     service: e2e-service-provider
@@ -24,12 +24,10 @@ events:
   type: Normal
   message: Start Java Application
   parameters:
-  {{- range .parameters }}
-  {{- if eq .key "OPTS"}}
+  {{- contains .parameters }}
     - key: OPTS
       value: {{ notEmpty .value }}
   {{- end }}
-  {{- end }}
   starttime: {{ gt .starttime 0 }}
   endtime: {{ gt .endtime 0 }}
 {{- end }}
diff --git a/test/e2e/case/native-protocols/expected/logs-list.yml b/test/e2e/case/native-protocols/expected/logs-list.yml
index 3294910..cb0aa04 100644
--- a/test/e2e/case/native-protocols/expected/logs-list.yml
+++ b/test/e2e/case/native-protocols/expected/logs-list.yml
@@ -14,7 +14,7 @@
 # limitations under the License.
 
 logs:
-  {{- range .logs }}
+  {{- contains .logs }}
   - servicename: e2e-service-provider
     serviceid: {{ b64enc "e2e-service-provider" }}.1
     serviceinstancename: provider1
@@ -27,19 +27,13 @@ logs:
     content: |
       {{ notEmpty .content }}
     tags:
-    {{- range .tags }}
-    {{- if eq .key "level"}}
+    {{- contains .tags }}
     - key: level
       value: INFO
-    {{- end }}
-    {{- if eq .key "logger" }}
     - key: logger
       value: {{ notEmpty .value }}
-    {{- end }}
-    {{- if eq .key "thread" }}
     - key: thread
       value: {{ notEmpty .value }}
     {{- end }}
-    {{- end }}
-    {{- end }}
+  {{- end }}
 total: {{ gt .total 0 }}
\ No newline at end of file
diff --git a/test/e2e/case/native-protocols/expected/metrics-has-value.yml b/test/e2e/case/native-protocols/expected/metrics-has-value.yml
index 27ae47c..d9c4985 100644
--- a/test/e2e/case/native-protocols/expected/metrics-has-value.yml
+++ b/test/e2e/case/native-protocols/expected/metrics-has-value.yml
@@ -15,7 +15,5 @@
 
 {{- contains . }}
 - key: {{ notEmpty .key }}
-  value: {{ ge .value 0 }}
-- key: {{ notEmpty .key }}
   value: {{ ge .value 1 }}
 {{- end }}
\ No newline at end of file
diff --git a/test/e2e/case/native-protocols/expected/profile-list.yml b/test/e2e/case/native-protocols/expected/profile-list.yml
index cf3459d..d86048e 100644
--- a/test/e2e/case/native-protocols/expected/profile-list.yml
+++ b/test/e2e/case/native-protocols/expected/profile-list.yml
@@ -13,7 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-{{- range . }}
+{{- contains . }}
 - id: {{ notEmpty .id }}
   serviceid: {{ b64enc "e2e-service-provider" }}.1
   servicename: ""
@@ -24,7 +24,7 @@
   dumpperiod: 10
   maxsamplingcount: 9
   logs:
-    {{- range .logs }}
+    {{- contains .logs }}
     - id: {{ notEmpty .id }}
       instanceid: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "provider1" }}
       operationtype: {{ notEmpty .operationtype }}
diff --git a/test/e2e/case/native-protocols/expected/profile-segment-analyze.yml b/test/e2e/case/native-protocols/expected/profile-segment-analyze.yml
index 2ce6611..e5a8e3e 100644
--- a/test/e2e/case/native-protocols/expected/profile-segment-analyze.yml
+++ b/test/e2e/case/native-protocols/expected/profile-segment-analyze.yml
@@ -15,26 +15,14 @@
 
 tip: null
 trees:
-  {{- range .trees }}
+  {{- contains .trees }}
   - elements:
     {{- contains .elements }}
     - id: "{{ notEmpty .id }}"
       parentid: "{{ notEmpty .parentid }}"
-      codesignature:
-        {{- if eq .codesignature "java.lang.Thread.sleep:-2" }}
-          java.lang.Thread.sleep:-2
-        {{- end }}
+      codesignature: java.lang.Thread.sleep:-2
       duration: {{ gt .duration 0 }}
       durationchildexcluded: {{ gt .durationchildexcluded 0 }}
       count: {{ gt .count 0 }}
-    - id: "{{ notEmpty .id }}"
-      parentid: "{{ notEmpty .parentid }}"
-      codesignature:
-        {{- if ne .codesignature "java.lang.Thread.sleep:-2" }}
-          {{ notEmpty .codesignature }}
-        {{- end}}
-      duration: {{ ge .duration 0 }}
-      durationchildexcluded: {{ ge .durationchildexcluded 0 }}
-      count: {{ gt .count 0 }}
     {{- end }}
   {{- end }}
diff --git a/test/e2e/case/native-protocols/expected/profile-segment-detail.yml b/test/e2e/case/native-protocols/expected/profile-segment-detail.yml
index dd0a242..3e514a8 100644
--- a/test/e2e/case/native-protocols/expected/profile-segment-detail.yml
+++ b/test/e2e/case/native-protocols/expected/profile-segment-detail.yml
@@ -14,7 +14,7 @@
 # limitations under the License.
 
 spans:
-{{- range .spans }}
+{{- contains .spans }}
 - spanid: 0
   parentspanid: -1
   servicecode: e2e-service-provider
@@ -28,15 +28,11 @@ spans:
   iserror: false
   layer: Http
   tags:
-    {{- range .tags }}
-    {{- if eq .key "url" }}
+    {{- contains .tags }}
     - key: url
       value: {{ notEmpty .value }}
-    {{- end }}
-    {{- if eq .key "http.method" }}
     - key: http.method
       value: POST
     {{- end }}
-    {{- end }}
   logs: []
 {{- end }}
\ No newline at end of file
diff --git a/test/e2e/case/native-protocols/expected/profile-segment-list.yml b/test/e2e/case/native-protocols/expected/profile-segment-list.yml
index 079c9a0..19b2940 100644
--- a/test/e2e/case/native-protocols/expected/profile-segment-list.yml
+++ b/test/e2e/case/native-protocols/expected/profile-segment-list.yml
@@ -13,7 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-{{- range . }}
+{{- contains . }}
 - segmentid: {{ notEmpty .segmentid }}
   endpointnames:
     - /info
@@ -21,7 +21,7 @@
   start: "{{ notEmpty .start }}"
   iserror: false
   traceids:
-  {{- range .traceids }}
+  {{- contains .traceids }}
     - {{ notEmpty . }}
   {{- end }}
 {{- end }}
\ No newline at end of file
diff --git a/test/e2e/case/native-protocols/expected/service-endpoint.yml b/test/e2e/case/native-protocols/expected/service-endpoint.yml
index 76bf688..5e57d83 100644
--- a/test/e2e/case/native-protocols/expected/service-endpoint.yml
+++ b/test/e2e/case/native-protocols/expected/service-endpoint.yml
@@ -13,9 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-{{- range .}}
-{{- if eq .name "/info" }}
+{{- contains .}}
 - id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "/info" }}
   name: /info
-{{- end}}
 {{- end}}
\ No newline at end of file
diff --git a/test/e2e/case/native-protocols/expected/service-instance.yml b/test/e2e/case/native-protocols/expected/service-instance.yml
index ef74087..652b013 100644
--- a/test/e2e/case/native-protocols/expected/service-instance.yml
+++ b/test/e2e/case/native-protocols/expected/service-instance.yml
@@ -15,39 +15,25 @@
 # specific language governing permissions and limitations
 # under the License.
 
-{{- range .}}
+{{- contains .}}
 - id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "provider1" }}
   name: {{ notEmpty .name }}
   attributes:
-  {{- range .attributes }}
-  {{- if eq .name "OS Name" }}
+  {{- contains .attributes }}
   - name: OS Name
     value: Linux
-  {{- end }}
-  {{- if eq .name "hostname" }}
   - name: hostname
     value: {{ notEmpty .value }}
-  {{- end }}
-  {{- if eq .name "Process No." }}
   - name: Process No.
     value: "1"
-  {{- end }}
-  {{- if eq .name "Start Time" }}
   - name: Start Time
     value: {{ notEmpty .value }}
-  {{- end }}
-  {{- if eq .name "JVM Arguments" }}
   - name: JVM Arguments
     value: '{{ notEmpty .value }}'
-  {{- end }}
-  {{- if eq .name "Jar Dependencies" }}
   - name: Jar Dependencies
     value: '{{ notEmpty .value }}'
-  {{- end }}
-  {{- if eq .name "ipv4s" }}
   - name: ipv4s
     value: {{ notEmpty .value }}
-  {{- end }}
   {{- end}}
   language: JAVA
   instanceuuid: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "provider1" }}
diff --git a/test/e2e/case/native-protocols/expected/service.yml b/test/e2e/case/native-protocols/expected/service.yml
index e299d8b..66502d0 100644
--- a/test/e2e/case/native-protocols/expected/service.yml
+++ b/test/e2e/case/native-protocols/expected/service.yml
@@ -13,15 +13,11 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-{{- range . }}
-{{- if eq .name "e2e-service-provider" }}
+{{- contains . }}
 - id: {{ b64enc "e2e-service-provider" }}.1
   name: e2e-service-provider
   group: ""
-{{- end }}
-{{- if eq .name "e2e-service-consumer" }}
 - id: {{ b64enc "e2e-service-consumer" }}.1
   name: e2e-service-consumer
   group: ""
-{{- end }}
 {{- end }}
\ No newline at end of file
diff --git a/test/e2e/case/native-protocols/expected/trace-info-detail.yml b/test/e2e/case/native-protocols/expected/trace-info-detail.yml
index 2598ffb..c1cf7be 100644
--- a/test/e2e/case/native-protocols/expected/trace-info-detail.yml
+++ b/test/e2e/case/native-protocols/expected/trace-info-detail.yml
@@ -14,14 +14,14 @@
 # limitations under the License.
 
 spans:
-  {{- range .spans}}
+  {{- contains .spans}}
   - traceid: {{ notEmpty .traceid }}
     segmentid: {{ notEmpty .segmentid }}
     spanid: {{ .spanid }}
     parentspanid: {{ .parentspanid }}
     refs:
       {{- if eq .servicecode "e2e-service-provider" }}
-      {{- range .refs }}
+      {{- contains .refs }}
         - traceid: {{ notEmpty .traceid }}
           parentsegmentid: {{ notEmpty .parentsegmentid }}
           parentspanid: 1
@@ -53,15 +53,11 @@ spans:
     iserror: false
     layer: Http
     tags:
-      {{- range .tags }}
-      {{- if eq .key "http.method" }}
+      {{- contains .tags }}
       - key: http.method
         value: POST
-      {{- end }}
-      {{- if eq .key "url" }}
       - key: url
         value: {{ notEmpty .value }}
       {{- end }}
-      {{- end }}
     logs: []
   {{- end }}
\ No newline at end of file
diff --git a/test/e2e/case/native-protocols/expected/trace-users-detail.yml b/test/e2e/case/native-protocols/expected/trace-users-detail.yml
index 5129243..516dd94 100644
--- a/test/e2e/case/native-protocols/expected/trace-users-detail.yml
+++ b/test/e2e/case/native-protocols/expected/trace-users-detail.yml
@@ -14,7 +14,7 @@
 # limitations under the License.
 
 spans:
-  {{- range .spans}}
+  {{- contains .spans}}
   - traceid: {{ notEmpty .traceid }}
     segmentid: {{ notEmpty .segmentid }}
     spanid: 0
@@ -31,15 +31,11 @@ spans:
     iserror: false
     layer: Http
     tags:
-      {{- range .tags }}
-      {{- if eq .key "http.method" }}
+      {{- contains .tags }}
       - key: http.method
         value: POST
-      {{- end }}
-      {{- if eq .key "url" }}
       - key: url
         value: {{ notEmpty .value }}
       {{- end }}
-      {{- end }}
     logs: []
   {{- end }}
\ No newline at end of file
diff --git a/test/e2e/case/native-protocols/expected/traces-list.yml b/test/e2e/case/native-protocols/expected/traces-list.yml
index 823d383..249a6bd 100644
--- a/test/e2e/case/native-protocols/expected/traces-list.yml
+++ b/test/e2e/case/native-protocols/expected/traces-list.yml
@@ -14,24 +14,10 @@
 # limitations under the License.
 
 traces:
-{{- range .traces }}
+{{- contains .traces }}
 - segmentid: {{ notEmpty .segmentid }}
   endpointnames:
-  {{- if eq (index .endpointnames 0) "H2/JDBI/Statement/execute" }}
-    - H2/JDBI/Statement/execute
-  {{- end}}
-  {{- if eq (index .endpointnames 0) "H2/JDBI/Statement/executeQuery" }}
-    - H2/JDBI/Statement/executeQuery
-  {{- end}}
-  {{- if eq (index .endpointnames 0) "H2/JDBI/PreparedStatement/executeQuery" }}
-    - H2/JDBI/PreparedStatement/executeQuery
-  {{- end }}
-  {{- if eq (index .endpointnames 0) "/info" }}
     - /info
-  {{- end }}
-  {{- if eq (index .endpointnames 0) "/users" }}
-    - /users
-  {{- end }}
   duration: {{ ge .duration 0 }}
   start: "{{ notEmpty .start}}"
   iserror: false