You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by zh...@apache.org on 2022/04/06 07:42:46 UTC

[skywalking-client-js] 01/01: Remove ServiceTag

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

zhangwei24 pushed a commit to branch service-tag
in repository https://gitbox.apache.org/repos/asf/skywalking-client-js.git

commit addf25eb85e6da0407613de122ec23f3afdc29b9
Author: zhangwei <zh...@apache.org>
AuthorDate: Wed Apr 6 15:42:38 2022 +0800

    Remove ServiceTag
---
 src/trace/interceptors/fetch.ts | 3 +--
 src/trace/interceptors/xhr.ts   | 4 ++--
 test/e2e.yaml                   | 2 +-
 test/expected/dependency.yml    | 8 ++++----
 test/expected/trace-detail.yml  | 2 +-
 5 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/trace/interceptors/fetch.ts b/src/trace/interceptors/fetch.ts
index 0db6fa8..90eabe4 100644
--- a/src/trace/interceptors/fetch.ts
+++ b/src/trace/interceptors/fetch.ts
@@ -22,7 +22,6 @@ import Base from '../../services/base';
 import {
   ComponentId,
   ReportTypes,
-  ServiceTag,
   SpanLayer,
   SpanType,
   ErrorsCategory,
@@ -38,7 +37,7 @@ export default function windowFetch(options: CustomOptionsType, segments: Segmen
     const traceSegmentId = uuid();
     let segment = {
       traceId: '',
-      service: options.service + ServiceTag,
+      service: options.service,
       spans: [],
       serviceInstance: options.serviceVersion,
       traceSegmentId: '',
diff --git a/src/trace/interceptors/xhr.ts b/src/trace/interceptors/xhr.ts
index a6f0156..ec2e627 100644
--- a/src/trace/interceptors/xhr.ts
+++ b/src/trace/interceptors/xhr.ts
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-import { ComponentId, ReadyStatus, ReportTypes, ServiceTag, SpanLayer, SpanType } from '../../services/constant';
+import { ComponentId, ReadyStatus, ReportTypes, SpanLayer, SpanType } from '../../services/constant';
 import uuid from '../../services/uuid';
 import { encode } from 'js-base64';
 import { CustomOptionsType } from '../../types';
@@ -69,7 +69,7 @@ export default function xhrInterceptor(options: CustomOptionsType, segments: Seg
   window.addEventListener('xhrReadyStateChange', (event: CustomEvent<XMLHttpRequest & { getRequestConfig: any[] }>) => {
     let segment = {
       traceId: '',
-      service: options.service + ServiceTag,
+      service: options.service,
       spans: [],
       serviceInstance: options.serviceVersion,
       traceSegmentId: '',
diff --git a/test/e2e.yaml b/test/e2e.yaml
index 2b50e24..b290579 100644
--- a/test/e2e.yaml
+++ b/test/e2e.yaml
@@ -133,7 +133,7 @@ verify:
           --name=browser_app_page_load_page_percentile --service-id dGVzdC11aQ==.1 --endpoint-name index.html |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
     # dependency service
     - expected: expected/dependency.yml
-      query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency service --service-id dGVzdC11aTxicm93c2VyPg==.1
+      query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency service --service-id dGVzdC11aQ==.1
     # trace
     - expected: expected/traces.yml
       query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls
diff --git a/test/expected/dependency.yml b/test/expected/dependency.yml
index 7cd89cd..5dee19b 100644
--- a/test/expected/dependency.yml
+++ b/test/expected/dependency.yml
@@ -19,18 +19,18 @@ nodes:
   name: provider-py
   type: Python
   isreal: true
-- id: {{ b64enc "test-ui<browser>"}}.1
-  name: test-ui<browser>
+- id: {{ b64enc "test-ui"}}.1
+  name: test-ui
   type: null
   isreal: true
 {{- end }}
 calls:
 {{- contains .calls }}
-- source: {{ b64enc "test-ui<browser>"}}.1
+- source: {{ b64enc "test-ui"}}.1
   sourcecomponents: []
   target: {{ b64enc "provider-py"}}.1
   targetcomponents: []
-  id: {{ b64enc "test-ui<browser>"}}.1-{{ b64enc "provider-py"}}.1
+  id: {{ b64enc "test-ui"}}.1-{{ b64enc "provider-py"}}.1
   detectpoints:
     - CLIENT
     - SERVER
diff --git a/test/expected/trace-detail.yml b/test/expected/trace-detail.yml
index 3d2bb3d..0682421 100644
--- a/test/expected/trace-detail.yml
+++ b/test/expected/trace-detail.yml
@@ -20,7 +20,7 @@ spans:
     spanid: 0
     parentspanid: -1
     refs: []
-    servicecode: test-ui<browser>
+    servicecode: test-ui
     serviceinstancename: "v1.0.0"
     starttime: {{ gt .starttime 0 }}
     endtime: {{ gt .endtime 0 }}