You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ke...@apache.org on 2022/10/14 12:11:26 UTC
[skywalking-showcase] branch main updated: Add group name to frontend service
This is an automated email from the ASF dual-hosted git repository.
kezhenxu94 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-showcase.git
The following commit(s) were added to refs/heads/main by this push:
new 9300196 Add group name to frontend service
9300196 is described below
commit 9300196878b27e3c4a080ff24218d3d05f819211
Author: kezhenxu94 <ke...@apache.org>
AuthorDate: Fri Oct 14 20:11:17 2022 +0800
Add group name to frontend service
---
.../kubernetes/feature-agent/resources.yaml | 43 +++++++++++-----------
services/app/frontend/src/index.js | 2 +-
2 files changed, 22 insertions(+), 23 deletions(-)
diff --git a/deploy/platform/kubernetes/feature-agent/resources.yaml b/deploy/platform/kubernetes/feature-agent/resources.yaml
index e2f6eb9..0d6cca4 100644
--- a/deploy/platform/kubernetes/feature-agent/resources.yaml
+++ b/deploy/platform/kubernetes/feature-agent/resources.yaml
@@ -251,23 +251,23 @@ data:
service_id: 1
-
uri: /v3/*
- service_id: 1
+ service_id: 1
-
uri: /homepage
- service_id: 2
+ service_id: 2
plugins:
skywalking:
- service_name: frontend
+ service_name: agent::frontend
service_instance_name: "$hostname"
- endpoint_addr: http://oap:12800
+ endpoint_addr: http://oap:12800
-
uri: /test
- service_id: 2
+ service_id: 2
plugins:
skywalking:
- service_name: frontend
+ service_name: agent::frontend
service_instance_name: "$hostname"
- endpoint_addr: http://oap:12800
+ endpoint_addr: http://oap:12800
services:
-
id: 1
@@ -280,11 +280,11 @@ data:
- id: 1
nodes:
"oap:12800": 1
- type: roundrobin
+ type: roundrobin
- id: 2
- nodes:
+ nodes:
"app:80": 1
- type: roundrobin
+ type: roundrobin
global_rules:
-
@@ -297,7 +297,7 @@ data:
#END
config: |
apisix:
- node_listen: 80
+ node_listen: 80
enable_ipv6: false
enable_admin: false
config_center: yaml
@@ -307,9 +307,9 @@ data:
ip: "0.0.0.0"
port: 9091
skywalking:
- service_name: frontend
+ service_name: agent::frontend
service_instance_name: "$hostname"
- endpoint_addr: http://oap:12800
+ endpoint_addr: http://oap:12800
plugins:
- prometheus
- skywalking
@@ -317,9 +317,9 @@ data:
http_server_configuration_snippet: |
location ~ \.(gif|jpg|png|js|css|html)$ {
root /app/build;
- index index.html;
- }
----
+ index index.html;
+ }
+---
apiVersion: apps/v1
kind: Deployment
metadata:
@@ -348,13 +348,13 @@ spec:
memory: "256Mi"
requests:
cpu: 500m
- memory: "256Mi"
+ memory: "256Mi"
ports:
- -
+ -
containerPort: 80
name: http
- -
- containerPort: 9091 # APISIX Prometheus pulgin port
+ -
+ containerPort: 9091 # APISIX Prometheus pulgin port
name: metrics
env:
- name: SW_AGENT_COLLECTOR_BACKEND_SERVICES
@@ -365,7 +365,7 @@ spec:
subPath: config
- name: apisix-config
mountPath: /usr/local/apisix/conf/apisix.yaml
- subPath: apisix
+ subPath: apisix
volumes:
- name: apisix-config
configMap:
@@ -383,4 +383,3 @@ spec:
port: 80
targetPort: 80
---
-
diff --git a/services/app/frontend/src/index.js b/services/app/frontend/src/index.js
index 5def603..b9fddea 100644
--- a/services/app/frontend/src/index.js
+++ b/services/app/frontend/src/index.js
@@ -25,7 +25,7 @@ import App from './App';
// @feature: nodejs-agent-frontend;
import ClientMonitor from 'skywalking-client-js';
-const agentName = process.env.REACT_APP_SW_AGENT_NAME_UI || 'agent::ui'
+const agentName = process.env.REACT_APP_SW_AGENT_NAME_UI || 'agent::frontend'
ClientMonitor.register({
service: agentName,