未验证 提交 f4c99db4 编写于 作者: W wankai123 提交者: GitHub

Replace e2e cases to e2e-v2: Nodejs (#7914)

上级 720dc924
......@@ -45,6 +45,6 @@ jobs:
uses: ./.github/actions/skip
- name: Run E2E Test
if: env.SKIP_CI != 'true'
uses: ./.github/actions/e2e-test
uses: ./.github/actions/infra-e2e-test
with:
test_class: org.apache.skywalking.e2e.NodeJSE2E
config-file: nodejs/e2e.yaml
......@@ -26,6 +26,7 @@ Release Notes.
attribute expression.
* Refactor the OAL compiler context to improve readability.
* Fix wrong generated codes of `hashCode` and `remoteHashCode` methods for numeric fields.
* Replace e2e cases to e2e-v2: Nodejs.
#### UI
......
......@@ -29,6 +29,8 @@ services:
extends:
file: ../../script/docker-compose/base-compose.yml
service: provider
environment:
SW_METER_REPORT_INTERVAL: 5
depends_on:
oap:
condition: service_healthy
......
# 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.
FROM node:12
ARG SW_AGENT_NODEJS_COMMIT
WORKDIR /app
EXPOSE 5050 5051
RUN git clone https://github.com/apache/skywalking-nodejs.git $(pwd)
RUN git reset --hard ${SW_AGENT_NODEJS_COMMIT} && git submodule update --init
RUN npm install
RUN npm run generate-source
RUN npm install express axios
/*!
*
* 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.
*
*/
import * as http from 'http';
import agent from './src';
import axios from 'axios';
agent.start({
serviceName: 'consumer',
maxBufferSize: 1000,
});
const server = http.createServer((req, res) => {
axios
.post(`http://${process.env.SERVER || 'localhost:5000'}${req.url}`, {}, {
headers: {
'Content-Type': 'application/json'
}
})
.then((r) => res.end(JSON.stringify(r.data)))
.catch(err => res.end(JSON.stringify(err.message)));
});
server.listen(5001, () => console.info('Listening on port 5001...'));
# 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:
oap:
extends:
file: ../../script/docker-compose/base-compose.yml
service: oap
ports:
- 12800
provider:
build:
context: .
dockerfile: Dockerfile.nodejs
args:
- SW_AGENT_NODEJS_COMMIT=${SW_AGENT_NODEJS_COMMIT}
networks:
- e2e
expose:
- 5000
environment:
SW_AGENT_COLLECTOR_BACKEND_SERVICES: oap:11800
SW_AGENT_INSTANCE: provider-instance
volumes:
- ./provider.ts:/app/provider.ts
depends_on:
oap:
condition: service_healthy
healthcheck:
test: [ "CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/5000" ]
interval: 5s
timeout: 60s
retries: 120
entrypoint: [ 'npx', 'ts-node', '/app/provider.ts' ]
medium:
extends:
file: ../../script/docker-compose/base-compose.yml
service: consumer
environment:
PROVIDER_URL: http://provider:5000
depends_on:
oap:
condition: service_healthy
provider:
condition: service_healthy
consumer:
build:
context: .
dockerfile: Dockerfile.nodejs
args:
- SW_AGENT_NODEJS_COMMIT=${SW_AGENT_NODEJS_COMMIT}
networks:
- e2e
ports:
- 5001
environment:
SW_AGENT_COLLECTOR_BACKEND_SERVICES: oap:11800
SW_AGENT_INSTANCE: consumer-instance
SERVER: medium:9092
volumes:
- ./consumer.ts:/app/consumer.ts
depends_on:
oap:
condition: service_healthy
medium:
condition: service_healthy
healthcheck:
test: [ "CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/5051" ]
interval: 5s
timeout: 60s
retries: 120
entrypoint: [ 'npx', 'ts-node', '/app/consumer.ts' ]
networks:
e2e:
# 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: 1200
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
- name: install etcdctl
command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh etcdctl
trigger:
action: http
interval: 3s
times: 10
url: http://${consumer_host}:${consumer_5001}/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:
# service list
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls
expected: expected/service.yml
# service instance list
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=provider
expected: expected/service-instance-provider-nodejs.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=consumer
expected: expected/service-instance-consumer-nodejs.yml
# service endpoint
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=users --service-name=provider
expected: expected/service-endpoint-provider-nodejs.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=users --service-name=consumer
expected: expected/service-endpoint-consumer-nodejs.yml
# trace segment list
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls
expected: expected/traces-list.yml
# dependency service
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency service --service-name=provider
expected: expected/dependency-services-provider-nodejs.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency service --service-name=consumer
expected: expected/dependency-services-consumer-nodejs.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency service --service-name=e2e-service-consumer
expected: expected/dependency-services-consumer.yml
# dependency instance
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency instance --service-name=consumer --dest-service-name=e2e-service-consumer
expected: expected/dependency-instance.yml
# service metrics
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_sla --service-name=consumer |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_cpm --service-name=consumer |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_resp_time --service-name=consumer |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_apdex --service-name=consumer |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
# service instance metrics
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_instance_resp_time --instance-name=provider-instance --service-name=provider |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_instance_cpm --instance-name=provider-instance --service-name=provider |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_instance_sla --instance-name=provider-instance --service-name=provider |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
# service endpoint metrics
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=endpoint_cpm --endpoint-name=/users --service-name=consumer |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=endpoint_avg --endpoint-name=/users --service-name=consumer |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=endpoint_sla --endpoint-name=/users --service-name=consumer |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
# service relation metrics
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_relation_client_cpm --service-name=consumer --dest-service-name=e2e-service-consumer |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_relation_server_cpm --service-name=consumer --dest-service-name=e2e-service-consumer |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_relation_client_cpm --service-name=e2e-service-consumer --dest-service-name=provider |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_relation_server_cpm --service-name=e2e-service-consumer --dest-service-name=provider |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
# service instance relation metrics
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_instance_relation_client_cpm --instance-name=consumer-instance --service-name=consumer --dest-instance-name=consumer1 --dest-service-name=e2e-service-consumer |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_instance_relation_server_cpm --instance-name=consumer-instance --service-name=consumer --dest-instance-name=consumer1 --dest-service-name=e2e-service-consumer |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
# 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: Tomcat
isreal: true
- id: {{ b64enc "consumer" }}.1_{{ b64enc "consumer-instance" }}
name: consumer-instance
serviceid: {{ b64enc "consumer" }}.1
servicename: consumer
type: ""
isreal: true
{{- end }}
calls:
{{- contains .calls }}
- source: {{ b64enc "consumer" }}.1_{{ b64enc "consumer-instance" }}
sourcecomponents: []
target: {{ b64enc "e2e-service-consumer" }}.1_{{ b64enc "consumer1" }}
targetcomponents: []
id: {{ b64enc "consumer" }}.1_{{ b64enc "consumer-instance" }}-{{ b64enc "e2e-service-consumer" }}.1_{{ b64enc "consumer1" }}
detectpoints:
- CLIENT
- SERVER
{{- end }}
# 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 "User" }}.0
name: User
type: USER
isreal: false
- id: {{ b64enc "e2e-service-consumer" }}.1
name: e2e-service-consumer
type: Tomcat
isreal: true
- id: {{ b64enc "consumer" }}.1
name: consumer
type: http
isreal: true
{{- end }}
calls:
{{- contains .calls }}
- source: {{ b64enc "consumer" }}.1
sourcecomponents: []
target: {{ b64enc "e2e-service-consumer" }}.1
targetcomponents: []
id: {{ b64enc "consumer" }}.1-{{ b64enc "e2e-service-consumer" }}.1
detectpoints:
- CLIENT
- SERVER
- source: {{ b64enc "User" }}.0
sourcecomponents: []
target: {{ b64enc "consumer" }}.1
targetcomponents: []
id: {{ b64enc "User" }}.0-{{ b64enc "consumer" }}.1
detectpoints:
- SERVER
{{- end }}
# 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 "provider" }}.1
name: provider
type: Express
isreal: true
- id: {{ b64enc "e2e-service-consumer" }}.1
name: e2e-service-consumer
type: Tomcat
isreal: true
- id: {{ b64enc "consumer" }}.1
name: consumer
type: http
isreal: true
{{- end }}
calls:
{{- contains .calls }}
- source: {{ b64enc "e2e-service-consumer" }}.1
sourcecomponents: []
target: {{ b64enc "provider" }}.1
targetcomponents: []
id: {{ b64enc "e2e-service-consumer" }}.1-{{ b64enc "provider" }}.1
detectpoints:
- CLIENT
- SERVER
- source: {{ b64enc "consumer" }}.1
sourcecomponents: []
target: {{ b64enc "e2e-service-consumer" }}.1
targetcomponents: []
id: {{ b64enc "consumer" }}.1-{{ b64enc "e2e-service-consumer" }}.1
detectpoints:
- CLIENT
- SERVER
{{- end }}
# 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 "provider" }}.1
name: provider
type: Express
isreal: true
- id: {{ b64enc "e2e-service-consumer" }}.1
name: e2e-service-consumer
type: Tomcat
isreal: true
{{- end }}
calls:
{{- contains .calls }}
- source: {{ b64enc "e2e-service-consumer" }}.1
sourcecomponents: []
target: {{ b64enc "provider" }}.1
targetcomponents: []
id: {{ b64enc "e2e-service-consumer" }}.1-{{ b64enc "provider" }}.1
detectpoints:
- CLIENT
- SERVER
{{- end }}
# 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: {{ notEmpty .key }}
value: {{ ge .value 1 }}
{{- end }}
\ No newline at end of file
# 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 .}}
- id: {{ b64enc "consumer" }}.1_{{ b64enc "/users" }}
name: /users
{{- end}}
# 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 .}}
- id: {{ b64enc "provider" }}.1_{{ b64enc "/users" }}
name: /users
{{- end}}
# 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 "consumer" }}.1_{{ b64enc "consumer-instance" }}
name: consumer-instance
attributes:
{{- contains .attributes }}
- name: OS Name
value: linux
- name: ""
value: "1"
- name: ipv4s
value: ""
{{- end}}
language: UNKNOWN
instanceuuid: {{ b64enc "consumer" }}.1_{{ b64enc "consumer-instance" }}
{{- end}}
# 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 "provider" }}.1_{{ b64enc "provider-instance" }}
name: provider-instance
attributes:
{{- contains .attributes }}
- name: OS Name
value: linux
- name: ""
value: "1"
- name: ipv4s
value: ""
{{- end}}
language: UNKNOWN
instanceuuid: {{ b64enc "provider" }}.1_{{ b64enc "provider-instance" }}
{{- end}}
# 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 . }}
- id: {{ b64enc "consumer" }}.1
name: consumer
group: ""
- id: {{ b64enc "provider" }}.1
name: provider
group: ""
- id: {{ b64enc "e2e-service-consumer" }}.1
name: e2e-service-consumer
group: ""
{{- end }}
# 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.
traces:
{{- contains .traces }}
- segmentid: {{ notEmpty .segmentid }}
endpointnames:
- /users
duration: {{ ge .duration 0 }}
start: "{{ notEmpty .start}}"
iserror: false
traceids:
- {{ (index .traceids 0) }}
{{- end }}
total: {{ gt .total 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.
*
*/
import agent from './src';
import express from 'express';
agent.start({
serviceName: 'provider',
maxBufferSize: 1000,
});
const app = express();
const handle = (req, res) => setTimeout(() => res.send({'id': 1, 'name': 'ke'}), 200);
app.get('/users', handle);
app.post('/users', handle);
app.listen(5000, () => console.info('Listening on port 5000...'));
......@@ -16,5 +16,6 @@
SW_AGENT_JAVA_COMMIT=3997f0256056788bd054ee37e4603c11c0fd6756
SW_AGENT_SATELLITE_COMMIT=1f3c08a5af19f8522f2a40d9339c45fa816bfe07
SW_AGENT_NGINX_LUA_COMMIT=c3cee4841798a147d83b96a10914d4ac0e11d0aa
SW_AGENT_NODEJS_COMMIT=e755659c7f308d3b5589619778c8360308cb14f8
SW_CTL_COMMIT=515a6a415f83a2e7ba114ca8c6fc79e2acd0ee4e
\ No newline at end of file
SW_CTL_COMMIT=515a6a415f83a2e7ba114ca8c6fc79e2acd0ee4e
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册