Support E2E testing satellite native protocols (#7810)
This commit is contained in:
parent
96829da89a
commit
c467e4df06
|
|
@ -0,0 +1,65 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
name: 'Run Infra E2E Test'
|
||||
description: 'Common steps when running an E2E Test'
|
||||
inputs:
|
||||
config-file:
|
||||
description: 'The e2e test config file path'
|
||||
required: true
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Cache local Maven repository
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
- name: Check License
|
||||
uses: apache/skywalking-eyes@a63f4afcc287dfb3727ecc45a4afc55a5e69c15f
|
||||
- name: Setup E2E env
|
||||
shell: bash
|
||||
run: |
|
||||
function export_env() {
|
||||
echo "$1=$2" >> $GITHUB_ENV
|
||||
}
|
||||
|
||||
export_env SW_AGENT_JAVA_COMMIT 3997f0256056788bd054ee37e4603c11c0fd6756
|
||||
export_env SW_AGENT_SATELLITE_COMMIT 1f3c08a5af19f8522f2a40d9339c45fa816bfe07
|
||||
- name: Build Docker Image
|
||||
shell: bash
|
||||
env:
|
||||
SKIP_TEST: "true"
|
||||
run: |
|
||||
echo "::group::Build Docker Image"
|
||||
# Retry one more time due to frequent "maven connection reset"
|
||||
make docker || make docker
|
||||
echo "::endgroup::"
|
||||
- name: Build Java Test Services
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::group::build java test services"
|
||||
# Retry one more time due to frequent "maven connection reset"
|
||||
./mvnw --batch-mode -f test/e2e-v2/java-test-service/pom.xml clean package
|
||||
echo "::endgroup::"
|
||||
- name: Run E2E Test
|
||||
uses: apache/skywalking-infra-e2e@main
|
||||
with:
|
||||
e2e-file: $GITHUB_WORKSPACE/test/e2e-v2/cases/${{ inputs.config-file }}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
# 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.
|
||||
|
||||
name: E2E
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '**'
|
||||
- '!**.md'
|
||||
schedule:
|
||||
- cron: '0 18 * * *'
|
||||
|
||||
env:
|
||||
SW_AGENT_JDK_VERSION: 8
|
||||
SW_STORAGE: h2
|
||||
|
||||
concurrency:
|
||||
group: e2e-satellite-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
Satellite:
|
||||
if: (github.event_name == 'schedule' && github.repository == 'apache/skywalking') || (github.event_name != 'schedule')
|
||||
name: Satellite
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- name: Set Skip Env Var
|
||||
uses: ./.github/actions/skip
|
||||
- name: Run E2E Test
|
||||
if: env.SKIP_CI != 'true'
|
||||
uses: ./.github/actions/infra-e2e-test
|
||||
with:
|
||||
config-file: satellite/native-protocols/e2e.yaml
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
# 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.
|
||||
|
||||
ARG SW_AGENT_SATELLITE_COMMIT=1f3c08a5af19f8522f2a40d9339c45fa816bfe07
|
||||
FROM ghcr.io/apache/skywalking-satellite/skywalking-satellite:v${SW_AGENT_SATELLITE_COMMIT} as base
|
||||
|
||||
FROM alpine:3.10
|
||||
|
||||
COPY --from=base /skywalking-satellite /sw-satellite
|
||||
COPY --from=base /skywalking/configs /skywalking/
|
||||
|
||||
ENTRYPOINT ["/sw-satellite", "start", "--config", "/skywalking/configs/satellite_config.yaml"]
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
# 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:
|
||||
|
||||
etcd:
|
||||
hostname: etcd
|
||||
image: quay.io/coreos/etcd:v3.5.0
|
||||
ports:
|
||||
- 2379
|
||||
networks:
|
||||
- e2e
|
||||
environment:
|
||||
ETCD_LISTEN_CLIENT_URLS: http://0.0.0.0:2379
|
||||
ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379
|
||||
ETCD_LISTEN_PEER_URLS: http://0.0.0.0:2380
|
||||
ETCD_INITIAL_ADVERTISE_PEER_URLS: http://0.0.0.0:2380
|
||||
ETCD_INITIAL_CLUSTER: s1=http://0.0.0.0:2380
|
||||
ETCD_NAME: s1
|
||||
ETCD_DATA_DIR: /etcd-data
|
||||
healthcheck:
|
||||
test: ["CMD", "sh", "-c", "etcdctl endpoint health" ]
|
||||
interval: 5s
|
||||
timeout: 60s
|
||||
retries: 120
|
||||
|
||||
oap:
|
||||
extends:
|
||||
file: ../../../script/docker-compose/base-compose.yml
|
||||
service: oap
|
||||
environment:
|
||||
SW_LOG_LAL_FILES: test
|
||||
SW_CLUSTER: etcd
|
||||
SW_METER_ANALYZER_ACTIVE_FILES: spring-sleuth
|
||||
SW_CONFIGURATION: etcd
|
||||
volumes:
|
||||
- ./lal.yaml:/skywalking/config/lal/test.yaml
|
||||
ports:
|
||||
- 12800
|
||||
depends_on:
|
||||
etcd:
|
||||
condition: service_healthy
|
||||
|
||||
satellite:
|
||||
build:
|
||||
context: ../
|
||||
dockerfile: Dockerfile.satellite
|
||||
args:
|
||||
- SW_AGENT_SATELLITE_COMMIT=${SW_AGENT_SATELLITE_COMMIT}
|
||||
expose:
|
||||
- 11800
|
||||
environment:
|
||||
SATELLITE_GRPC_CLIENT: oap:11800
|
||||
SATELLITE_LOGPIPE_SENDER_MIN_FLUSH_EVENTS: 1
|
||||
SW_AGENT_SATELLITE_COMMIT: ${SW_AGENT_SATELLITE_COMMIT}
|
||||
volumes:
|
||||
- ./satellite_config.yaml:/skywalking/configs/satellite_config.yaml
|
||||
networks:
|
||||
- e2e
|
||||
healthcheck:
|
||||
test: [ "CMD", "sh", "-c", "nc -zn 127.0.0.1 11800" ]
|
||||
interval: 5s
|
||||
timeout: 60s
|
||||
retries: 120
|
||||
|
||||
provider:
|
||||
extends:
|
||||
file: ../../../script/docker-compose/base-compose.yml
|
||||
service: provider
|
||||
environment:
|
||||
SW_AGENT_COLLECTOR_BACKEND_SERVICES: satellite:11800
|
||||
SW_GRPC_LOG_SERVER_HOST: satellite
|
||||
SW_GRPC_LOG_SERVER_PORT: 11800
|
||||
ports:
|
||||
- 9090
|
||||
depends_on:
|
||||
satellite:
|
||||
condition: service_healthy
|
||||
|
||||
consumer:
|
||||
extends:
|
||||
file: ../../../script/docker-compose/base-compose.yml
|
||||
service: consumer
|
||||
environment:
|
||||
SW_AGENT_COLLECTOR_BACKEND_SERVICES: satellite:11800
|
||||
SW_GRPC_LOG_SERVER_HOST: satellite
|
||||
SW_GRPC_LOG_SERVER_PORT: 11800
|
||||
ports:
|
||||
- 9092
|
||||
depends_on:
|
||||
satellite:
|
||||
condition: service_healthy
|
||||
provider:
|
||||
condition: service_healthy
|
||||
|
||||
networks:
|
||||
e2e:
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
# 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
|
||||
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
|
||||
|
||||
cleanup:
|
||||
# always never success failure
|
||||
on: no
|
||||
|
||||
trigger:
|
||||
action: http
|
||||
interval: 10s
|
||||
times: 10
|
||||
url: http://${consumer_host}:${consumer_9092}/info
|
||||
method: POST
|
||||
|
||||
verify:
|
||||
# verify with retry strategy
|
||||
retry:
|
||||
# max retry count
|
||||
count: 20
|
||||
# the interval between two retries, in millisecond.
|
||||
interval: 10000
|
||||
cases:
|
||||
# basic check: service list
|
||||
- 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' -
|
||||
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' -)
|
||||
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=POST:/info --service=e2e-service-provider |yq e 'to_entries' -
|
||||
expected: expected/metrics-has-value.yml
|
||||
# basic check: dependency service
|
||||
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency service $(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls|grep -B 1 'provider'|yq e '.[0].id' -)
|
||||
expected: expected/dependency-services.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
|
||||
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' -
|
||||
expected: expected/metrics-has-value.yml
|
||||
|
||||
# native tracing: trace segment list
|
||||
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls
|
||||
expected: expected/traces-list.yml
|
||||
# native tracing: trace detail
|
||||
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace $(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/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' -
|
||||
expected: expected/metrics-has-value.yml
|
||||
|
||||
# native event: event list
|
||||
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql event list
|
||||
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}')
|
||||
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=POST:/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=POST:/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_9092}/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=POST:/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=POST:/info|yq e '.[0].id' -) | yq e '.[0].segmentid' -)
|
||||
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=POST:/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)
|
||||
expected: expected/profile-segment-analyze.yml
|
||||
|
||||
# native CDS: using etcdctl to update trace span limit, "/users" should have more than one span because it need DB save
|
||||
- query: |
|
||||
etcdctl --endpoints http://${etcd_host}:${etcd_2379}/ put /skywalking/configuration-discovery.default.agentConfigurations 'configurations:
|
||||
e2e-service-provider:
|
||||
agent.span_limit_per_segment: 1' | yq e '{"message": .}' -
|
||||
expected: expected/etcd-put.yml
|
||||
- query: |
|
||||
sleep 5;
|
||||
curl -X POST http://${provider_host}:${provider_9090}/users -d '{}' -H "Content-Type: application/json" > /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}')
|
||||
expected: expected/trace-users-detail.yml
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
# 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:
|
||||
{{- range .nodes }}
|
||||
{{- if eq .name "User" }}
|
||||
- id: {{ b64enc "User" }}.0
|
||||
name: User
|
||||
type: USER
|
||||
isreal: false
|
||||
{{- end }}
|
||||
{{- if eq .name "e2e-service-provider" }}
|
||||
- id: {{ b64enc "e2e-service-provider"}}.1
|
||||
name: e2e-service-provider
|
||||
type: Tomcat
|
||||
isreal: true
|
||||
{{- end }}
|
||||
{{- if eq .name "e2e-service-consumer" }}
|
||||
- id: {{ b64enc "e2e-service-consumer"}}.1
|
||||
name: e2e-service-consumer
|
||||
type: Tomcat
|
||||
isreal: true
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
calls:
|
||||
{{- range .calls }}
|
||||
{{- if eq .source "ZTJlLXNlcnZpY2UtY29uc3VtZXI=.1" }}
|
||||
- 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
|
||||
{{- end }}
|
||||
{{- if eq .source "VXNlcg==.0" }}
|
||||
- source: {{ b64enc "User" }}.0
|
||||
sourcecomponents: []
|
||||
target: {{ b64enc "e2e-service-consumer"}}.1
|
||||
targetcomponents: []
|
||||
id: {{ b64enc "User" }}.0-{{ b64enc "e2e-service-consumer"}}.1
|
||||
detectpoints:
|
||||
- SERVER
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
# 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.
|
||||
|
||||
message: OK
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
# 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.
|
||||
|
||||
events:
|
||||
{{- range .events }}
|
||||
- uuid: {{ notEmpty .uuid }}
|
||||
source:
|
||||
{{- if eq .source.service "e2e-service-provider" }}
|
||||
service: e2e-service-provider
|
||||
serviceinstance: provider1
|
||||
{{- end }}
|
||||
{{- if eq .source.service "e2e-service-consumer" }}
|
||||
service: e2e-service-consumer
|
||||
serviceinstance: consumer1
|
||||
{{- end }}
|
||||
endpoint: ""
|
||||
name: Start
|
||||
type: Normal
|
||||
message: Start Java Application
|
||||
parameters:
|
||||
{{- range .parameters }}
|
||||
{{- if eq .key "OPTS"}}
|
||||
- key: OPTS
|
||||
value: {{ notEmpty .value }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
starttime: {{ gt .starttime 0 }}
|
||||
endtime: {{ gt .endtime 0 }}
|
||||
{{- end }}
|
||||
total: {{ gt .total 0 }}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
# 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.
|
||||
|
||||
logs:
|
||||
{{- range .logs }}
|
||||
- servicename: e2e-service-provider
|
||||
serviceid: {{ b64enc "e2e-service-provider" }}.1
|
||||
serviceinstancename: provider1
|
||||
serviceinstanceid: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "provider1" }}
|
||||
endpointname: null
|
||||
endpointid: null
|
||||
traceid: {{ .traceid }}
|
||||
timestamp: {{ gt .timestamp 0 }}
|
||||
contenttype: TEXT
|
||||
content: |
|
||||
{{ notEmpty .content }}
|
||||
tags:
|
||||
{{- range .tags }}
|
||||
{{- if eq .key "level"}}
|
||||
- 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 }}
|
||||
total: {{ gt .total 0 }}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
# 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 0 }}
|
||||
- key: {{ notEmpty .key }}
|
||||
value: {{ ge .value 1 }}
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
# 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.
|
||||
|
||||
id: {{ notEmpty .id }}
|
||||
errorreason: null
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
# 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.
|
||||
|
||||
{{- range . }}
|
||||
- id: {{ notEmpty .id }}
|
||||
serviceid: {{ b64enc "e2e-service-provider" }}.1
|
||||
servicename: ""
|
||||
endpointname: POST:/info
|
||||
starttime: {{ gt .starttime 0 }}
|
||||
duration: 1
|
||||
mindurationthreshold: 0
|
||||
dumpperiod: 10
|
||||
maxsamplingcount: 9
|
||||
logs:
|
||||
{{- range .logs }}
|
||||
- id: {{ notEmpty .id }}
|
||||
instanceid: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "provider1" }}
|
||||
operationtype: {{ notEmpty .operationtype }}
|
||||
instancename: ""
|
||||
operationtime: {{ gt .operationtime 0 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
# 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.
|
||||
|
||||
tip: null
|
||||
trees:
|
||||
{{- range .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 }}
|
||||
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 }}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
# 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:
|
||||
{{- range .spans }}
|
||||
- spanid: 0
|
||||
parentspanid: -1
|
||||
servicecode: e2e-service-provider
|
||||
serviceinstancename: ""
|
||||
starttime: {{ gt .starttime 0 }}
|
||||
endtime: {{ gt .endtime 0 }}
|
||||
endpointname: POST:/info
|
||||
type: Entry
|
||||
peer: ""
|
||||
component: Tomcat
|
||||
iserror: false
|
||||
layer: Http
|
||||
tags:
|
||||
{{- range .tags }}
|
||||
{{- if eq .key "url" }}
|
||||
- key: url
|
||||
value: {{ notEmpty .value }}
|
||||
{{- end }}
|
||||
{{- if eq .key "http.method" }}
|
||||
- key: http.method
|
||||
value: POST
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
logs: []
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
# 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.
|
||||
|
||||
{{- range . }}
|
||||
- segmentid: {{ notEmpty .segmentid }}
|
||||
endpointnames:
|
||||
- POST:/info
|
||||
duration: {{ gt .duration 0 }}
|
||||
start: "{{ notEmpty .start }}"
|
||||
iserror: false
|
||||
traceids:
|
||||
{{- range .traceids }}
|
||||
- {{ notEmpty . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
# 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.
|
||||
|
||||
{{- range .}}
|
||||
{{- if eq .name "POST:/info" }}
|
||||
- id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "POST:/info" }}
|
||||
name: POST:/info
|
||||
{{- end}}
|
||||
{{- end}}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
# 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.
|
||||
|
||||
{{- range .}}
|
||||
- id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "provider1" }}
|
||||
name: {{ notEmpty .name }}
|
||||
attributes:
|
||||
{{- range .attributes }}
|
||||
{{- if eq .name "OS Name" }}
|
||||
- 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" }}
|
||||
{{- end}}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
# 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.
|
||||
|
||||
{{- range . }}
|
||||
{{- if eq .name "e2e-service-provider" }}
|
||||
- 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 }}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
# 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:
|
||||
{{- range .spans}}
|
||||
- traceid: {{ notEmpty .traceid }}
|
||||
segmentid: {{ notEmpty .segmentid }}
|
||||
spanid: {{ .spanid }}
|
||||
parentspanid: {{ .parentspanid }}
|
||||
refs:
|
||||
{{- if eq .servicecode "e2e-service-provider" }}
|
||||
{{- range .refs }}
|
||||
- traceid: {{ notEmpty .traceid }}
|
||||
parentsegmentid: {{ notEmpty .parentsegmentid }}
|
||||
parentspanid: 1
|
||||
type: CROSS_PROCESS
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if eq .servicecode "e2e-service-consumer" }}
|
||||
[]
|
||||
{{- end }}
|
||||
servicecode: {{ notEmpty .servicecode }}
|
||||
serviceinstancename: {{ notEmpty .serviceinstancename }}
|
||||
starttime: {{ gt .starttime 0 }}
|
||||
endtime: {{ gt .endtime 0 }}
|
||||
endpointname:
|
||||
{{- if eq .type "Exit" }}
|
||||
/info
|
||||
{{ else }}
|
||||
POST:/info
|
||||
{{- end }}
|
||||
type: {{ notEmpty .type }}
|
||||
peer:
|
||||
{{- if eq .type "Exit" }}
|
||||
provider:9090
|
||||
{{ else }}
|
||||
""
|
||||
{{- end }}
|
||||
component:
|
||||
{{- if eq .type "Exit" }}
|
||||
SpringRestTemplate
|
||||
{{- end }}
|
||||
{{- if eq .type "Entry" }}
|
||||
Tomcat
|
||||
{{- end }}
|
||||
iserror: false
|
||||
layer: Http
|
||||
tags:
|
||||
{{- range .tags }}
|
||||
{{- if eq .key "http.method" }}
|
||||
- key: http.method
|
||||
value: POST
|
||||
{{- end }}
|
||||
{{- if eq .key "url" }}
|
||||
- key: url
|
||||
value: {{ notEmpty .value }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
logs: []
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
# 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:
|
||||
{{- range .spans}}
|
||||
- traceid: {{ notEmpty .traceid }}
|
||||
segmentid: {{ notEmpty .segmentid }}
|
||||
spanid: 0
|
||||
parentspanid: -1
|
||||
refs: []
|
||||
servicecode: {{ notEmpty .servicecode }}
|
||||
serviceinstancename: {{ notEmpty .serviceinstancename }}
|
||||
starttime: {{ gt .starttime 0 }}
|
||||
endtime: {{ gt .endtime 0 }}
|
||||
endpointname: POST:/users
|
||||
type: Entry
|
||||
peer: ""
|
||||
component: Tomcat
|
||||
iserror: false
|
||||
layer: Http
|
||||
tags:
|
||||
{{- range .tags }}
|
||||
{{- if eq .key "http.method" }}
|
||||
- key: http.method
|
||||
value: POST
|
||||
{{- end }}
|
||||
{{- if eq .key "url" }}
|
||||
- key: url
|
||||
value: {{ notEmpty .value }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
logs: []
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
# 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:
|
||||
{{- range .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) "POST:/info" }}
|
||||
- POST:/info
|
||||
{{- end }}
|
||||
{{- if eq (index .endpointnames 0) "POST:/users" }}
|
||||
- POST:/users
|
||||
{{- end }}
|
||||
duration: {{ ge .duration 0 }}
|
||||
start: "{{ notEmpty .start}}"
|
||||
iserror: false
|
||||
traceids:
|
||||
- {{ (index .traceids 0) }}
|
||||
{{- end }}
|
||||
total: {{ gt .total 0 }}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
# 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.
|
||||
|
||||
rules:
|
||||
- name: example
|
||||
dsl: |
|
||||
filter {
|
||||
text {
|
||||
abortOnFailure false // for test purpose, we want to persist all logs
|
||||
regexp $/(?s)(?<timestamp>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{3}) \[TID:(?<tid>.+?)] \[(?<thread>.+?)] (?<level>\w{4,}) (?<logger>.{1,36}) (?<msg>.+)/$
|
||||
}
|
||||
extractor {
|
||||
}
|
||||
sink {
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,249 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
# The logger configuration.
|
||||
logger:
|
||||
# The log format pattern configuration.
|
||||
log_pattern: ${SATELLITE_LOGGER_LOG_PATTERN:%time [%level][%field] - %msg}
|
||||
# The time format pattern configuration.
|
||||
time_pattern: ${SATELLITE_LOGGER_TIME_PATTERN:2006-01-02 15:04:05.000}
|
||||
# The lowest level of printing allowed.
|
||||
level: ${SATELLITE_LOGGER_LEVEL:info}
|
||||
|
||||
# The Satellite self telemetry configuration.
|
||||
telemetry:
|
||||
# The space concept for the deployment, such as the namespace concept in the Kubernetes.
|
||||
cluster: ${SATELLITE_TELEMETRY_CLUSTER:satellite-cluster}
|
||||
# The group concept for the deployment, such as the service resource concept in the Kubernetes.
|
||||
service: ${SATELLITE_TELEMETRY_SERVICE:satellite-service}
|
||||
# The minimum running unit, such as the pod concept in the Kubernetes.
|
||||
instance: ${SATELLITE_TELEMETRY_SERVICE:satellite-instance}
|
||||
|
||||
# The sharing plugins referenced by the specific plugins in the different pipes.
|
||||
sharing:
|
||||
clients:
|
||||
- plugin_name: "grpc-client"
|
||||
# The gRPC server address (default localhost:11800).
|
||||
server_addr: ${SATELLITE_GRPC_CLIENT:127.0.0.1:11800}
|
||||
# The TLS switch
|
||||
enable_TLS: ${SATELLITE_GRPC_ENABLE_TLS:false}
|
||||
# The file path of client.pem. The config only works when opening the TLS switch.
|
||||
client_pem_path: ${SATELLITE_GRPC_CLIENT_PEM_PATH:"client.pem"}
|
||||
# The file path of client.key. The config only works when opening the TLS switch.
|
||||
client_key_path: ${SATELLITE_GRPC_CLIENT_KEY_PATH:"client.key"}
|
||||
# InsecureSkipVerify controls whether a client verifies the server's certificate chain and host name.
|
||||
insecure_skip_verify: ${SATELLITE_GRPC_INSECURE_SKIP_VERIFY:false}
|
||||
# The file path oca.pem. The config only works when opening the TLS switch.
|
||||
ca_pem_path: ${SATELLITE_grpc_CA_PEM_PATH:"ca.pem"}
|
||||
# How frequently to check the connection(second)
|
||||
check_period: ${SATELLITE_GRPC_CHECK_PERIOD:5}
|
||||
# The auth value when send request
|
||||
authentication: ${SATELLITE_GRPC_AUTHENTICATION:""}
|
||||
servers:
|
||||
- plugin_name: "grpc-server"
|
||||
# The address of grpc server.
|
||||
address: ${SATELLITE_GRPC_ADDRESS:":11800"}
|
||||
# The TLS cert file path.
|
||||
tls_cert_file: ${SATELLITE_GRPC_TLS_KEY_FILE:""}
|
||||
# The TLS key file path.
|
||||
tls_key_file: ${SATELLITE_GRPC_TLS_KEY_FILE:""}
|
||||
- plugin_name: "prometheus-server"
|
||||
# The prometheus server address.
|
||||
address: ${SATELLITE_PROMETHEUS_ADDRESS:":1234"}
|
||||
# The prometheus server metrics endpoint.
|
||||
endpoint: ${SATELLITE_PROMETHEUS_ENDPOINT:"/metrics"}
|
||||
|
||||
# The working pipe configurations.
|
||||
pipes:
|
||||
- common_config:
|
||||
pipe_name: logpipe
|
||||
gatherer:
|
||||
server_name: "grpc-server"
|
||||
receiver:
|
||||
plugin_name: "grpc-nativelog-receiver"
|
||||
queue:
|
||||
plugin_name: "memory-queue"
|
||||
# The maximum buffer event size.
|
||||
event_buffer_size: ${SATELLITE_QUEUE_EVENT_BUFFER_SIZE:5000}
|
||||
processor:
|
||||
filters:
|
||||
sender:
|
||||
fallbacker:
|
||||
plugin_name: none-fallbacker
|
||||
# The time interval between two flush operations. And the time unit is millisecond.
|
||||
flush_time: ${SATELLITE_LOGPIPE_SENDER_FLUSH_TIME:1000}
|
||||
# The maximum buffer elements.
|
||||
max_buffer_size: ${SATELLITE_LOGPIPE_SENDER_MAX_BUFFER_SIZE:200}
|
||||
# The minimum flush elements.
|
||||
min_flush_events: ${SATELLITE_LOGPIPE_SENDER_MIN_FLUSH_EVENTS:100}
|
||||
client_name: grpc-client
|
||||
forwarders:
|
||||
- plugin_name: nativelog-grpc-forwarder
|
||||
- common_config:
|
||||
pipe_name: managementpipe
|
||||
gatherer:
|
||||
server_name: "grpc-server"
|
||||
receiver:
|
||||
plugin_name: "grpc-nativemanagement-receiver"
|
||||
queue:
|
||||
plugin_name: "memory-queue"
|
||||
# The maximum buffer event size.
|
||||
event_buffer_size: ${SATELLITE_QUEUE_EVENT_BUFFER_SIZE:5000}
|
||||
processor:
|
||||
filters:
|
||||
sender:
|
||||
fallbacker:
|
||||
plugin_name: none-fallbacker
|
||||
# The time interval between two flush operations. And the time unit is millisecond.
|
||||
flush_time: ${SATELLITE_LOGMANAGEMENT_SENDER_FLUSH_TIME:1000}
|
||||
# The maximum buffer elements.
|
||||
max_buffer_size: ${SATELLITE_LOGMANAGEMENT_SENDER_MAX_BUFFER_SIZE:20}
|
||||
# The minimum flush elements.
|
||||
min_flush_events: ${SATELLITE_LOGMANAGEMENT_SENDER_MIN_FLUSH_EVENTS:1}
|
||||
client_name: grpc-client
|
||||
forwarders:
|
||||
- plugin_name: nativemanagement-grpc-forwarder
|
||||
- common_config:
|
||||
pipe_name: tracingpipe
|
||||
gatherer:
|
||||
server_name: "grpc-server"
|
||||
receiver:
|
||||
plugin_name: "grpc-nativetracing-receiver"
|
||||
queue:
|
||||
plugin_name: "memory-queue"
|
||||
# The maximum buffer event size.
|
||||
event_buffer_size: ${SATELLITE_QUEUE_EVENT_BUFFER_SIZE:5000}
|
||||
processor:
|
||||
filters:
|
||||
sender:
|
||||
fallbacker:
|
||||
plugin_name: none-fallbacker
|
||||
# The time interval between two flush operations. And the time unit is millisecond.
|
||||
flush_time: ${SATELLITE_TRACINGPIPE_SENDER_FLUSH_TIME:1000}
|
||||
# The maximum buffer elements.
|
||||
max_buffer_size: ${SATELLITE_TRACINGPIPE_SENDER_MAX_BUFFER_SIZE:200}
|
||||
# The minimum flush elements.
|
||||
min_flush_events: ${SATELLITE_TRACINGPIPE_SENDER_MIN_FLUSH_EVENTS:1}
|
||||
client_name: grpc-client
|
||||
forwarders:
|
||||
- plugin_name: nativetracing-grpc-forwarder
|
||||
- common_config:
|
||||
pipe_name: profilepipe
|
||||
gatherer:
|
||||
server_name: "grpc-server"
|
||||
receiver:
|
||||
plugin_name: "grpc-nativeprofile-receiver"
|
||||
queue:
|
||||
plugin_name: "memory-queue"
|
||||
# The maximum buffer event size.
|
||||
event_buffer_size: ${SATELLITE_QUEUE_EVENT_BUFFER_SIZE:5000}
|
||||
processor:
|
||||
filters:
|
||||
sender:
|
||||
fallbacker:
|
||||
plugin_name: none-fallbacker
|
||||
# The time interval between two flush operations. And the time unit is millisecond.
|
||||
flush_time: ${SATELLITE_PROFILEPIPE_SENDER_FLUSH_TIME:1000}
|
||||
# The maximum buffer elements.
|
||||
max_buffer_size: ${SATELLITE_PROFILEPIPE_SENDER_MAX_BUFFER_SIZE:200}
|
||||
# The minimum flush elements.
|
||||
min_flush_events: ${SATELLITE_PROFILEPIPE_SENDER_MIN_FLUSH_EVENTS:1}
|
||||
client_name: grpc-client
|
||||
forwarders:
|
||||
- plugin_name: nativeprofile-grpc-forwarder
|
||||
- common_config:
|
||||
pipe_name: cdspipe
|
||||
gatherer:
|
||||
server_name: "grpc-server"
|
||||
receiver:
|
||||
plugin_name: "grpc-nativecds-receiver"
|
||||
queue:
|
||||
plugin_name: "none-queue"
|
||||
processor:
|
||||
filters:
|
||||
sender:
|
||||
fallbacker:
|
||||
plugin_name: none-fallbacker
|
||||
client_name: grpc-client
|
||||
forwarders:
|
||||
- plugin_name: nativecds-grpc-forwarder
|
||||
- common_config:
|
||||
pipe_name: eventpipe
|
||||
gatherer:
|
||||
server_name: "grpc-server"
|
||||
receiver:
|
||||
plugin_name: "grpc-nativeevent-receiver"
|
||||
queue:
|
||||
plugin_name: "memory-queue"
|
||||
processor:
|
||||
filters:
|
||||
sender:
|
||||
fallbacker:
|
||||
plugin_name: none-fallbacker
|
||||
# The time interval between two flush operations. And the time unit is millisecond.
|
||||
flush_time: ${SATELLITE_EVENTPIPE_SENDER_FLUSH_TIME:1000}
|
||||
# The maximum buffer elements.
|
||||
max_buffer_size: ${SATELLITE_EVENTPIPE_SENDER_MAX_BUFFER_SIZE:200}
|
||||
# The minimum flush elements.
|
||||
min_flush_events: ${SATELLITE_EVENTPIPE_SENDER_MIN_FLUSH_EVENTS:1}
|
||||
client_name: grpc-client
|
||||
forwarders:
|
||||
- plugin_name: nativeevent-grpc-forwarder
|
||||
- common_config:
|
||||
pipe_name: jvmpipe
|
||||
gatherer:
|
||||
server_name: "grpc-server"
|
||||
receiver:
|
||||
plugin_name: "grpc-nativejvm-receiver"
|
||||
queue:
|
||||
plugin_name: "memory-queue"
|
||||
processor:
|
||||
filters:
|
||||
sender:
|
||||
fallbacker:
|
||||
plugin_name: none-fallbacker
|
||||
# The time interval between two flush operations. And the time unit is millisecond.
|
||||
flush_time: ${SATELLITE_JVMPIPE_SENDER_FLUSH_TIME:1000}
|
||||
# The maximum buffer elements.
|
||||
max_buffer_size: ${SATELLITE_JVMPIPE_SENDER_MAX_BUFFER_SIZE:200}
|
||||
# The minimum flush elements.
|
||||
min_flush_events: ${SATELLITE_JVMPIPE_SENDER_MIN_FLUSH_EVENTS:1}
|
||||
client_name: grpc-client
|
||||
forwarders:
|
||||
- plugin_name: nativejvm-grpc-forwarder
|
||||
- common_config:
|
||||
pipe_name: meterpipe
|
||||
gatherer:
|
||||
server_name: "grpc-server"
|
||||
receiver:
|
||||
plugin_name: "grpc-nativemeter-receiver"
|
||||
queue:
|
||||
plugin_name: "memory-queue"
|
||||
processor:
|
||||
filters:
|
||||
sender:
|
||||
fallbacker:
|
||||
plugin_name: none-fallbacker
|
||||
# The time interval between two flush operations. And the time unit is millisecond.
|
||||
flush_time: ${SATELLITE_METERPIPE_SENDER_FLUSH_TIME:1000}
|
||||
# The maximum buffer elements.
|
||||
max_buffer_size: ${SATELLITE_METERPIPE_SENDER_MAX_BUFFER_SIZE:200}
|
||||
# The minimum flush elements.
|
||||
min_flush_events: ${SATELLITE_METERPIPE_SENDER_MIN_FLUSH_EVENTS:1}
|
||||
client_name: grpc-client
|
||||
forwarders:
|
||||
- plugin_name: nativemeter-grpc-forwarder
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
# 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.
|
||||
|
||||
ARG SW_AGENT_JDK_VERSION=8
|
||||
ARG SW_AGENT_JAVA_COMMIT=1f3c08a5af19f8522f2a40d9339c45fa816bfe07
|
||||
|
||||
FROM ghcr.io/apache/skywalking-java/skywalking-java:${SW_AGENT_JAVA_COMMIT}-java${SW_AGENT_JDK_VERSION}
|
||||
|
||||
VOLUME /services
|
||||
|
||||
ENV SW_LOGGING_OUTPUT=CONSOLE
|
||||
|
||||
ADD e2e-service-consumer/target/e2e-service-consumer-2.0.0.jar /services/
|
||||
|
||||
CMD ["sh", "-c", "java -jar /services/e2e-service-consumer-2.0.0.jar"]
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
# 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.
|
||||
|
||||
ARG SW_AGENT_JDK_VERSION=8
|
||||
ARG SW_AGENT_JAVA_COMMIT=3997f0256056788bd054ee37e4603c11c0fd6756
|
||||
|
||||
FROM ghcr.io/apache/skywalking-java/skywalking-java:${SW_AGENT_JAVA_COMMIT}-java${SW_AGENT_JDK_VERSION}
|
||||
|
||||
VOLUME /services
|
||||
|
||||
ENV SW_LOGGING_OUTPUT=CONSOLE
|
||||
|
||||
ADD e2e-service-provider/target/e2e-service-provider-2.0.0.jar /services/
|
||||
|
||||
CMD ["sh", "-c", "java -jar /services/e2e-service-provider-2.0.0.jar"]
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ 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.
|
||||
~
|
||||
-->
|
||||
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>apache-skywalking-e2e</artifactId>
|
||||
<groupId>org.apache.skywalking</groupId>
|
||||
<version>2.0.0</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<artifactId>e2e-service-consumer</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.skywalking</groupId>
|
||||
<artifactId>apm-toolkit-trace</artifactId>
|
||||
<version>${sw.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>${spring.boot.version}</version>
|
||||
<configuration>
|
||||
<executable>true</executable>
|
||||
<addResources>true</addResources>
|
||||
<excludeDevtools>true</excludeDevtools>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.e2e;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Data
|
||||
@Configuration
|
||||
@ConfigurationProperties("e2e")
|
||||
public class E2EConfiguration {
|
||||
private String providerBaseUrl;
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.e2e;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class Service1Application {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(Service1Application.class, args);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.e2e;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class User {
|
||||
private Long id;
|
||||
private String name;
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.e2e.controller;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
public class HealthController {
|
||||
@GetMapping("/health")
|
||||
@SuppressWarnings("EmptyMethod")
|
||||
@ResponseStatus(code = HttpStatus.OK)
|
||||
public void hello() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.e2e.controller;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.skywalking.apm.toolkit.trace.TraceContext;
|
||||
import org.apache.skywalking.e2e.E2EConfiguration;
|
||||
import org.apache.skywalking.e2e.User;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.Random;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
public class UserController {
|
||||
private final RestTemplate restTemplate = new RestTemplate();
|
||||
|
||||
private final E2EConfiguration configuration;
|
||||
|
||||
private final int sleepMin = 500;
|
||||
|
||||
private final int sleepMax = 1000;
|
||||
|
||||
@PostMapping("/info")
|
||||
public String info() throws InterruptedException {
|
||||
Thread.sleep(randomSleepLong(sleepMin, sleepMax));
|
||||
|
||||
Optional<ResponseEntity<String>> optionalResponseEntity = Stream.of(
|
||||
Strings.nullToEmpty(configuration.getProviderBaseUrl()).split(","))
|
||||
.map(baseUrl -> restTemplate.postForEntity(
|
||||
baseUrl + "/info", null, String.class))
|
||||
.findFirst();
|
||||
if (optionalResponseEntity.isPresent() && optionalResponseEntity.get().getStatusCodeValue() == 200) {
|
||||
return optionalResponseEntity.get().getBody();
|
||||
}
|
||||
throw new RuntimeException();
|
||||
}
|
||||
|
||||
@PostMapping("/users")
|
||||
public Object createAuthor(@RequestBody final User user) throws InterruptedException {
|
||||
Thread.sleep(randomSleepLong(sleepMin, sleepMax));
|
||||
|
||||
return Stream.of(Strings.nullToEmpty(configuration.getProviderBaseUrl()).split(","))
|
||||
.map(baseUrl -> restTemplate.postForEntity(baseUrl + "/users", user, User.class))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@PostMapping("/correlation")
|
||||
public String correlation() throws InterruptedException {
|
||||
Thread.sleep(randomSleepLong(sleepMin, sleepMax));
|
||||
TraceContext.putCorrelation("CONSUMER_KEY", "consumer");
|
||||
|
||||
String baseUrl = configuration.getProviderBaseUrl();
|
||||
ResponseEntity<String> resp = restTemplate.postForEntity(baseUrl + "/correlation", null, String.class);
|
||||
return resp.getBody();
|
||||
}
|
||||
|
||||
private long randomSleepLong(int min, int max) {
|
||||
Random rand = new Random();
|
||||
int randomNumber = rand.nextInt((max - min) + 1) + min;
|
||||
return randomNumber;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
# 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.
|
||||
|
||||
server:
|
||||
port: 9092
|
||||
|
||||
spring:
|
||||
main:
|
||||
banner-mode: 'off'
|
||||
|
||||
e2e:
|
||||
provider-base-url: ${PROVIDER_URL:http://127.0.0.1:9090}
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ 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.
|
||||
~
|
||||
-->
|
||||
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>apache-skywalking-e2e</artifactId>
|
||||
<groupId>org.apache.skywalking</groupId>
|
||||
<version>2.0.0</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<artifactId>e2e-service-provider</artifactId>
|
||||
|
||||
<properties>
|
||||
<log4j.version>1.2.17</log4j.version>
|
||||
<log4j2.version>2.7</log4j2.version>
|
||||
<logback.version>1.2.3</logback.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||
<version>${spring.boot.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<version>${h2.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>log4j-to-slf4j</artifactId>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.skywalking</groupId>
|
||||
<artifactId>apm-toolkit-micrometer-registry</artifactId>
|
||||
<version>8.2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>${log4j.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-core</artifactId>
|
||||
<version>${log4j2.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<version>${logback.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.skywalking</groupId>
|
||||
<artifactId>apm-toolkit-logback-1.x</artifactId>
|
||||
<version>${sw.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.skywalking</groupId>
|
||||
<artifactId>apm-toolkit-log4j-1.x</artifactId>
|
||||
<version>${sw.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.skywalking</groupId>
|
||||
<artifactId>apm-toolkit-log4j-2.x</artifactId>
|
||||
<version>${sw.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.skywalking</groupId>
|
||||
<artifactId>apm-toolkit-trace</artifactId>
|
||||
<version>${sw.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>${spring.boot.version}</version>
|
||||
<configuration>
|
||||
<executable>true</executable>
|
||||
<addResources>true</addResources>
|
||||
<excludeDevtools>true</excludeDevtools>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.e2e;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class KeyValue {
|
||||
|
||||
private String key;
|
||||
private String value;
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.e2e;
|
||||
|
||||
import org.apache.skywalking.apm.meter.micrometer.SkywalkingMeterRegistry;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
|
||||
@EnableJpaRepositories
|
||||
@SpringBootApplication
|
||||
@ComponentScan({"org.apache.skywalking", "test.apache.skywalking"})
|
||||
public class Service0Application {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(Service0Application.class, args);
|
||||
}
|
||||
|
||||
@Bean
|
||||
SkywalkingMeterRegistry skywalkingMeterRegistry() {
|
||||
return new SkywalkingMeterRegistry();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.e2e;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@RequiredArgsConstructor
|
||||
public class User {
|
||||
@Id
|
||||
@GeneratedValue
|
||||
private Long id;
|
||||
|
||||
@Column
|
||||
private String name;
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.e2e;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface UserRepo extends JpaRepository<User, Long> {
|
||||
}
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.e2e.controller;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.apache.skywalking.e2e.KeyValue;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/alarm")
|
||||
public class AlarmController {
|
||||
|
||||
// Save all received alarm message from oap
|
||||
private List<AlarmMessage> alarmMessages = new ArrayList<>();
|
||||
|
||||
@PostMapping("/receive")
|
||||
public String receiveAlarmMessage(@RequestBody List<AlarmMessage> data) {
|
||||
alarmMessages.addAll(data);
|
||||
return "success";
|
||||
}
|
||||
|
||||
@PostMapping("/read")
|
||||
public Alarms readMessages() {
|
||||
return Alarms.builder().messages(alarmMessages).build();
|
||||
}
|
||||
|
||||
/**
|
||||
* Alarm message represents the details of each alarm.
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
@NoArgsConstructor
|
||||
public static class AlarmMessage {
|
||||
private int scopeId;
|
||||
private String scope;
|
||||
private String name;
|
||||
private String id0;
|
||||
private String id1;
|
||||
private String ruleName;
|
||||
private String alarmMessage;
|
||||
private long startTime;
|
||||
private List<KeyValue> tags;
|
||||
}
|
||||
|
||||
/**
|
||||
* Alarm wrapper
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class Alarms {
|
||||
private List<AlarmMessage> messages;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.e2e.controller;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.skywalking.apm.toolkit.trace.TraceContext;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
public class FileLogController {
|
||||
|
||||
private static final Logger LOG4J_LOGGER = Logger.getLogger("fileLogger");
|
||||
private static final org.apache.logging.log4j.Logger LOG4J2_LOGGER = LogManager.getLogger("fileLogger");
|
||||
private static final org.slf4j.Logger LOGBACK_LOGGER = LoggerFactory.getLogger("fileLogger");
|
||||
|
||||
@RequestMapping(value = "/file/logs/trigger")
|
||||
public String trigger() {
|
||||
LOG4J_LOGGER.info("log4j fileLogger ==> mills: " + System.currentTimeMillis());
|
||||
LOG4J2_LOGGER.info("log4j2 fileLogger ==> mills: " + System.currentTimeMillis());
|
||||
LOGBACK_LOGGER.info("logback fileLogger ==> mills: {}", System.currentTimeMillis());
|
||||
return TraceContext.traceId();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.e2e.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@SuppressWarnings("SameReturnValue")
|
||||
public class HealthController {
|
||||
@GetMapping("/health")
|
||||
public String hello() {
|
||||
return "healthy";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.e2e.controller;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.skywalking.apm.toolkit.trace.TraceContext;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
public class LogController {
|
||||
|
||||
private static final Logger LOG4J_LOGGER = Logger.getLogger(LogController.class);
|
||||
private static final org.apache.logging.log4j.Logger LOG4J2_LOGGER = LogManager.getLogger(
|
||||
LogController.class);
|
||||
private static final org.slf4j.Logger LOGBACK_LOGGER = LoggerFactory.getLogger(LogController.class);
|
||||
|
||||
@RequestMapping(value = "/logs/trigger")
|
||||
public String trigger() {
|
||||
LOG4J_LOGGER.info("log4j message==> now: " + System.currentTimeMillis());
|
||||
LOG4J2_LOGGER.info("log4j2 message==> now: " + System.currentTimeMillis());
|
||||
LOGBACK_LOGGER.info("logback message==> now: {}", System.currentTimeMillis());
|
||||
return TraceContext.traceId();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.e2e.controller;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.skywalking.apm.toolkit.trace.TraceContext;
|
||||
import org.apache.skywalking.e2e.User;
|
||||
import org.apache.skywalking.e2e.UserRepo;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@SuppressWarnings("SameReturnValue")
|
||||
public class UserController {
|
||||
private static final org.slf4j.Logger LOGBACK_LOGGER = LoggerFactory.getLogger(UserController.class);
|
||||
|
||||
private final UserRepo userRepo;
|
||||
private final int sleepMin = 500;
|
||||
private final int sleepMax = 1000;
|
||||
|
||||
@PostMapping("/info")
|
||||
public String info() throws InterruptedException {
|
||||
Thread.sleep(randomSleepLong(sleepMin, sleepMax));
|
||||
LOGBACK_LOGGER.info("logback message==> now: {}", System.currentTimeMillis());
|
||||
return "whatever";
|
||||
}
|
||||
|
||||
@PostMapping("/users")
|
||||
public User createAuthor(@RequestBody final User user) throws InterruptedException {
|
||||
Thread.sleep(randomSleepLong(sleepMin, sleepMax));
|
||||
return userRepo.save(user);
|
||||
}
|
||||
|
||||
@PostMapping("/correlation")
|
||||
public String correlation() throws InterruptedException {
|
||||
Thread.sleep(randomSleepLong(sleepMin, sleepMax));
|
||||
TraceContext.putCorrelation("PROVIDER_KEY", "provider");
|
||||
return TraceContext.getCorrelation("CONSUMER_KEY").orElse("") + "_"
|
||||
+ TraceContext.getCorrelation("MIDDLE_KEY").orElse("") + "_"
|
||||
+ TraceContext.getCorrelation("PROVIDER_KEY").orElse("");
|
||||
}
|
||||
|
||||
private long randomSleepLong(int min, int max) {
|
||||
Random rand = new Random();
|
||||
int randomNumber = rand.nextInt((max - min) + 1) + min;
|
||||
return randomNumber;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.e2e.lua;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.skywalking.apm.toolkit.trace.TraceContext;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
public class LuaController {
|
||||
protected final RestTemplate restTemplate = new RestTemplate();
|
||||
|
||||
@PostMapping("/nginx/entry/info")
|
||||
private String nginxEntry(String backend) throws MalformedURLException, URISyntaxException {
|
||||
final URL url = new URL("http://nginx:8080/nginx/info");
|
||||
TraceContext.putCorrelation("entry", "entry_value");
|
||||
final ResponseEntity<String> response = restTemplate.postForEntity(url.toURI(), null, String.class);
|
||||
return response.getBody();
|
||||
}
|
||||
|
||||
@PostMapping("/nginx/end/info")
|
||||
private String nginxEnd() throws InterruptedException {
|
||||
TimeUnit.SECONDS.sleep(1);
|
||||
|
||||
return TraceContext.getCorrelation("entry").orElse("")
|
||||
+ "_" + TraceContext.getCorrelation("nginx").orElse("");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
package test.apache.skywalking.e2e.profile;
|
||||
|
||||
import lombok.Data;
|
||||
import org.apache.skywalking.e2e.User;
|
||||
|
||||
@Data
|
||||
public class CreateUser {
|
||||
private String name;
|
||||
private boolean enableProfiling;
|
||||
|
||||
public User toUser() {
|
||||
return User.builder().name(name).build();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
package test.apache.skywalking.e2e.profile;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.skywalking.e2e.User;
|
||||
import org.apache.skywalking.e2e.UserRepo;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
public class ProfileController {
|
||||
private final UserRepo userRepo;
|
||||
|
||||
@PostMapping("/profile/{name}")
|
||||
public User createAuthor(@RequestBody final CreateUser createUser) throws InterruptedException {
|
||||
final User user = userRepo.save(createUser.toUser());
|
||||
if (createUser.isEnableProfiling()) {
|
||||
TimeUnit.MILLISECONDS.sleep(6200);
|
||||
}
|
||||
return user;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
# 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.
|
||||
|
||||
server:
|
||||
port: 9090
|
||||
|
||||
spring:
|
||||
main:
|
||||
banner-mode: 'off'
|
||||
datasource:
|
||||
url: jdbc:h2:mem:testdb
|
||||
driver-class-name: org.h2.Driver
|
||||
data-username: sa
|
||||
password: sa
|
||||
platform: org.hibernate.dialect.H2Dialect
|
||||
jpa:
|
||||
generate-ddl: true
|
||||
hibernate:
|
||||
ddl-auto: create-drop
|
||||
properties:
|
||||
hibernate.format_sql: true
|
||||
show-sql: true
|
||||
|
||||
management:
|
||||
metrics:
|
||||
use-global-registry: true
|
||||
web:
|
||||
server:
|
||||
request:
|
||||
autotime:
|
||||
enabled: true
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
# 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.
|
||||
log4j.rootLogger=info,CustomAppender
|
||||
log4j.appender.CustomAppender=org.apache.skywalking.apm.toolkit.log.log4j.v1.x.log.GRPCLogClientAppender
|
||||
log4j.appender.CustomAppender.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.CustomAppender.layout.ConversionPattern=[%t] %-5p %c %x - %m%n
|
||||
|
||||
log4j.logger.fileLogger=info,FileAppender
|
||||
log4j.appender.FileAppender=org.apache.log4j.FileAppender
|
||||
log4j.appender.FileAppender.ImmediateFlush=true
|
||||
log4j.appender.FileAppender.Append=true
|
||||
log4j.appender.FileAppender.File=/tmp/skywalking-logs/log4j1/e2e-service-provider.log
|
||||
log4j.appender.FileAppender.layout=org.apache.skywalking.apm.toolkit.log.log4j.v1.x.TraceIdPatternLayout
|
||||
log4j.appender.FileAppender.layout.ConversionPattern=[%T{SW_CTX}] [%p] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c:%L - %m%n
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ 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.
|
||||
-->
|
||||
<Configuration status="WARN">
|
||||
<Appenders>
|
||||
<Console name="Console" target="SYSTEM_OUT">
|
||||
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
|
||||
</Console>
|
||||
<GRPCLogClientAppender name="grpc-log">
|
||||
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
|
||||
</GRPCLogClientAppender>
|
||||
<RandomAccessFile name="fileAppender" fileName="/tmp/skywalking-logs/log4j2/e2e-service-provider.log" immediateFlush="true" append="true">
|
||||
<PatternLayout>
|
||||
<Pattern>[%sw_ctx] [%p] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c:%L - %m%n</Pattern>
|
||||
</PatternLayout>
|
||||
</RandomAccessFile>
|
||||
</Appenders>
|
||||
|
||||
|
||||
|
||||
<Loggers>
|
||||
<Root level="info">
|
||||
<AppenderRef ref="Console"/>
|
||||
<AppenderRef ref="grpc-log"/>
|
||||
</Root>
|
||||
<Logger name="fileLogger" level="info" additivity="false">
|
||||
<AppenderRef ref="fileAppender"/>
|
||||
</Logger>
|
||||
</Loggers>
|
||||
</Configuration>
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ 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.
|
||||
-->
|
||||
<configuration scan="true" scanPeriod=" 5 seconds">
|
||||
|
||||
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.mdc.TraceIdMDCPatternLogbackLayout">
|
||||
<Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%X{tid}] [%thread] %-5level %logger{36} -%msg%n</Pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<appender name="grpc-log" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.mdc.TraceIdMDCPatternLogbackLayout">
|
||||
<Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%X{tid}] [%thread] %-5level %logger{36} -%msg%n</Pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<appender name="fileAppender" class="ch.qos.logback.core.FileAppender">
|
||||
<file>/tmp/skywalking-logs/logback/e2e-service-provider.log</file>
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||
<Pattern>[%sw_ctx] [%level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %logger:%line - %msg%n</Pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<root level="INFO">
|
||||
<appender-ref ref="grpc-log"/>
|
||||
<appender-ref ref="stdout"/>
|
||||
</root>
|
||||
<logger name="fileLogger" level="INFO">
|
||||
<appender-ref ref="fileAppender"/>
|
||||
</logger>
|
||||
</configuration>
|
||||
|
|
@ -0,0 +1,181 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ 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.
|
||||
~
|
||||
-->
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.apache.skywalking</groupId>
|
||||
<artifactId>apache-skywalking-e2e</artifactId>
|
||||
<version>2.0.0</version>
|
||||
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<modules>
|
||||
<module>e2e-service-provider</module>
|
||||
<module>e2e-service-consumer</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<sw.version>8.7.0</sw.version>
|
||||
|
||||
<java.version>1.8</java.version>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
||||
<spring.boot.version>2.2.5.RELEASE</spring.boot.version>
|
||||
<spring.cloud.version>2.1.2.RELEASE</spring.cloud.version>
|
||||
<jupeter.version>5.6.0</jupeter.version>
|
||||
<jackson.version>2.9.7</jackson.version>
|
||||
<guava.version>30.1.1-jre</guava.version>
|
||||
<h2.version>1.4.199</h2.version>
|
||||
<mysql.version>8.0.13</mysql.version>
|
||||
<lombok.version>1.18.20</lombok.version>
|
||||
<kafka-clients.version>2.4.1</kafka-clients.version>
|
||||
|
||||
<maven-failsafe-plugin.version>2.22.0</maven-failsafe-plugin.version>
|
||||
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
|
||||
<maven-checkstyle-plugin.version>3.1.0</maven-checkstyle-plugin.version>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>apache.snapshots</id>
|
||||
<name>Apache Development Snapshot Repository</name>
|
||||
<url>https://repository.apache.org/content/groups/snapshots/</url>
|
||||
<releases>
|
||||
<enabled>false</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-dependencies</artifactId>
|
||||
<version>2.5.5</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>${guava.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>${lombok.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>${maven-compiler-plugin.version}</version>
|
||||
<configuration>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-failsafe-plugin</artifactId>
|
||||
<version>${maven-failsafe-plugin.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>**/*E2E.java</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>verify</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||
<version>${maven-checkstyle-plugin.version}</version>
|
||||
<configuration>
|
||||
<configLocation>${maven.multiModuleProjectDirectory}/apm-checkstyle/checkStyle.xml</configLocation>
|
||||
<encoding>UTF-8</encoding>
|
||||
<consoleOutput>true</consoleOutput>
|
||||
<includeTestSourceDirectory>true</includeTestSourceDirectory>
|
||||
<sourceDirectories>
|
||||
<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
|
||||
<sourceDirectory>${project.build.testSourceDirectory}</sourceDirectory>
|
||||
</sourceDirectories>
|
||||
<resourceIncludes>
|
||||
**/*.properties,
|
||||
**/*.sh,
|
||||
**/*.bat,
|
||||
**/*.yml,
|
||||
**/*.yaml,
|
||||
**/*.xml
|
||||
</resourceIncludes>
|
||||
<resourceExcludes>
|
||||
**/.asf.yaml,
|
||||
**/.github/**
|
||||
</resourceExcludes>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>validate</id>
|
||||
<phase>process-sources</phase>
|
||||
<goals>
|
||||
<goal>check</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
# 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:
|
||||
image: skywalking/oap:latest
|
||||
expose:
|
||||
- 11800
|
||||
- 12800
|
||||
- 10051
|
||||
- 5005
|
||||
networks:
|
||||
- e2e
|
||||
volumes:
|
||||
- ./../prepare/setup-oap/download-mysql.sh:/download-mysql.sh
|
||||
- ./../prepare/setup-oap/log4j2.xml:/skywalking/config/log4j2.xml
|
||||
environment:
|
||||
SW_CLUSTER_ZK_HOST_PORT: zk:2181
|
||||
SW_STORAGE_ES_CLUSTER_NODES: es:9200
|
||||
SW_JDBC_URL: jdbc:mysql://mysql:3306/swtest
|
||||
SW_STORAGE_INFLUXDB_URL: http://influxdb:8086
|
||||
SW_CONFIG_ETCD_PERIOD: 1
|
||||
SW_CONFIG_ETCD_ENDPOINTS: http://etcd:2379
|
||||
SW_CLUSTER_ETCD_ENDPOINTS: http://etcd:2379
|
||||
healthcheck:
|
||||
test: ["CMD", "sh", "-c", "nc -zn 127.0.0.1 11800"]
|
||||
interval: 5s
|
||||
timeout: 60s
|
||||
retries: 120
|
||||
|
||||
ui:
|
||||
image: skywalking/ui:latest
|
||||
expose:
|
||||
- 8080
|
||||
networks:
|
||||
- e2e
|
||||
environment:
|
||||
- SW_OAP_ADDRESS=http://oap:12800
|
||||
|
||||
provider:
|
||||
build:
|
||||
context: ../../java-test-service/
|
||||
dockerfile: Dockerfile.provider
|
||||
args:
|
||||
- SW_AGENT_JDK_VERSION=${SW_AGENT_JDK_VERSION}
|
||||
- SW_AGENT_JAVA_COMMIT=${SW_AGENT_JAVA_COMMIT}
|
||||
networks:
|
||||
- e2e
|
||||
expose:
|
||||
- 9090
|
||||
- 5005
|
||||
environment:
|
||||
SW_AGENT_COLLECTOR_BACKEND_SERVICES: oap:11800
|
||||
SW_AGENT_NAME: e2e-service-provider
|
||||
SW_AGENT_INSTANCE_NAME: provider1
|
||||
SW_AGENT_COLLECTOR_GET_PROFILE_TASK_INTERVAL: 1
|
||||
SW_AGENT_COLLECTOR_GET_AGENT_DYNAMIC_CONFIG_INTERVAL: 1
|
||||
healthcheck:
|
||||
test: ["CMD", "sh", "-c", "nc -nz 127.0.0.1 9090"]
|
||||
interval: 5s
|
||||
timeout: 60s
|
||||
retries: 120
|
||||
|
||||
consumer:
|
||||
build:
|
||||
context: ../../java-test-service/
|
||||
dockerfile: Dockerfile.consumer
|
||||
args:
|
||||
- SW_AGENT_JDK_VERSION=${SW_AGENT_JDK_VERSION}
|
||||
- SW_AGENT_JAVA_COMMIT=${SW_AGENT_JAVA_COMMIT}
|
||||
networks:
|
||||
- e2e
|
||||
expose:
|
||||
- 9092
|
||||
- 5005
|
||||
environment:
|
||||
SW_AGENT_COLLECTOR_BACKEND_SERVICES: oap:11800
|
||||
PROVIDER_URL: http://provider:9090
|
||||
SW_AGENT_NAME: e2e-service-consumer
|
||||
SW_AGENT_INSTANCE_NAME: consumer1
|
||||
SW_AGENT_COLLECTOR_GET_PROFILE_TASK_INTERVAL: 1
|
||||
SW_AGENT_COLLECTOR_GET_AGENT_DYNAMIC_CONFIG_INTERVAL: 1
|
||||
healthcheck:
|
||||
test: ["CMD", "sh", "-c", "nc -nz 127.0.0.1 9092"]
|
||||
interval: 5s
|
||||
timeout: 60s
|
||||
retries: 120
|
||||
|
||||
networks:
|
||||
e2e:
|
||||
|
|
@ -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
|
||||
|
|
@ -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/401e0e5671a3fb49de1d1e1e89f5b693b2062867.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
|
||||
|
|
@ -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
|
||||
|
|
@ -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"
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
#!/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
|
||||
|
||||
apk add curl
|
||||
|
||||
SW_HOME=/skywalking
|
||||
MYSQL_URL="https://repo.maven.apache.org/maven2/mysql/mysql-connector-java/8.0.13/mysql-connector-java-8.0.13.jar"
|
||||
MYSQL_DRIVER="mysql-connector-java-8.0.13.jar"
|
||||
|
||||
if ! curl -Lo "${SW_HOME}/oap-libs/${MYSQL_DRIVER}" ${MYSQL_URL}; then
|
||||
echo "Fail to download ${MYSQL_DRIVER}."
|
||||
exit 1
|
||||
fi
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ 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.
|
||||
~
|
||||
-->
|
||||
|
||||
<Configuration status="INFO">
|
||||
<Appenders>
|
||||
<Console name="Console" target="SYSTEM_OUT">
|
||||
<PatternLayout charset="UTF-8" pattern="%d %c %L [%t] %-5p %x - %m%n"/>
|
||||
</Console>
|
||||
</Appenders>
|
||||
<Loggers>
|
||||
<logger name="org.eclipse.jetty" level="INFO"/>
|
||||
<logger name="org.apache.zookeeper" level="INFO"/>
|
||||
<logger name="io.grpc.netty" level="INFO"/>
|
||||
<logger name="org.apache.skywalking.oap.meter.analyzer" level="DEBUG"/>
|
||||
<logger name="org.apache.skywalking.oap.server.receiver.istio.telemetry" level="DEBUG"/>
|
||||
<logger name="org.apache.skywalking.oap.server.fetcher.prometheus" level="DEBUG"/>
|
||||
<logger name="org.apache.skywalking.oap.server.receiver.envoy.als" level="DEBUG"/>
|
||||
<logger name="org.apache.skywalking.oap.server.storage.plugin.elasticsearch" level="DEBUG"/>
|
||||
<logger name="org.apache.skywalking.oap.server.core.storage.ttl" level="DEBUG"/>
|
||||
<logger name="org.apache.skywalking.library.elasticsearch" level="DEBUG"/>
|
||||
<Root level="INFO">
|
||||
<AppenderRef ref="Console"/>
|
||||
</Root>
|
||||
</Loggers>
|
||||
</Configuration>
|
||||
Loading…
Reference in New Issue