You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2025/07/28 12:31:30 UTC
(skywalking-java) branch main updated: Add support gRPC 1.59.x and 1.70.x server interceptor trace (#764)
This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-java.git
The following commit(s) were added to refs/heads/main by this push:
new 4bb2c2ff89 Add support gRPC 1.59.x and 1.70.x server interceptor trace (#764)
4bb2c2ff89 is described below
commit 4bb2c2ff89f1d3d0a2b6e78af5e5d4ce3d22b07b
Author: 回村的诱惑 <12...@qq.com>
AuthorDate: Mon Jul 28 20:31:25 2025 +0800
Add support gRPC 1.59.x and 1.70.x server interceptor trace (#764)
Root cause, grpc/grpc-java@050ae18 made changes to AbstractServerImplBuilder, which causes a functional issue with the gRPC tracing plugin.
---
.github/workflows/plugins-test.0.yaml | 2 +
CHANGES.md | 1 +
.../AbstractServerImplBuilderInstrumentation.java | 8 +-
.../AbstractServerImplBuilderInterceptor.java | 51 ++-
.../grpc-1.30.x-1.39.x-scenario/bin/startup.sh | 21 +
.../config/expectedData.yaml | 458 +++++++++++++++++++++
.../grpc-1.30.x-1.39.x-scenario/configuration.yml | 22 +
.../scenarios/grpc-1.30.x-1.39.x-scenario/pom.xml | 170 ++++++++
.../src/main/assembly/assembly.xml | 41 ++
.../skywalking/apm/testcase/grpc/Application.java | 34 ++
.../testcase/grpc/consumr/ConsumerInterceptor.java | 109 +++++
.../testcase/grpc/controller/CaseController.java | 137 ++++++
.../grpc/provider/ProviderConfiguration.java | 44 ++
.../provider/interceptor/ProviderInterceptor.java | 96 +++++
.../service/GreeterBlockingErrorServiceImpl.java | 31 ++
.../service/GreeterBlockingServiceImpl.java | 32 ++
.../grpc/provider/service/GreeterServiceImpl.java | 52 +++
.../src/main/proto/GreetService.proto | 43 ++
.../src/main/resources/application.yaml | 23 ++
.../src/main/resources/log4j2.xml | 30 ++
.../support-version.list | 31 ++
.../grpc-1.59.x-1.70.x-scenario/bin/startup.sh | 21 +
.../config/expectedData.yaml | 458 +++++++++++++++++++++
.../grpc-1.59.x-1.70.x-scenario/configuration.yml | 22 +
.../scenarios/grpc-1.59.x-1.70.x-scenario/pom.xml | 163 ++++++++
.../src/main/assembly/assembly.xml | 41 ++
.../skywalking/apm/testcase/grpc/Application.java | 34 ++
.../testcase/grpc/consumr/ConsumerInterceptor.java | 109 +++++
.../testcase/grpc/controller/CaseController.java | 137 ++++++
.../grpc/provider/ProviderConfiguration.java | 44 ++
.../provider/interceptor/ProviderInterceptor.java | 96 +++++
.../service/GreeterBlockingErrorServiceImpl.java | 31 ++
.../service/GreeterBlockingServiceImpl.java | 32 ++
.../grpc/provider/service/GreeterServiceImpl.java | 52 +++
.../src/main/proto/GreetService.proto | 43 ++
.../src/main/resources/application.yaml | 23 ++
.../src/main/resources/log4j2.xml | 30 ++
.../support-version.list | 35 ++
38 files changed, 2800 insertions(+), 7 deletions(-)
diff --git a/.github/workflows/plugins-test.0.yaml b/.github/workflows/plugins-test.0.yaml
index 19127048b5..a3f2653a1e 100644
--- a/.github/workflows/plugins-test.0.yaml
+++ b/.github/workflows/plugins-test.0.yaml
@@ -80,6 +80,8 @@ jobs:
- gateway-2.1.x-scenario
- gateway-2.0.x-scenario
- grpc-scenario
+ - grpc-1.59.x-1.70.x-scenario
+ - grpc-1.30.x-1.39.x-scenario
- gson-scenario
- guava-cache-scenario
- elasticjob-3.x-scenario
diff --git a/CHANGES.md b/CHANGES.md
index 57df5dde95..4f1bc7cee8 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -16,6 +16,7 @@ Release Notes.
* Fix RabbitMQ Consumer could not receive handleCancelOk callback.
* Support for tracking in lettuce versions 6.5.x and above.
* Upgrade byte-buddy version to 1.17.6.
+* Support gRPC 1.59.x and 1.70.x server interceptor trace
All issues and pull requests are [here](https://github.com/apache/skywalking/milestone/236?closed=1)
diff --git a/apm-sniffer/apm-sdk-plugin/grpc-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/grpc/v1/define/AbstractServerImplBuilderInstrumentation.java b/apm-sniffer/apm-sdk-plugin/grpc-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/grpc/v1/define/AbstractServerImplBuilderInstrumentation.java
index f32987f4bc..bd71445d7c 100644
--- a/apm-sniffer/apm-sdk-plugin/grpc-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/grpc/v1/define/AbstractServerImplBuilderInstrumentation.java
+++ b/apm-sniffer/apm-sdk-plugin/grpc-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/grpc/v1/define/AbstractServerImplBuilderInstrumentation.java
@@ -24,14 +24,13 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterc
import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
+import org.apache.skywalking.apm.agent.core.plugin.match.MultiClassNameMatch;
import static net.bytebuddy.matcher.ElementMatchers.named;
import static net.bytebuddy.matcher.ElementMatchers.takesNoArguments;
-import static org.apache.skywalking.apm.agent.core.plugin.match.NameMatch.byName;
public class AbstractServerImplBuilderInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
- public static final String ENHANCE_CLASS = "io.grpc.internal.AbstractServerImplBuilder";
public static final String ENHANCE_METHOD = "build";
public static final String INTERCEPT_CLASS = "org.apache.skywalking.apm.plugin.grpc.v1.server.AbstractServerImplBuilderInterceptor";
@@ -64,6 +63,9 @@ public class AbstractServerImplBuilderInstrumentation extends ClassInstanceMetho
@Override
protected ClassMatch enhanceClass() {
- return byName(ENHANCE_CLASS);
+ return MultiClassNameMatch.byMultiClassMatch(
+ "io.grpc.internal.AbstractServerImplBuilder", //grpc version <= 1.58.1
+ "io.grpc.internal.ServerImplBuilder" //grpc version >= 1.59.0
+ );
}
}
diff --git a/apm-sniffer/apm-sdk-plugin/grpc-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/grpc/v1/server/AbstractServerImplBuilderInterceptor.java b/apm-sniffer/apm-sdk-plugin/grpc-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/grpc/v1/server/AbstractServerImplBuilderInterceptor.java
index c02cf566de..cf1bcf4f76 100644
--- a/apm-sniffer/apm-sdk-plugin/grpc-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/grpc/v1/server/AbstractServerImplBuilderInterceptor.java
+++ b/apm-sniffer/apm-sdk-plugin/grpc-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/grpc/v1/server/AbstractServerImplBuilderInterceptor.java
@@ -20,7 +20,11 @@ package org.apache.skywalking.apm.plugin.grpc.v1.server;
import io.grpc.ServerBuilder;
+import java.lang.reflect.Field;
import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
@@ -30,14 +34,26 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInt
* {@link AbstractServerImplBuilderInterceptor} add the {@link ServerInterceptor} interceptor for every ServerService.
*/
public class AbstractServerImplBuilderInterceptor implements InstanceMethodsAroundInterceptor {
+ private final static Map<Class<?>, Field> FIELD_CACHE = new HashMap<>();
+
@Override
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
- MethodInterceptResult result) {
+ MethodInterceptResult result) throws Throwable {
if (objInst.getSkyWalkingDynamicField() == null) {
ServerBuilder<?> builder = (ServerBuilder) objInst;
- ServerInterceptor interceptor = new ServerInterceptor();
- builder.intercept(interceptor);
- objInst.setSkyWalkingDynamicField(interceptor);
+ Field field = findField(builder.getClass());
+ if (field != null) {
+ List<?> interceptors = (List<?>) field.get(builder);
+ boolean hasCustomInterceptor = interceptors.stream()
+ .anyMatch(i -> i.getClass() == ServerInterceptor.class);
+
+ if (!hasCustomInterceptor) {
+ ServerInterceptor interceptor = new ServerInterceptor();
+ builder.intercept(interceptor);
+ objInst.setSkyWalkingDynamicField(interceptor);
+ }
+
+ }
}
}
@@ -52,4 +68,31 @@ public class AbstractServerImplBuilderInterceptor implements InstanceMethodsArou
Class<?>[] argumentsTypes, Throwable t) {
}
+
+ private static Field findField(Class<?> clazz) {
+ if (FIELD_CACHE.containsKey(clazz)) {
+ return FIELD_CACHE.get(clazz);
+ }
+ synchronized (AbstractServerImplBuilderInterceptor.class) {
+ if (FIELD_CACHE.containsKey(clazz)) {
+ return FIELD_CACHE.get(clazz);
+ }
+ Field field = doFindField(clazz);
+ FIELD_CACHE.put(clazz, field);
+ return field;
+ }
+ }
+
+ private static Field doFindField(Class<?> clazz) {
+ while (clazz != null) {
+ for (Field f : clazz.getDeclaredFields()) {
+ if (f.getName().equals("interceptors")) {
+ f.setAccessible(true);
+ return f;
+ }
+ }
+ clazz = clazz.getSuperclass();
+ }
+ return null;
+ }
}
diff --git a/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/bin/startup.sh b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/bin/startup.sh
new file mode 100644
index 0000000000..aeac2a7b77
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/bin/startup.sh
@@ -0,0 +1,21 @@
+#!/bin/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.
+
+home="$(cd "$(dirname $0)"; pwd)"
+
+java -jar ${agent_opts} ${home}/../libs/grpc-1.30.x-1.39.x-scenario.jar &
diff --git a/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/config/expectedData.yaml
new file mode 100644
index 0000000000..b4551acf3e
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/config/expectedData.yaml
@@ -0,0 +1,458 @@
+# 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.
+segmentItems:
+ - serviceName: grpc-1.30.x-1.39.x-scenario
+ segmentSize: gt 10
+ segments:
+ - segmentId: not null
+ spans:
+ - operationName: GreeterBlocking.sayHello
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Entry
+ peer: ''
+ refs:
+ - {parentEndpoint: GET:/grpc-1.30.x-1.39.x-scenario/case/grpc-1.30.x-1.39.x-scenario, networkAddress: '127.0.0.1:18080',
+ refType: CrossProcess, parentSpanId: 2, parentTraceSegmentId: not null, parentServiceInstance: not
+ null, parentService: grpc-1.30.x-1.39.x-scenario, traceId: not null}
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: Greeter.sayHello/client/Request/onMessage
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ refs:
+ - {parentEndpoint: GET:/grpc-1.30.x-1.39.x-scenario/case/grpc-1.30.x-1.39.x-scenario, networkAddress: '', refType: CrossThread,
+ parentSpanId: 1, parentTraceSegmentId: not null, parentServiceInstance: not
+ null, parentService: not null, traceId: not null}
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: Greeter.sayHello/client/Request/onMessage
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ refs:
+ - {parentEndpoint: GET:/grpc-1.30.x-1.39.x-scenario/case/grpc-1.30.x-1.39.x-scenario, networkAddress: '', refType: CrossThread,
+ parentSpanId: 1, parentTraceSegmentId: not null, parentServiceInstance: not
+ null, parentService: grpc-1.30.x-1.39.x-scenario, traceId: not null}
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: Greeter.sayHello/client/Request/onComplete
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ refs:
+ - {parentEndpoint: GET:/grpc-1.30.x-1.39.x-scenario/case/grpc-1.30.x-1.39.x-scenario, networkAddress: '', refType: CrossThread,
+ parentSpanId: 1, parentTraceSegmentId: not null, parentServiceInstance: not
+ null, parentService: grpc-1.30.x-1.39.x-scenario, traceId: not null}
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: Greeter.sayHello
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Entry
+ peer: ''
+ refs:
+ - {parentEndpoint: GET:/grpc-1.30.x-1.39.x-scenario/case/grpc-1.30.x-1.39.x-scenario, networkAddress: '127.0.0.1:18080',
+ refType: CrossProcess, parentSpanId: 1, parentTraceSegmentId: not null, parentServiceInstance: not
+ null, parentService: grpc-1.30.x-1.39.x-scenario, traceId: not null}
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: Greeter.sayHello/server/Response/onMessage
+ parentSpanId: 0
+ spanId: 1
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ skipAnalysis: 'false'
+ - operationName: Greeter.sayHello/server/Request/onMessage
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ refs:
+ - {parentEndpoint: Greeter.sayHello, networkAddress: '', refType: CrossThread,
+ parentSpanId: 0, parentTraceSegmentId: not null, parentServiceInstance: not
+ null, parentService: not null, traceId: not null}
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: Greeter.sayHello/client/Response/onMessage
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ refs:
+ - {parentEndpoint: GET:/grpc-1.30.x-1.39.x-scenario/case/grpc-1.30.x-1.39.x-scenario, networkAddress: '', refType: CrossThread,
+ parentSpanId: 1, parentTraceSegmentId: not null, parentServiceInstance: not
+ null, parentService: not null, traceId: not null}
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: GreeterBlocking.sayHello/server/Response/onClose
+ parentSpanId: 0
+ spanId: 1
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ tags:
+ - {key: rpc.status_code, value: OK}
+ skipAnalysis: 'false'
+ - operationName: GreeterBlocking.sayHello/server/Request/onHalfClose
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ refs:
+ - {parentEndpoint: GreeterBlocking.sayHello, networkAddress: '', refType: CrossThread,
+ parentSpanId: 0, parentTraceSegmentId: not null, parentServiceInstance: not
+ null, parentService: grpc-1.30.x-1.39.x-scenario, traceId: not null}
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: Greeter.sayHello/server/Response/onMessage
+ parentSpanId: 0
+ spanId: 1
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ skipAnalysis: 'false'
+ - operationName: Greeter.sayHello/server/Request/onMessage
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ refs:
+ - {parentEndpoint: Greeter.sayHello, networkAddress: '', refType: CrossThread,
+ parentSpanId: 0, parentTraceSegmentId: not null, parentServiceInstance: not
+ null, parentService: grpc-1.30.x-1.39.x-scenario, traceId: not null}
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: Greeter.sayHello/server/Response/onClose
+ parentSpanId: 0
+ spanId: 1
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ tags:
+ - {key: rpc.status_code, value: OK}
+ skipAnalysis: 'false'
+ - operationName: Greeter.sayHello/server/Request/onHalfClose
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ refs:
+ - {parentEndpoint: Greeter.sayHello, networkAddress: '', refType: CrossThread,
+ parentSpanId: 0, parentTraceSegmentId: not null, parentServiceInstance: not
+ null, parentService: grpc-1.30.x-1.39.x-scenario, traceId: not null}
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: Greeter.sayHello/client/Response/onMessage
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ refs:
+ - {parentEndpoint: GET:/grpc-1.30.x-1.39.x-scenario/case/grpc-1.30.x-1.39.x-scenario, networkAddress: '', refType: CrossThread,
+ parentSpanId: 1, parentTraceSegmentId: not null, parentServiceInstance: not
+ null, parentService: grpc-1.30.x-1.39.x-scenario, traceId: not null}
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: Greeter.sayHello/client/Response/onClose
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ refs:
+ - {parentEndpoint: GET:/grpc-1.30.x-1.39.x-scenario/case/grpc-1.30.x-1.39.x-scenario, networkAddress: '', refType: CrossThread,
+ parentSpanId: 1, parentTraceSegmentId: not null, parentServiceInstance: not
+ null, parentService: grpc-1.30.x-1.39.x-scenario, traceId: not null}
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: GreeterBlockingError.sayHello
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Entry
+ peer: ''
+ refs:
+ - {parentEndpoint: GET:/grpc-1.30.x-1.39.x-scenario/case/grpc-1.30.x-1.39.x-scenario, networkAddress: '127.0.0.1:18080',
+ refType: CrossProcess, parentSpanId: 5, parentTraceSegmentId: not null, parentServiceInstance: not
+ null, parentService: grpc-1.30.x-1.39.x-scenario, traceId: not null}
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: GreeterBlockingError.sayHello/server/Response/onClose
+ parentSpanId: 0
+ spanId: 1
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: true
+ spanType: Local
+ peer: ''
+ tags:
+ - {key: rpc.status_code, value: UNKNOWN}
+ logs:
+ - logEvent:
+ - {key: event, value: error}
+ - {key: error.kind, value: java.lang.Exception}
+ - {key: message, value: ''}
+ - {key: stack, value: not null}
+ skipAnalysis: 'false'
+ - operationName: GreeterBlockingError.sayHello/server/Request/onHalfClose
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ refs:
+ - {parentEndpoint: GreeterBlockingError.sayHello, networkAddress: '', refType: CrossThread,
+ parentSpanId: 0, parentTraceSegmentId: not null, parentServiceInstance: not
+ null, parentService: grpc-1.30.x-1.39.x-scenario, traceId: not null}
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: Greeter.sayHello
+ parentSpanId: 0
+ spanId: 1
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Exit
+ peer: '127.0.0.1:18080'
+ skipAnalysis: 'false'
+ - operationName: GreeterBlocking.sayHello/client/Request/onComplete
+ parentSpanId: 2
+ spanId: 3
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ skipAnalysis: 'false'
+ - operationName: GreeterBlocking.sayHello/client/Response/onClose
+ parentSpanId: 2
+ spanId: 4
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ skipAnalysis: 'false'
+ - operationName: GreeterBlocking.sayHello
+ parentSpanId: 0
+ panId: 2
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Exit
+ peer: '127.0.0.1:18080'
+ skipAnalysis: 'false'
+ - operationName: GreeterBlockingError.sayHello/client/Request/onComplete
+ parentSpanId: 5
+ spanId: 6
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ skipAnalysis: 'false'
+ - operationName: GreeterBlockingError.sayHello/client/Response/onClose
+ parentSpanId: 5
+ spanId: 7
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: true
+ spanType: Local
+ peer: ''
+ tags:
+ - {key: rpc.status_code, value: UNKNOWN}
+ logs:
+ - logEvent:
+ - {key: event, value: error}
+ - {key: error.kind, value: io.grpc.StatusRuntimeException}
+ - {key: message, value: UNKNOWN}
+ - {key: stack, value: not null}
+ skipAnalysis: 'false'
+ - operationName: GreeterBlockingError.sayHello/client/Request/onCancel
+ parentSpanId: 5
+ spanId: 8
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: true
+ spanType: Local
+ peer: ''
+ logs:
+ - logEvent:
+ - {key: event, value: error}
+ - {key: error.kind, value: io.grpc.StatusRuntimeException}
+ - {key: message, value: UNKNOWN}
+ - {key: stack, value: not null}
+ skipAnalysis: 'false'
+ - operationName: GreeterBlockingError.sayHello
+ parentSpanId: 0
+ spanId: 5
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: true
+ spanType: Exit
+ peer: 127.0.0.1:18080
+ logs:
+ - logEvent:
+ - {key: event, value: error}
+ - {key: error.kind, value: io.grpc.StatusRuntimeException}
+ - {key: message, value: UNKNOWN}
+ - {key: stack, value: not null}
+ skipAnalysis: 'false'
+ - operationName: GET:/grpc-1.30.x-1.39.x-scenario/case/grpc-1.30.x-1.39.x-scenario
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 1
+ isError: true
+ spanType: Entry
+ peer: ''
+ tags:
+ - {key: url, value: 'http://localhost:8080/grpc-1.30.x-1.39.x-scenario/case/grpc-1.30.x-1.39.x-scenario'}
+ - {key: http.method, value: GET}
+ - {key: http.status_code, value: '500'}
+ logs:
+ - logEvent:
+ - {key: event, value: error}
+ - {key: error.kind, value: org.springframework.web.util.NestedServletException}
+ - {key: message, value: 'Request processing failed; nested exception is io.grpc.StatusRuntimeException:
+ UNKNOWN'}
+ - {key: stack, value: not null}
+ - logEvent:
+ - {key: forward-url, value: /grpc-1.30.x-1.39.x-scenario/error}
+ skipAnalysis: 'false'
diff --git a/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/configuration.yml b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/configuration.yml
new file mode 100644
index 0000000000..932097e647
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/configuration.yml
@@ -0,0 +1,22 @@
+# 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.
+
+type: jvm
+entryService: http://localhost:8080/grpc-1.30.x-1.39.x-scenario/case/grpc-1.30.x-1.39.x-scenario
+healthCheck: http://localhost:8080/grpc-1.30.x-1.39.x-scenario/case/healthCheck
+startScript: ./bin/startup.sh
+environment:
+dependencies:
diff --git a/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/pom.xml b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/pom.xml
new file mode 100644
index 0000000000..de23b46190
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/pom.xml
@@ -0,0 +1,170 @@
+<?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">
+
+ <groupId>org.apache.skywalking.apm.testcase</groupId>
+ <artifactId>grpc-1.30.x-1.39.x-scenario</artifactId>
+ <version>1.0.0</version>
+ <packaging>jar</packaging>
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <compiler.version>1.8</compiler.version>
+ <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
+ <os-maven-plugin.version>1.6.2</os-maven-plugin.version>
+
+ <test.framework.version>1.39.0</test.framework.version>
+
+ <spring.boot.version>2.1.6.RELEASE</spring.boot.version>
+ </properties>
+
+ <name>skywalking-grpc-1.30.x-1.39.x-scenario</name>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-dependencies</artifactId>
+ <version>${spring.boot.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-web</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-log4j2</artifactId>
+ </dependency>
+
+ <!-- grpc -->
+ <dependency>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-all</artifactId>
+ <version>${test.framework.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-rls</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+
+ </dependencies>
+
+ <build>
+ <finalName>grpc-1.30.x-1.39.x-scenario</finalName>
+ <plugins>
+ <plugin>
+ <groupId>kr.motd.maven</groupId>
+ <artifactId>os-maven-plugin</artifactId>
+ <version>${os-maven-plugin.version}</version>
+ <executions>
+ <execution>
+ <phase>initialize</phase>
+ <goals>
+ <goal>detect</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ <version>${spring.boot.version}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>repackage</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>${maven-compiler-plugin.version}</version>
+ <configuration>
+ <source>${compiler.version}</source>
+ <target>${compiler.version}</target>
+ <encoding>${project.build.sourceEncoding}</encoding>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>assemble</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/assembly/assembly.xml</descriptor>
+ </descriptors>
+ <outputDirectory>./target/</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.xolstice.maven.plugins</groupId>
+ <artifactId>protobuf-maven-plugin</artifactId>
+ <version>0.6.1</version>
+ <configuration>
+ <!--
+ The version of protoc must match protobuf-java. If you don't depend on
+ protobuf-java directly, you will be transitively depending on the
+ protobuf-java version that grpc depends on.
+ -->
+ <protocArtifact>com.google.protobuf:protoc:3.11.4:exe:${os.detected.classifier}
+ </protocArtifact>
+ <pluginId>grpc-java</pluginId>
+ <pluginArtifact>io.grpc:protoc-gen-grpc-java:${test.framework.version}:exe:${os.detected.classifier}
+ </pluginArtifact>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>compile</goal>
+ <goal>compile-custom</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/assembly/assembly.xml b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/assembly/assembly.xml
new file mode 100644
index 0000000000..9ba3b28c36
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/assembly/assembly.xml
@@ -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.
+ ~
+ -->
+<assembly
+ xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+ <formats>
+ <format>zip</format>
+ </formats>
+
+ <fileSets>
+ <fileSet>
+ <directory>./bin</directory>
+ <fileMode>0775</fileMode>
+ </fileSet>
+ </fileSets>
+
+ <files>
+ <file>
+ <source>${project.build.directory}/grpc-1.30.x-1.39.x-scenario.jar</source>
+ <outputDirectory>./libs</outputDirectory>
+ <fileMode>0775</fileMode>
+ </file>
+ </files>
+</assembly>
diff --git a/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/Application.java b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/Application.java
new file mode 100644
index 0000000000..052e0f7e3b
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/Application.java
@@ -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.
+ *
+ */
+
+package org.apache.skywalking.apm.testcase.grpc;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class Application {
+
+ public static void main(String[] args) {
+ try {
+ SpringApplication.run(Application.class, args);
+ } catch (Exception e) {
+ // Never do this
+ }
+ }
+}
diff --git a/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/consumr/ConsumerInterceptor.java b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/consumr/ConsumerInterceptor.java
new file mode 100644
index 0000000000..e8a35d0359
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/consumr/ConsumerInterceptor.java
@@ -0,0 +1,109 @@
+/*
+ * 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.apm.testcase.grpc.consumr;
+
+import io.grpc.CallOptions;
+import io.grpc.Channel;
+import io.grpc.ClientCall;
+import io.grpc.ClientInterceptor;
+import io.grpc.ForwardingClientCall;
+import io.grpc.ForwardingClientCallListener;
+import io.grpc.Metadata;
+import io.grpc.MethodDescriptor;
+import io.grpc.Status;
+import javax.annotation.Nullable;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+public class ConsumerInterceptor implements ClientInterceptor {
+
+ private static final Logger LOGGER = LogManager.getLogger(ConsumerInterceptor.class);
+
+ @Override
+ public <REQ_T, RESP_T> ClientCall<REQ_T, RESP_T> interceptCall(MethodDescriptor<REQ_T, RESP_T> descriptor,
+ CallOptions options, Channel channel) {
+ LOGGER.info("start interceptor!");
+ LOGGER.info("method type: {}", descriptor.getType());
+ return new ForwardingClientCall.SimpleForwardingClientCall<REQ_T, RESP_T>(channel.newCall(descriptor, options)) {
+ @Override
+ public void start(Listener<RESP_T> responseListener, Metadata headers) {
+ LOGGER.info("Peer: {}", channel.authority());
+ LOGGER.info("Operation Name : {}", descriptor.getFullMethodName());
+ Interceptor<RESP_T> tracingResponseListener = new Interceptor(responseListener);
+ tracingResponseListener.contextSnapshot = "contextSnapshot";
+ delegate().start(tracingResponseListener, headers);
+ }
+
+ @Override
+ public void cancel(@Nullable String message, @Nullable Throwable cause) {
+ LOGGER.info("cancel");
+ super.cancel(message, cause);
+ }
+
+ @Override
+ public void halfClose() {
+ LOGGER.info("halfClose");
+ super.halfClose();
+ }
+
+ @Override
+ public void sendMessage(REQ_T message) {
+ LOGGER.info("sendMessage ....");
+ super.sendMessage(message);
+ }
+ };
+ }
+
+ private static class Interceptor<RESP_T> extends ForwardingClientCallListener.SimpleForwardingClientCallListener<RESP_T> {
+ private static final Logger LOGGER = LogManager.getLogger(Interceptor.class);
+
+ private Object contextSnapshot;
+
+ protected Interceptor(ClientCall.Listener<RESP_T> delegate) {
+ super(delegate);
+ }
+
+ @Override
+ public void onHeaders(Metadata headers) {
+ LOGGER.info("on Headers");
+ for (String key : headers.keys()) {
+ LOGGER.info("Receive key: {}", key);
+ }
+ delegate().onHeaders(headers);
+ }
+
+ @Override
+ public void onMessage(RESP_T message) {
+ LOGGER.info("contextSnapshot: {}", contextSnapshot);
+ delegate().onMessage(message);
+ }
+
+ @Override
+ public void onClose(Status status, Metadata trailers) {
+ LOGGER.info("on close");
+ delegate().onClose(status, trailers);
+ }
+
+ @Override
+ public void onReady() {
+ LOGGER.info("on Ready");
+ super.onReady();
+ }
+ }
+}
diff --git a/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/controller/CaseController.java b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/controller/CaseController.java
new file mode 100644
index 0000000000..c97804e90b
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/controller/CaseController.java
@@ -0,0 +1,137 @@
+/*
+ * 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.apm.testcase.grpc.controller;
+
+import io.grpc.ClientInterceptors;
+import io.grpc.ManagedChannel;
+import io.grpc.ManagedChannelBuilder;
+import io.grpc.stub.ClientCallStreamObserver;
+import io.grpc.stub.ClientResponseObserver;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+import javax.annotation.PostConstruct;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.skywalking.apm.testcase.grpc.consumr.ConsumerInterceptor;
+import org.apache.skywalking.apm.testcase.grpc.proto.GreeterBlockingErrorGrpc;
+import org.apache.skywalking.apm.testcase.grpc.proto.GreeterBlockingGrpc;
+import org.apache.skywalking.apm.testcase.grpc.proto.GreeterGrpc;
+import org.apache.skywalking.apm.testcase.grpc.proto.HelloRequest;
+import org.apache.skywalking.apm.testcase.grpc.proto.HelloReply;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/case")
+public class CaseController {
+
+ private static final Logger LOGGER = LogManager.getLogger(CaseController.class);
+
+ private static final String SUCCESS = "Success";
+
+ private final String grpcProviderHost = "127.0.0.1";
+ private final int grpcProviderPort = 18080;
+ private ManagedChannel channel;
+ private GreeterGrpc.GreeterStub greeterStub;
+ private GreeterBlockingGrpc.GreeterBlockingBlockingStub greeterBlockingStub;
+ private GreeterBlockingErrorGrpc.GreeterBlockingErrorBlockingStub greeterBlockingErrorStub;
+
+ @PostConstruct
+ public void up() {
+ channel = ManagedChannelBuilder.forAddress(grpcProviderHost, grpcProviderPort).usePlaintext().build();
+ greeterStub = GreeterGrpc.newStub(ClientInterceptors.intercept(channel, new ConsumerInterceptor()));
+ greeterBlockingStub = GreeterBlockingGrpc.newBlockingStub(ClientInterceptors.intercept(channel, new ConsumerInterceptor()));
+ greeterBlockingErrorStub = GreeterBlockingErrorGrpc.newBlockingStub(ClientInterceptors.intercept(channel, new ConsumerInterceptor()));
+ }
+
+ @RequestMapping("/grpc-1.30.x-1.39.x-scenario")
+ @ResponseBody
+ public String testcase() {
+ greetService();
+ greetBlockingService();
+ greetBlockingErrorService();
+ return SUCCESS;
+ }
+
+ @RequestMapping("/healthCheck")
+ @ResponseBody
+ public String healthCheck() {
+ // your codes
+ return SUCCESS;
+ }
+
+ private static List<String> names() {
+ return Arrays.asList("Sophia", "Jackson");
+ }
+
+ private void greetService() {
+ ClientResponseObserver<HelloRequest, HelloReply> helloReplyStreamObserver = new ClientResponseObserver<HelloRequest, HelloReply>() {
+ private ClientCallStreamObserver<HelloRequest> requestStream;
+
+ @Override
+ public void beforeStart(ClientCallStreamObserver observer) {
+ this.requestStream = observer;
+ this.requestStream.setOnReadyHandler(new Runnable() {
+ Iterator<String> iterator = names().iterator();
+
+ @Override
+ public void run() {
+ while (requestStream.isReady()) {
+ if (iterator.hasNext()) {
+ String name = iterator.next();
+ HelloRequest request = HelloRequest.newBuilder().setName(name).build();
+ requestStream.onNext(request);
+ } else {
+ requestStream.onCompleted();
+ }
+ }
+ }
+ });
+ }
+
+ @Override
+ public void onNext(HelloReply reply) {
+ LOGGER.info("Receive an message from provider. message: {}", reply.getMessage());
+ requestStream.request(1);
+ }
+
+ public void onError(Throwable throwable) {
+ LOGGER.error("Failed to send data", throwable);
+ }
+
+ public void onCompleted() {
+ LOGGER.info("All Done");
+ }
+ };
+
+ greeterStub.sayHello(helloReplyStreamObserver);
+ }
+
+ private void greetBlockingService() {
+ HelloRequest request = HelloRequest.newBuilder().setName("Sophia").build();
+ greeterBlockingStub.sayHello(request);
+ }
+
+ private void greetBlockingErrorService() {
+ HelloRequest request = HelloRequest.newBuilder().setName("Tony").build();
+ greeterBlockingErrorStub.sayHello(request);
+ }
+}
diff --git a/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/provider/ProviderConfiguration.java b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/provider/ProviderConfiguration.java
new file mode 100644
index 0000000000..8541c403b1
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/provider/ProviderConfiguration.java
@@ -0,0 +1,44 @@
+/*
+ * 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.apm.testcase.grpc.provider;
+
+import io.grpc.Server;
+import io.grpc.ServerBuilder;
+import io.grpc.ServerInterceptors;
+import org.apache.skywalking.apm.testcase.grpc.provider.interceptor.ProviderInterceptor;
+import org.apache.skywalking.apm.testcase.grpc.provider.service.GreeterBlockingErrorServiceImpl;
+import org.apache.skywalking.apm.testcase.grpc.provider.service.GreeterBlockingServiceImpl;
+import org.apache.skywalking.apm.testcase.grpc.provider.service.GreeterServiceImpl;
+import org.springframework.beans.factory.annotation.Configurable;
+import org.springframework.context.annotation.Bean;
+import org.springframework.stereotype.Component;
+
+@Configurable
+@Component
+public class ProviderConfiguration {
+
+ @Bean(initMethod = "start", destroyMethod = "shutdown")
+ public Server server() {
+ return ServerBuilder.forPort(18080)
+ .addService(ServerInterceptors.intercept(new GreeterServiceImpl(), new ProviderInterceptor()))
+ .addService(ServerInterceptors.intercept(new GreeterBlockingServiceImpl(), new ProviderInterceptor()))
+ .addService(ServerInterceptors.intercept(new GreeterBlockingErrorServiceImpl(), new ProviderInterceptor()))
+ .build();
+ }
+}
diff --git a/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/provider/interceptor/ProviderInterceptor.java b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/provider/interceptor/ProviderInterceptor.java
new file mode 100644
index 0000000000..26647b41a8
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/provider/interceptor/ProviderInterceptor.java
@@ -0,0 +1,96 @@
+/*
+ * 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.apm.testcase.grpc.provider.interceptor;
+
+import io.grpc.ForwardingServerCall;
+import io.grpc.ForwardingServerCallListener;
+import io.grpc.Metadata;
+import io.grpc.ServerCall;
+import io.grpc.ServerCallHandler;
+import io.grpc.ServerInterceptor;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+public class ProviderInterceptor implements ServerInterceptor {
+ private static final Logger LOGGER = LogManager.getLogger(ProviderInterceptor.class);
+
+ @Override
+ public <REQ_T, RESQ_T> ServerCall.Listener<REQ_T> interceptCall(ServerCall<REQ_T, RESQ_T> call, Metadata metadata,
+ ServerCallHandler<REQ_T, RESQ_T> handler) {
+ Map<String, String> headerMap = new HashMap<String, String>();
+ for (String key : metadata.keys()) {
+ LOGGER.info("Receive key: {}", key);
+ if (!key.endsWith(Metadata.BINARY_HEADER_SUFFIX)) {
+ String value = metadata.get(Metadata.Key.of(key, Metadata.ASCII_STRING_MARSHALLER));
+
+ headerMap.put(key, value);
+ }
+ }
+ LOGGER.info("authority : {}", call.getAuthority());
+ return new ForwardingServerCallListener.SimpleForwardingServerCallListener<REQ_T>(handler.startCall(new ForwardingServerCall.SimpleForwardingServerCall<REQ_T, RESQ_T>(call) {
+ @Override
+ public void sendHeaders(Metadata responseHeaders) {
+ LOGGER.info("sendHeaders....");
+ Metadata.Key<String> headerKey = Metadata.Key.of("test-server", Metadata.ASCII_STRING_MARSHALLER);
+ responseHeaders.put(headerKey, "test-server");
+ delegate().sendHeaders(responseHeaders);
+ }
+
+ @Override
+ public void sendMessage(RESQ_T message) {
+ delegate().sendMessage(message);
+ }
+
+ }, metadata)) {
+ @Override
+ public void onReady() {
+ LOGGER.info("onReady....");
+ delegate().onReady();
+ }
+
+ @Override
+ public void onCancel() {
+ LOGGER.info("onCancel....");
+ delegate().onCancel();
+ }
+
+ @Override
+ public void onComplete() {
+ LOGGER.info("onComplete....");
+ delegate().onComplete();
+ }
+
+ @Override
+ public void onHalfClose() {
+ LOGGER.info("onHalfClose....");
+ delegate().onHalfClose();
+ }
+
+ @Override
+ public void onMessage(REQ_T message) {
+ LOGGER.info("onMessage....");
+ delegate().onMessage(message);
+ }
+ };
+ }
+}
diff --git a/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/provider/service/GreeterBlockingErrorServiceImpl.java b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/provider/service/GreeterBlockingErrorServiceImpl.java
new file mode 100644
index 0000000000..3cd6394a48
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/provider/service/GreeterBlockingErrorServiceImpl.java
@@ -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.apm.testcase.grpc.provider.service;
+
+import io.grpc.stub.StreamObserver;
+import org.apache.skywalking.apm.testcase.grpc.proto.GreeterBlockingErrorGrpc;
+import org.apache.skywalking.apm.testcase.grpc.proto.HelloReply;
+import org.apache.skywalking.apm.testcase.grpc.proto.HelloRequest;
+
+public class GreeterBlockingErrorServiceImpl extends GreeterBlockingErrorGrpc.GreeterBlockingErrorImplBase {
+ @Override
+ public void sayHello(HelloRequest request, StreamObserver<HelloReply> responseObserver) {
+ responseObserver.onError(new Exception());
+ }
+}
diff --git a/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/provider/service/GreeterBlockingServiceImpl.java b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/provider/service/GreeterBlockingServiceImpl.java
new file mode 100644
index 0000000000..2f156bc62f
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/provider/service/GreeterBlockingServiceImpl.java
@@ -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 org.apache.skywalking.apm.testcase.grpc.provider.service;
+
+import io.grpc.stub.StreamObserver;
+import org.apache.skywalking.apm.testcase.grpc.proto.GreeterBlockingGrpc;
+import org.apache.skywalking.apm.testcase.grpc.proto.HelloReply;
+import org.apache.skywalking.apm.testcase.grpc.proto.HelloRequest;
+
+public class GreeterBlockingServiceImpl extends GreeterBlockingGrpc.GreeterBlockingImplBase {
+ @Override
+ public void sayHello(HelloRequest request, StreamObserver<HelloReply> responseObserver) {
+ responseObserver.onNext(HelloReply.newBuilder().setMessage("Hi," + request.getName()).build());
+ responseObserver.onCompleted();
+ }
+}
diff --git a/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/provider/service/GreeterServiceImpl.java b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/provider/service/GreeterServiceImpl.java
new file mode 100644
index 0000000000..5235d09318
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/provider/service/GreeterServiceImpl.java
@@ -0,0 +1,52 @@
+/*
+ * 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.apm.testcase.grpc.provider.service;
+
+import io.grpc.stub.StreamObserver;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.skywalking.apm.testcase.grpc.proto.GreeterGrpc;
+import org.apache.skywalking.apm.testcase.grpc.proto.HelloReply;
+import org.apache.skywalking.apm.testcase.grpc.proto.HelloRequest;
+
+public class GreeterServiceImpl extends GreeterGrpc.GreeterImplBase {
+
+ private static final Logger LOGGER = LogManager.getLogger(GreeterServiceImpl.class);
+
+ @Override
+ public StreamObserver<HelloRequest> sayHello(final StreamObserver<HelloReply> responseObserver) {
+ StreamObserver<HelloRequest> requestStreamObserver = new StreamObserver<HelloRequest>() {
+
+ public void onNext(HelloRequest request) {
+ LOGGER.info("Receive an message from client. Message: {}", request.getName());
+ responseObserver.onNext(HelloReply.newBuilder().setMessage("Hi," + request.getName()).build());
+ }
+
+ public void onError(Throwable throwable) {
+ responseObserver.onError(throwable);
+ }
+
+ public void onCompleted() {
+ LOGGER.info("End the stream.");
+ responseObserver.onCompleted();
+ }
+ };
+ return requestStreamObserver;
+ }
+}
diff --git a/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/proto/GreetService.proto b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/proto/GreetService.proto
new file mode 100644
index 0000000000..fd5ba4a8f1
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/proto/GreetService.proto
@@ -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.
+ *
+ */
+syntax = "proto3";
+
+option java_multiple_files = true;
+option java_package = "org.apache.skywalking.apm.testcase.grpc.proto";
+
+service Greeter {
+ rpc SayHello (stream HelloRequest) returns (stream HelloReply) {
+ }
+}
+
+service GreeterBlocking {
+ rpc SayHello (HelloRequest) returns (HelloReply) {
+ }
+}
+service GreeterBlockingError {
+ rpc SayHello (HelloRequest) returns (HelloReply) {
+ }
+}
+
+message HelloRequest {
+ string name = 1;
+}
+
+message HelloReply {
+ string message = 1;
+}
\ No newline at end of file
diff --git a/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/resources/application.yaml b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/resources/application.yaml
new file mode 100644
index 0000000000..5f9c909a1b
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/resources/application.yaml
@@ -0,0 +1,23 @@
+#
+# 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: 8080
+ servlet:
+ context-path: /grpc-1.30.x-1.39.x-scenario
+logging:
+ config: classpath:log4j2.xml
diff --git a/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/resources/log4j2.xml b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/resources/log4j2.xml
new file mode 100644
index 0000000000..9849ed5a8a
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/src/main/resources/log4j2.xml
@@ -0,0 +1,30 @@
+<?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_ERR">
+ <PatternLayout charset="UTF-8" pattern="[%d{yyyy-MM-dd HH:mm:ss:SSS}] [%p] - %l - %m%n"/>
+ </Console>
+ </Appenders>
+ <Loggers>
+ <Root level="WARN">
+ <AppenderRef ref="Console"/>
+ </Root>
+ </Loggers>
+</Configuration>
\ No newline at end of file
diff --git a/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/support-version.list b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/support-version.list
new file mode 100644
index 0000000000..5c01dfaf60
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.30.x-1.39.x-scenario/support-version.list
@@ -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.
+
+# INTERNAL: HTTP/2 error code: INTERNAL_ERROR Received Goaway occur in test cases 1.0.0 to 1.5.0
+# So these versions were not included in support-version.list. if you know what caused it, please help us.
+
+# Contains only the last version number of each minor version
+
+1.39.0
+1.38.0
+1.37.0
+1.36.0
+1.35.0
+1.34.0
+1.33.0
+1.32.1
+1.31.0
+1.30.0
diff --git a/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/bin/startup.sh b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/bin/startup.sh
new file mode 100644
index 0000000000..54d5003fe6
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/bin/startup.sh
@@ -0,0 +1,21 @@
+#!/bin/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.
+
+home="$(cd "$(dirname $0)"; pwd)"
+
+java -jar ${agent_opts} ${home}/../libs/grpc-1.59.x-1.70.x-scenario.jar &
diff --git a/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/config/expectedData.yaml
new file mode 100644
index 0000000000..2cbf91a2ea
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/config/expectedData.yaml
@@ -0,0 +1,458 @@
+# 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.
+segmentItems:
+ - serviceName: grpc-1.59.x-1.70.x-scenario
+ segmentSize: gt 10
+ segments:
+ - segmentId: not null
+ spans:
+ - operationName: GreeterBlocking.sayHello
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Entry
+ peer: ''
+ refs:
+ - {parentEndpoint: GET:/grpc-1.59.x-1.70.x-scenario/case/grpc-1.59.x-1.70.x-scenario, networkAddress: '127.0.0.1:18080',
+ refType: CrossProcess, parentSpanId: 2, parentTraceSegmentId: not null, parentServiceInstance: not
+ null, parentService: grpc-1.59.x-1.70.x-scenario, traceId: not null}
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: Greeter.sayHello/client/Request/onMessage
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ refs:
+ - {parentEndpoint: GET:/grpc-1.59.x-1.70.x-scenario/case/grpc-1.59.x-1.70.x-scenario, networkAddress: '', refType: CrossThread,
+ parentSpanId: 1, parentTraceSegmentId: not null, parentServiceInstance: not
+ null, parentService: not null, traceId: not null}
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: Greeter.sayHello/client/Request/onMessage
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ refs:
+ - {parentEndpoint: GET:/grpc-1.59.x-1.70.x-scenario/case/grpc-1.59.x-1.70.x-scenario, networkAddress: '', refType: CrossThread,
+ parentSpanId: 1, parentTraceSegmentId: not null, parentServiceInstance: not
+ null, parentService: grpc-1.59.x-1.70.x-scenario, traceId: not null}
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: Greeter.sayHello/client/Request/onComplete
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ refs:
+ - {parentEndpoint: GET:/grpc-1.59.x-1.70.x-scenario/case/grpc-1.59.x-1.70.x-scenario, networkAddress: '', refType: CrossThread,
+ parentSpanId: 1, parentTraceSegmentId: not null, parentServiceInstance: not
+ null, parentService: grpc-1.59.x-1.70.x-scenario, traceId: not null}
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: Greeter.sayHello
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Entry
+ peer: ''
+ refs:
+ - {parentEndpoint: GET:/grpc-1.59.x-1.70.x-scenario/case/grpc-1.59.x-1.70.x-scenario, networkAddress: '127.0.0.1:18080',
+ refType: CrossProcess, parentSpanId: 1, parentTraceSegmentId: not null, parentServiceInstance: not
+ null, parentService: grpc-1.59.x-1.70.x-scenario, traceId: not null}
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: Greeter.sayHello/server/Response/onMessage
+ parentSpanId: 0
+ spanId: 1
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ skipAnalysis: 'false'
+ - operationName: Greeter.sayHello/server/Request/onMessage
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ refs:
+ - {parentEndpoint: Greeter.sayHello, networkAddress: '', refType: CrossThread,
+ parentSpanId: 0, parentTraceSegmentId: not null, parentServiceInstance: not
+ null, parentService: not null, traceId: not null}
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: Greeter.sayHello/client/Response/onMessage
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ refs:
+ - {parentEndpoint: GET:/grpc-1.59.x-1.70.x-scenario/case/grpc-1.59.x-1.70.x-scenario, networkAddress: '', refType: CrossThread,
+ parentSpanId: 1, parentTraceSegmentId: not null, parentServiceInstance: not
+ null, parentService: not null, traceId: not null}
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: GreeterBlocking.sayHello/server/Response/onClose
+ parentSpanId: 0
+ spanId: 1
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ tags:
+ - {key: rpc.status_code, value: OK}
+ skipAnalysis: 'false'
+ - operationName: GreeterBlocking.sayHello/server/Request/onHalfClose
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ refs:
+ - {parentEndpoint: GreeterBlocking.sayHello, networkAddress: '', refType: CrossThread,
+ parentSpanId: 0, parentTraceSegmentId: not null, parentServiceInstance: not
+ null, parentService: grpc-1.59.x-1.70.x-scenario, traceId: not null}
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: Greeter.sayHello/server/Response/onMessage
+ parentSpanId: 0
+ spanId: 1
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ skipAnalysis: 'false'
+ - operationName: Greeter.sayHello/server/Request/onMessage
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ refs:
+ - {parentEndpoint: Greeter.sayHello, networkAddress: '', refType: CrossThread,
+ parentSpanId: 0, parentTraceSegmentId: not null, parentServiceInstance: not
+ null, parentService: grpc-1.59.x-1.70.x-scenario, traceId: not null}
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: Greeter.sayHello/server/Response/onClose
+ parentSpanId: 0
+ spanId: 1
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ tags:
+ - {key: rpc.status_code, value: OK}
+ skipAnalysis: 'false'
+ - operationName: Greeter.sayHello/server/Request/onHalfClose
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ refs:
+ - {parentEndpoint: Greeter.sayHello, networkAddress: '', refType: CrossThread,
+ parentSpanId: 0, parentTraceSegmentId: not null, parentServiceInstance: not
+ null, parentService: grpc-1.59.x-1.70.x-scenario, traceId: not null}
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: Greeter.sayHello/client/Response/onMessage
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ refs:
+ - {parentEndpoint: GET:/grpc-1.59.x-1.70.x-scenario/case/grpc-1.59.x-1.70.x-scenario, networkAddress: '', refType: CrossThread,
+ parentSpanId: 1, parentTraceSegmentId: not null, parentServiceInstance: not
+ null, parentService: grpc-1.59.x-1.70.x-scenario, traceId: not null}
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: Greeter.sayHello/client/Response/onClose
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ refs:
+ - {parentEndpoint: GET:/grpc-1.59.x-1.70.x-scenario/case/grpc-1.59.x-1.70.x-scenario, networkAddress: '', refType: CrossThread,
+ parentSpanId: 1, parentTraceSegmentId: not null, parentServiceInstance: not
+ null, parentService: grpc-1.59.x-1.70.x-scenario, traceId: not null}
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: GreeterBlockingError.sayHello
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Entry
+ peer: ''
+ refs:
+ - {parentEndpoint: GET:/grpc-1.59.x-1.70.x-scenario/case/grpc-1.59.x-1.70.x-scenario, networkAddress: '127.0.0.1:18080',
+ refType: CrossProcess, parentSpanId: 5, parentTraceSegmentId: not null, parentServiceInstance: not
+ null, parentService: grpc-1.59.x-1.70.x-scenario, traceId: not null}
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: GreeterBlockingError.sayHello/server/Response/onClose
+ parentSpanId: 0
+ spanId: 1
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: true
+ spanType: Local
+ peer: ''
+ tags:
+ - {key: rpc.status_code, value: UNKNOWN}
+ logs:
+ - logEvent:
+ - {key: event, value: error}
+ - {key: error.kind, value: java.lang.Exception}
+ - {key: message, value: ''}
+ - {key: stack, value: not null}
+ skipAnalysis: 'false'
+ - operationName: GreeterBlockingError.sayHello/server/Request/onHalfClose
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ refs:
+ - {parentEndpoint: GreeterBlockingError.sayHello, networkAddress: '', refType: CrossThread,
+ parentSpanId: 0, parentTraceSegmentId: not null, parentServiceInstance: not
+ null, parentService: grpc-1.59.x-1.70.x-scenario, traceId: not null}
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: Greeter.sayHello
+ parentSpanId: 0
+ spanId: 1
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Exit
+ peer: '127.0.0.1:18080'
+ skipAnalysis: 'false'
+ - operationName: GreeterBlocking.sayHello/client/Request/onComplete
+ parentSpanId: 2
+ spanId: 3
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ skipAnalysis: 'false'
+ - operationName: GreeterBlocking.sayHello/client/Response/onClose
+ parentSpanId: 2
+ spanId: 4
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ skipAnalysis: 'false'
+ - operationName: GreeterBlocking.sayHello
+ parentSpanId: 0
+ panId: 2
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Exit
+ peer: '127.0.0.1:18080'
+ skipAnalysis: 'false'
+ - operationName: GreeterBlockingError.sayHello/client/Request/onComplete
+ parentSpanId: 5
+ spanId: 6
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: false
+ spanType: Local
+ peer: ''
+ skipAnalysis: 'false'
+ - operationName: GreeterBlockingError.sayHello/client/Response/onClose
+ parentSpanId: 5
+ spanId: 7
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: true
+ spanType: Local
+ peer: ''
+ tags:
+ - {key: rpc.status_code, value: UNKNOWN}
+ logs:
+ - logEvent:
+ - {key: event, value: error}
+ - {key: error.kind, value: io.grpc.StatusRuntimeException}
+ - {key: message, value: UNKNOWN}
+ - {key: stack, value: not null}
+ skipAnalysis: 'false'
+ - operationName: GreeterBlockingError.sayHello/client/Request/onCancel
+ parentSpanId: 5
+ spanId: 8
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: true
+ spanType: Local
+ peer: ''
+ logs:
+ - logEvent:
+ - {key: event, value: error}
+ - {key: error.kind, value: io.grpc.StatusRuntimeException}
+ - {key: message, value: UNKNOWN}
+ - {key: stack, value: not null}
+ skipAnalysis: 'false'
+ - operationName: GreeterBlockingError.sayHello
+ parentSpanId: 0
+ spanId: 5
+ spanLayer: RPCFramework
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 23
+ isError: true
+ spanType: Exit
+ peer: 127.0.0.1:18080
+ logs:
+ - logEvent:
+ - {key: event, value: error}
+ - {key: error.kind, value: io.grpc.StatusRuntimeException}
+ - {key: message, value: UNKNOWN}
+ - {key: stack, value: not null}
+ skipAnalysis: 'false'
+ - operationName: GET:/grpc-1.59.x-1.70.x-scenario/case/grpc-1.59.x-1.70.x-scenario
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 1
+ isError: true
+ spanType: Entry
+ peer: ''
+ tags:
+ - {key: url, value: 'http://localhost:8080/grpc-1.59.x-1.70.x-scenario/case/grpc-1.59.x-1.70.x-scenario'}
+ - {key: http.method, value: GET}
+ - {key: http.status_code, value: '500'}
+ logs:
+ - logEvent:
+ - {key: event, value: error}
+ - {key: error.kind, value: org.springframework.web.util.NestedServletException}
+ - {key: message, value: 'Request processing failed; nested exception is io.grpc.StatusRuntimeException:
+ UNKNOWN'}
+ - {key: stack, value: not null}
+ - logEvent:
+ - {key: forward-url, value: /grpc-1.59.x-1.70.x-scenario/error}
+ skipAnalysis: 'false'
diff --git a/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/configuration.yml b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/configuration.yml
new file mode 100644
index 0000000000..858c323d01
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/configuration.yml
@@ -0,0 +1,22 @@
+# 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.
+
+type: jvm
+entryService: http://localhost:8080/grpc-1.59.x-1.70.x-scenario/case/grpc-1.59.x-1.70.x-scenario
+healthCheck: http://localhost:8080/grpc-1.59.x-1.70.x-scenario/case/healthCheck
+startScript: ./bin/startup.sh
+environment:
+dependencies:
diff --git a/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/pom.xml b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/pom.xml
new file mode 100644
index 0000000000..0794a1cb21
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/pom.xml
@@ -0,0 +1,163 @@
+<?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">
+
+ <groupId>org.apache.skywalking.apm.testcase</groupId>
+ <artifactId>grpc-1.59.x-1.70.x-scenario</artifactId>
+ <version>1.0.0</version>
+ <packaging>jar</packaging>
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <compiler.version>1.8</compiler.version>
+ <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
+ <os-maven-plugin.version>1.6.2</os-maven-plugin.version>
+
+ <test.framework.version>1.59.0</test.framework.version>
+
+ <spring.boot.version>2.1.6.RELEASE</spring.boot.version>
+ </properties>
+
+ <name>skywalking-grpc-1.59.x-1.70.x-scenario</name>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-dependencies</artifactId>
+ <version>${spring.boot.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-web</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-log4j2</artifactId>
+ </dependency>
+
+ <!-- grpc -->
+ <dependency>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-all</artifactId>
+ <version>${test.framework.version}</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>grpc-1.59.x-1.70.x-scenario</finalName>
+ <plugins>
+ <plugin>
+ <groupId>kr.motd.maven</groupId>
+ <artifactId>os-maven-plugin</artifactId>
+ <version>${os-maven-plugin.version}</version>
+ <executions>
+ <execution>
+ <phase>initialize</phase>
+ <goals>
+ <goal>detect</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ <version>${spring.boot.version}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>repackage</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>${maven-compiler-plugin.version}</version>
+ <configuration>
+ <source>${compiler.version}</source>
+ <target>${compiler.version}</target>
+ <encoding>${project.build.sourceEncoding}</encoding>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>assemble</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/assembly/assembly.xml</descriptor>
+ </descriptors>
+ <outputDirectory>./target/</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.xolstice.maven.plugins</groupId>
+ <artifactId>protobuf-maven-plugin</artifactId>
+ <version>0.6.1</version>
+ <configuration>
+ <!--
+ The version of protoc must match protobuf-java. If you don't depend on
+ protobuf-java directly, you will be transitively depending on the
+ protobuf-java version that grpc depends on.
+ -->
+ <protocArtifact>com.google.protobuf:protoc:3.23.4:exe:${os.detected.classifier}
+ </protocArtifact>
+ <pluginId>grpc-java</pluginId>
+ <pluginArtifact>io.grpc:protoc-gen-grpc-java:${test.framework.version}:exe:${os.detected.classifier}
+ </pluginArtifact>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>compile</goal>
+ <goal>compile-custom</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/assembly/assembly.xml b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/assembly/assembly.xml
new file mode 100644
index 0000000000..11d5b1f62c
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/assembly/assembly.xml
@@ -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.
+ ~
+ -->
+<assembly
+ xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+ <formats>
+ <format>zip</format>
+ </formats>
+
+ <fileSets>
+ <fileSet>
+ <directory>./bin</directory>
+ <fileMode>0775</fileMode>
+ </fileSet>
+ </fileSets>
+
+ <files>
+ <file>
+ <source>${project.build.directory}/grpc-1.59.x-1.70.x-scenario.jar</source>
+ <outputDirectory>./libs</outputDirectory>
+ <fileMode>0775</fileMode>
+ </file>
+ </files>
+</assembly>
diff --git a/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/Application.java b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/Application.java
new file mode 100644
index 0000000000..052e0f7e3b
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/Application.java
@@ -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.
+ *
+ */
+
+package org.apache.skywalking.apm.testcase.grpc;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class Application {
+
+ public static void main(String[] args) {
+ try {
+ SpringApplication.run(Application.class, args);
+ } catch (Exception e) {
+ // Never do this
+ }
+ }
+}
diff --git a/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/consumr/ConsumerInterceptor.java b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/consumr/ConsumerInterceptor.java
new file mode 100644
index 0000000000..e8a35d0359
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/consumr/ConsumerInterceptor.java
@@ -0,0 +1,109 @@
+/*
+ * 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.apm.testcase.grpc.consumr;
+
+import io.grpc.CallOptions;
+import io.grpc.Channel;
+import io.grpc.ClientCall;
+import io.grpc.ClientInterceptor;
+import io.grpc.ForwardingClientCall;
+import io.grpc.ForwardingClientCallListener;
+import io.grpc.Metadata;
+import io.grpc.MethodDescriptor;
+import io.grpc.Status;
+import javax.annotation.Nullable;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+public class ConsumerInterceptor implements ClientInterceptor {
+
+ private static final Logger LOGGER = LogManager.getLogger(ConsumerInterceptor.class);
+
+ @Override
+ public <REQ_T, RESP_T> ClientCall<REQ_T, RESP_T> interceptCall(MethodDescriptor<REQ_T, RESP_T> descriptor,
+ CallOptions options, Channel channel) {
+ LOGGER.info("start interceptor!");
+ LOGGER.info("method type: {}", descriptor.getType());
+ return new ForwardingClientCall.SimpleForwardingClientCall<REQ_T, RESP_T>(channel.newCall(descriptor, options)) {
+ @Override
+ public void start(Listener<RESP_T> responseListener, Metadata headers) {
+ LOGGER.info("Peer: {}", channel.authority());
+ LOGGER.info("Operation Name : {}", descriptor.getFullMethodName());
+ Interceptor<RESP_T> tracingResponseListener = new Interceptor(responseListener);
+ tracingResponseListener.contextSnapshot = "contextSnapshot";
+ delegate().start(tracingResponseListener, headers);
+ }
+
+ @Override
+ public void cancel(@Nullable String message, @Nullable Throwable cause) {
+ LOGGER.info("cancel");
+ super.cancel(message, cause);
+ }
+
+ @Override
+ public void halfClose() {
+ LOGGER.info("halfClose");
+ super.halfClose();
+ }
+
+ @Override
+ public void sendMessage(REQ_T message) {
+ LOGGER.info("sendMessage ....");
+ super.sendMessage(message);
+ }
+ };
+ }
+
+ private static class Interceptor<RESP_T> extends ForwardingClientCallListener.SimpleForwardingClientCallListener<RESP_T> {
+ private static final Logger LOGGER = LogManager.getLogger(Interceptor.class);
+
+ private Object contextSnapshot;
+
+ protected Interceptor(ClientCall.Listener<RESP_T> delegate) {
+ super(delegate);
+ }
+
+ @Override
+ public void onHeaders(Metadata headers) {
+ LOGGER.info("on Headers");
+ for (String key : headers.keys()) {
+ LOGGER.info("Receive key: {}", key);
+ }
+ delegate().onHeaders(headers);
+ }
+
+ @Override
+ public void onMessage(RESP_T message) {
+ LOGGER.info("contextSnapshot: {}", contextSnapshot);
+ delegate().onMessage(message);
+ }
+
+ @Override
+ public void onClose(Status status, Metadata trailers) {
+ LOGGER.info("on close");
+ delegate().onClose(status, trailers);
+ }
+
+ @Override
+ public void onReady() {
+ LOGGER.info("on Ready");
+ super.onReady();
+ }
+ }
+}
diff --git a/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/controller/CaseController.java b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/controller/CaseController.java
new file mode 100644
index 0000000000..2a26b99e96
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/controller/CaseController.java
@@ -0,0 +1,137 @@
+/*
+ * 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.apm.testcase.grpc.controller;
+
+import io.grpc.ClientInterceptors;
+import io.grpc.ManagedChannel;
+import io.grpc.ManagedChannelBuilder;
+import io.grpc.stub.ClientCallStreamObserver;
+import io.grpc.stub.ClientResponseObserver;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+import javax.annotation.PostConstruct;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.skywalking.apm.testcase.grpc.consumr.ConsumerInterceptor;
+import org.apache.skywalking.apm.testcase.grpc.proto.GreeterBlockingErrorGrpc;
+import org.apache.skywalking.apm.testcase.grpc.proto.GreeterBlockingGrpc;
+import org.apache.skywalking.apm.testcase.grpc.proto.GreeterGrpc;
+import org.apache.skywalking.apm.testcase.grpc.proto.HelloRequest;
+import org.apache.skywalking.apm.testcase.grpc.proto.HelloReply;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/case")
+public class CaseController {
+
+ private static final Logger LOGGER = LogManager.getLogger(CaseController.class);
+
+ private static final String SUCCESS = "Success";
+
+ private final String grpcProviderHost = "127.0.0.1";
+ private final int grpcProviderPort = 18080;
+ private ManagedChannel channel;
+ private GreeterGrpc.GreeterStub greeterStub;
+ private GreeterBlockingGrpc.GreeterBlockingBlockingStub greeterBlockingStub;
+ private GreeterBlockingErrorGrpc.GreeterBlockingErrorBlockingStub greeterBlockingErrorStub;
+
+ @PostConstruct
+ public void up() {
+ channel = ManagedChannelBuilder.forAddress(grpcProviderHost, grpcProviderPort).usePlaintext().build();
+ greeterStub = GreeterGrpc.newStub(ClientInterceptors.intercept(channel, new ConsumerInterceptor()));
+ greeterBlockingStub = GreeterBlockingGrpc.newBlockingStub(ClientInterceptors.intercept(channel, new ConsumerInterceptor()));
+ greeterBlockingErrorStub = GreeterBlockingErrorGrpc.newBlockingStub(ClientInterceptors.intercept(channel, new ConsumerInterceptor()));
+ }
+
+ @RequestMapping("/grpc-1.59.x-1.70.x-scenario")
+ @ResponseBody
+ public String testcase() {
+ greetService();
+ greetBlockingService();
+ greetBlockingErrorService();
+ return SUCCESS;
+ }
+
+ @RequestMapping("/healthCheck")
+ @ResponseBody
+ public String healthCheck() {
+ // your codes
+ return SUCCESS;
+ }
+
+ private static List<String> names() {
+ return Arrays.asList("Sophia", "Jackson");
+ }
+
+ private void greetService() {
+ ClientResponseObserver<HelloRequest, HelloReply> helloReplyStreamObserver = new ClientResponseObserver<HelloRequest, HelloReply>() {
+ private ClientCallStreamObserver<HelloRequest> requestStream;
+
+ @Override
+ public void beforeStart(ClientCallStreamObserver observer) {
+ this.requestStream = observer;
+ this.requestStream.setOnReadyHandler(new Runnable() {
+ Iterator<String> iterator = names().iterator();
+
+ @Override
+ public void run() {
+ while (requestStream.isReady()) {
+ if (iterator.hasNext()) {
+ String name = iterator.next();
+ HelloRequest request = HelloRequest.newBuilder().setName(name).build();
+ requestStream.onNext(request);
+ } else {
+ requestStream.onCompleted();
+ }
+ }
+ }
+ });
+ }
+
+ @Override
+ public void onNext(HelloReply reply) {
+ LOGGER.info("Receive an message from provider. message: {}", reply.getMessage());
+ requestStream.request(1);
+ }
+
+ public void onError(Throwable throwable) {
+ LOGGER.error("Failed to send data", throwable);
+ }
+
+ public void onCompleted() {
+ LOGGER.info("All Done");
+ }
+ };
+
+ greeterStub.sayHello(helloReplyStreamObserver);
+ }
+
+ private void greetBlockingService() {
+ HelloRequest request = HelloRequest.newBuilder().setName("Sophia").build();
+ greeterBlockingStub.sayHello(request);
+ }
+
+ private void greetBlockingErrorService() {
+ HelloRequest request = HelloRequest.newBuilder().setName("Tony").build();
+ greeterBlockingErrorStub.sayHello(request);
+ }
+}
diff --git a/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/provider/ProviderConfiguration.java b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/provider/ProviderConfiguration.java
new file mode 100644
index 0000000000..8541c403b1
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/provider/ProviderConfiguration.java
@@ -0,0 +1,44 @@
+/*
+ * 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.apm.testcase.grpc.provider;
+
+import io.grpc.Server;
+import io.grpc.ServerBuilder;
+import io.grpc.ServerInterceptors;
+import org.apache.skywalking.apm.testcase.grpc.provider.interceptor.ProviderInterceptor;
+import org.apache.skywalking.apm.testcase.grpc.provider.service.GreeterBlockingErrorServiceImpl;
+import org.apache.skywalking.apm.testcase.grpc.provider.service.GreeterBlockingServiceImpl;
+import org.apache.skywalking.apm.testcase.grpc.provider.service.GreeterServiceImpl;
+import org.springframework.beans.factory.annotation.Configurable;
+import org.springframework.context.annotation.Bean;
+import org.springframework.stereotype.Component;
+
+@Configurable
+@Component
+public class ProviderConfiguration {
+
+ @Bean(initMethod = "start", destroyMethod = "shutdown")
+ public Server server() {
+ return ServerBuilder.forPort(18080)
+ .addService(ServerInterceptors.intercept(new GreeterServiceImpl(), new ProviderInterceptor()))
+ .addService(ServerInterceptors.intercept(new GreeterBlockingServiceImpl(), new ProviderInterceptor()))
+ .addService(ServerInterceptors.intercept(new GreeterBlockingErrorServiceImpl(), new ProviderInterceptor()))
+ .build();
+ }
+}
diff --git a/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/provider/interceptor/ProviderInterceptor.java b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/provider/interceptor/ProviderInterceptor.java
new file mode 100644
index 0000000000..26647b41a8
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/provider/interceptor/ProviderInterceptor.java
@@ -0,0 +1,96 @@
+/*
+ * 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.apm.testcase.grpc.provider.interceptor;
+
+import io.grpc.ForwardingServerCall;
+import io.grpc.ForwardingServerCallListener;
+import io.grpc.Metadata;
+import io.grpc.ServerCall;
+import io.grpc.ServerCallHandler;
+import io.grpc.ServerInterceptor;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+public class ProviderInterceptor implements ServerInterceptor {
+ private static final Logger LOGGER = LogManager.getLogger(ProviderInterceptor.class);
+
+ @Override
+ public <REQ_T, RESQ_T> ServerCall.Listener<REQ_T> interceptCall(ServerCall<REQ_T, RESQ_T> call, Metadata metadata,
+ ServerCallHandler<REQ_T, RESQ_T> handler) {
+ Map<String, String> headerMap = new HashMap<String, String>();
+ for (String key : metadata.keys()) {
+ LOGGER.info("Receive key: {}", key);
+ if (!key.endsWith(Metadata.BINARY_HEADER_SUFFIX)) {
+ String value = metadata.get(Metadata.Key.of(key, Metadata.ASCII_STRING_MARSHALLER));
+
+ headerMap.put(key, value);
+ }
+ }
+ LOGGER.info("authority : {}", call.getAuthority());
+ return new ForwardingServerCallListener.SimpleForwardingServerCallListener<REQ_T>(handler.startCall(new ForwardingServerCall.SimpleForwardingServerCall<REQ_T, RESQ_T>(call) {
+ @Override
+ public void sendHeaders(Metadata responseHeaders) {
+ LOGGER.info("sendHeaders....");
+ Metadata.Key<String> headerKey = Metadata.Key.of("test-server", Metadata.ASCII_STRING_MARSHALLER);
+ responseHeaders.put(headerKey, "test-server");
+ delegate().sendHeaders(responseHeaders);
+ }
+
+ @Override
+ public void sendMessage(RESQ_T message) {
+ delegate().sendMessage(message);
+ }
+
+ }, metadata)) {
+ @Override
+ public void onReady() {
+ LOGGER.info("onReady....");
+ delegate().onReady();
+ }
+
+ @Override
+ public void onCancel() {
+ LOGGER.info("onCancel....");
+ delegate().onCancel();
+ }
+
+ @Override
+ public void onComplete() {
+ LOGGER.info("onComplete....");
+ delegate().onComplete();
+ }
+
+ @Override
+ public void onHalfClose() {
+ LOGGER.info("onHalfClose....");
+ delegate().onHalfClose();
+ }
+
+ @Override
+ public void onMessage(REQ_T message) {
+ LOGGER.info("onMessage....");
+ delegate().onMessage(message);
+ }
+ };
+ }
+}
diff --git a/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/provider/service/GreeterBlockingErrorServiceImpl.java b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/provider/service/GreeterBlockingErrorServiceImpl.java
new file mode 100644
index 0000000000..3cd6394a48
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/provider/service/GreeterBlockingErrorServiceImpl.java
@@ -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.apm.testcase.grpc.provider.service;
+
+import io.grpc.stub.StreamObserver;
+import org.apache.skywalking.apm.testcase.grpc.proto.GreeterBlockingErrorGrpc;
+import org.apache.skywalking.apm.testcase.grpc.proto.HelloReply;
+import org.apache.skywalking.apm.testcase.grpc.proto.HelloRequest;
+
+public class GreeterBlockingErrorServiceImpl extends GreeterBlockingErrorGrpc.GreeterBlockingErrorImplBase {
+ @Override
+ public void sayHello(HelloRequest request, StreamObserver<HelloReply> responseObserver) {
+ responseObserver.onError(new Exception());
+ }
+}
diff --git a/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/provider/service/GreeterBlockingServiceImpl.java b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/provider/service/GreeterBlockingServiceImpl.java
new file mode 100644
index 0000000000..2f156bc62f
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/provider/service/GreeterBlockingServiceImpl.java
@@ -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 org.apache.skywalking.apm.testcase.grpc.provider.service;
+
+import io.grpc.stub.StreamObserver;
+import org.apache.skywalking.apm.testcase.grpc.proto.GreeterBlockingGrpc;
+import org.apache.skywalking.apm.testcase.grpc.proto.HelloReply;
+import org.apache.skywalking.apm.testcase.grpc.proto.HelloRequest;
+
+public class GreeterBlockingServiceImpl extends GreeterBlockingGrpc.GreeterBlockingImplBase {
+ @Override
+ public void sayHello(HelloRequest request, StreamObserver<HelloReply> responseObserver) {
+ responseObserver.onNext(HelloReply.newBuilder().setMessage("Hi," + request.getName()).build());
+ responseObserver.onCompleted();
+ }
+}
diff --git a/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/provider/service/GreeterServiceImpl.java b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/provider/service/GreeterServiceImpl.java
new file mode 100644
index 0000000000..5235d09318
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/grpc/provider/service/GreeterServiceImpl.java
@@ -0,0 +1,52 @@
+/*
+ * 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.apm.testcase.grpc.provider.service;
+
+import io.grpc.stub.StreamObserver;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.skywalking.apm.testcase.grpc.proto.GreeterGrpc;
+import org.apache.skywalking.apm.testcase.grpc.proto.HelloReply;
+import org.apache.skywalking.apm.testcase.grpc.proto.HelloRequest;
+
+public class GreeterServiceImpl extends GreeterGrpc.GreeterImplBase {
+
+ private static final Logger LOGGER = LogManager.getLogger(GreeterServiceImpl.class);
+
+ @Override
+ public StreamObserver<HelloRequest> sayHello(final StreamObserver<HelloReply> responseObserver) {
+ StreamObserver<HelloRequest> requestStreamObserver = new StreamObserver<HelloRequest>() {
+
+ public void onNext(HelloRequest request) {
+ LOGGER.info("Receive an message from client. Message: {}", request.getName());
+ responseObserver.onNext(HelloReply.newBuilder().setMessage("Hi," + request.getName()).build());
+ }
+
+ public void onError(Throwable throwable) {
+ responseObserver.onError(throwable);
+ }
+
+ public void onCompleted() {
+ LOGGER.info("End the stream.");
+ responseObserver.onCompleted();
+ }
+ };
+ return requestStreamObserver;
+ }
+}
diff --git a/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/proto/GreetService.proto b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/proto/GreetService.proto
new file mode 100644
index 0000000000..fd5ba4a8f1
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/proto/GreetService.proto
@@ -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.
+ *
+ */
+syntax = "proto3";
+
+option java_multiple_files = true;
+option java_package = "org.apache.skywalking.apm.testcase.grpc.proto";
+
+service Greeter {
+ rpc SayHello (stream HelloRequest) returns (stream HelloReply) {
+ }
+}
+
+service GreeterBlocking {
+ rpc SayHello (HelloRequest) returns (HelloReply) {
+ }
+}
+service GreeterBlockingError {
+ rpc SayHello (HelloRequest) returns (HelloReply) {
+ }
+}
+
+message HelloRequest {
+ string name = 1;
+}
+
+message HelloReply {
+ string message = 1;
+}
\ No newline at end of file
diff --git a/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/resources/application.yaml b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/resources/application.yaml
new file mode 100644
index 0000000000..37d6d01659
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/resources/application.yaml
@@ -0,0 +1,23 @@
+#
+# 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: 8080
+ servlet:
+ context-path: /grpc-1.59.x-1.70.x-scenario
+logging:
+ config: classpath:log4j2.xml
diff --git a/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/resources/log4j2.xml b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/resources/log4j2.xml
new file mode 100644
index 0000000000..9849ed5a8a
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/src/main/resources/log4j2.xml
@@ -0,0 +1,30 @@
+<?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_ERR">
+ <PatternLayout charset="UTF-8" pattern="[%d{yyyy-MM-dd HH:mm:ss:SSS}] [%p] - %l - %m%n"/>
+ </Console>
+ </Appenders>
+ <Loggers>
+ <Root level="WARN">
+ <AppenderRef ref="Console"/>
+ </Root>
+ </Loggers>
+</Configuration>
\ No newline at end of file
diff --git a/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/support-version.list b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/support-version.list
new file mode 100644
index 0000000000..dd10211b8e
--- /dev/null
+++ b/test/plugin/scenarios/grpc-1.59.x-1.70.x-scenario/support-version.list
@@ -0,0 +1,35 @@
+# 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.
+
+# INTERNAL: HTTP/2 error code: INTERNAL_ERROR Received Goaway occur in test cases 1.0.0 to 1.5.0
+# So these versions were not included in support-version.list. if you know what caused it, please help us.
+
+# Contains only the last version number of each minor version
+
+1.73.0
+1.72.0
+1.71.0
+1.70.0
+1.69.0
+1.68.0
+1.67.1
+1.66.0
+1.65.0
+1.64.0
+1.63.0
+1.62.2
+1.61.0
+1.60.0