From d3dd81bdf9e009959de186908465a30b5d6cbf96 Mon Sep 17 00:00:00 2001 From: yingziisme Date: Fri, 16 Sep 2022 16:35:07 +0800 Subject: [PATCH 1/9] Update DubboHeadersSetter.java fix dubbo trace passing problem --- .../instrumentation/apachedubbo/v2_7/DubboHeadersSetter.java | 1 + 1 file changed, 1 insertion(+) diff --git a/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboHeadersSetter.java b/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboHeadersSetter.java index d220d877c35d..8dc502c051eb 100644 --- a/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboHeadersSetter.java +++ b/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboHeadersSetter.java @@ -13,5 +13,6 @@ enum DubboHeadersSetter implements TextMapSetter { @Override public void set(DubboRequest request, String key, String value) { request.context().setAttachment(key, value); + request.invocation().setAttachment(key, value); } } From bc1607de8f40c872ad2a252627957ef4d4edf847 Mon Sep 17 00:00:00 2001 From: yingziisme Date: Fri, 16 Sep 2022 16:37:25 +0800 Subject: [PATCH 2/9] Update TracingFilter.java fix NullPointerException with dubbo getMetadata request --- .../instrumentation/apachedubbo/v2_7/TracingFilter.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/TracingFilter.java b/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/TracingFilter.java index af0dffe1c4b5..f2bbb06f5e33 100644 --- a/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/TracingFilter.java +++ b/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/TracingFilter.java @@ -9,6 +9,8 @@ import io.opentelemetry.context.Scope; import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter; import java.util.concurrent.CompletableFuture; +import java.util.logging.Level; +import java.util.logging.Logger; import org.apache.dubbo.rpc.Filter; import org.apache.dubbo.rpc.Invocation; import org.apache.dubbo.rpc.Invoker; @@ -20,7 +22,7 @@ final class TracingFilter implements Filter { private final Instrumenter serverInstrumenter; private final Instrumenter clientInstrumenter; - + TracingFilter( Instrumenter serverInstrumenter, Instrumenter clientInstrumenter) { @@ -35,6 +37,10 @@ public Result invoke(Invoker invoker, Invocation invocation) { } RpcContext rpcContext = RpcContext.getContext(); + if (rpcContext.getUrl() == null) { + return invoker.invoke(invocation); + } + boolean isServer = rpcContext.isProviderSide(); Instrumenter instrumenter = isServer ? serverInstrumenter : clientInstrumenter; From 700e80b7ef99ea25771ee5c1eab610c1e9f77725 Mon Sep 17 00:00:00 2001 From: yingziisme Date: Mon, 19 Sep 2022 17:20:13 +0800 Subject: [PATCH 3/9] Update TracingFilter.java remove unused imports --- .../instrumentation/apachedubbo/v2_7/TracingFilter.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/TracingFilter.java b/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/TracingFilter.java index f2bbb06f5e33..a0b0b1665c25 100644 --- a/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/TracingFilter.java +++ b/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/TracingFilter.java @@ -9,8 +9,6 @@ import io.opentelemetry.context.Scope; import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter; import java.util.concurrent.CompletableFuture; -import java.util.logging.Level; -import java.util.logging.Logger; import org.apache.dubbo.rpc.Filter; import org.apache.dubbo.rpc.Invocation; import org.apache.dubbo.rpc.Invoker; @@ -22,7 +20,7 @@ final class TracingFilter implements Filter { private final Instrumenter serverInstrumenter; private final Instrumenter clientInstrumenter; - + TracingFilter( Instrumenter serverInstrumenter, Instrumenter clientInstrumenter) { From 52751f212cea3e36135e8f131e064be5db390efa Mon Sep 17 00:00:00 2001 From: yingziisme Date: Thu, 22 Sep 2022 00:49:20 +0800 Subject: [PATCH 4/9] add test for dubbo trace chain --- .../v2_7/DubboTraceChainTest.groovy | 11 ++ .../v2_7/DubboTraceChainTest.groovy | 11 ++ .../v2_7/AbstractDubboTraceChainTest.groovy | 181 ++++++++++++++++++ .../apachedubbo/v2_7/api/MiddleService.java | 10 + .../v2_7/impl/MiddleServiceImpl.java | 25 +++ 5 files changed, 238 insertions(+) create mode 100644 instrumentation/apache-dubbo-2.7/javaagent/src/test/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTraceChainTest.groovy create mode 100644 instrumentation/apache-dubbo-2.7/library-autoconfigure/src/test/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTraceChainTest.groovy create mode 100644 instrumentation/apache-dubbo-2.7/testing/src/main/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy create mode 100644 instrumentation/apache-dubbo-2.7/testing/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/api/MiddleService.java create mode 100644 instrumentation/apache-dubbo-2.7/testing/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/impl/MiddleServiceImpl.java diff --git a/instrumentation/apache-dubbo-2.7/javaagent/src/test/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTraceChainTest.groovy b/instrumentation/apache-dubbo-2.7/javaagent/src/test/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTraceChainTest.groovy new file mode 100644 index 000000000000..ee0b1040dec5 --- /dev/null +++ b/instrumentation/apache-dubbo-2.7/javaagent/src/test/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTraceChainTest.groovy @@ -0,0 +1,11 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.instrumentation.apachedubbo.v2_7 + +import io.opentelemetry.instrumentation.test.LibraryTestTrait + +class DubboTraceChainTest extends AbstractDubboTraceChainTest implements LibraryTestTrait { +} diff --git a/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/test/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTraceChainTest.groovy b/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/test/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTraceChainTest.groovy new file mode 100644 index 000000000000..ee0b1040dec5 --- /dev/null +++ b/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/test/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTraceChainTest.groovy @@ -0,0 +1,11 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.instrumentation.apachedubbo.v2_7 + +import io.opentelemetry.instrumentation.test.LibraryTestTrait + +class DubboTraceChainTest extends AbstractDubboTraceChainTest implements LibraryTestTrait { +} diff --git a/instrumentation/apache-dubbo-2.7/testing/src/main/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy b/instrumentation/apache-dubbo-2.7/testing/src/main/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy new file mode 100644 index 000000000000..ec3ffd54ff5b --- /dev/null +++ b/instrumentation/apache-dubbo-2.7/testing/src/main/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy @@ -0,0 +1,181 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.instrumentation.apachedubbo.v2_7 + +import io.opentelemetry.api.trace.SpanKind +import io.opentelemetry.instrumentation.apachedubbo.v2_7.api.HelloService +import io.opentelemetry.instrumentation.apachedubbo.v2_7.api.MiddleService +import io.opentelemetry.instrumentation.apachedubbo.v2_7.impl.HelloServiceImpl +import io.opentelemetry.instrumentation.apachedubbo.v2_7.impl.MiddleServiceImpl +import io.opentelemetry.instrumentation.test.InstrumentationSpecification +import io.opentelemetry.instrumentation.test.utils.PortUtils +import io.opentelemetry.semconv.trace.attributes.SemanticAttributes +import org.apache.dubbo.common.utils.NetUtils +import org.apache.dubbo.config.ApplicationConfig +import org.apache.dubbo.config.ProtocolConfig +import org.apache.dubbo.config.ReferenceConfig +import org.apache.dubbo.config.RegistryConfig +import org.apache.dubbo.config.ServiceConfig +import org.apache.dubbo.config.bootstrap.DubboBootstrap +import org.apache.dubbo.rpc.service.GenericService +import spock.lang.Unroll + +import static io.opentelemetry.api.trace.SpanKind.CLIENT +import static io.opentelemetry.api.trace.SpanKind.SERVER + +@Unroll +abstract class AbstractDubboTraceChainTest extends InstrumentationSpecification { + + def setupSpec() { + NetUtils.LOCAL_ADDRESS = InetAddress.getLoopbackAddress() + } + + ReferenceConfig configureClient(int port) { + ReferenceConfig reference = new ReferenceConfig<>() + reference.setInterface(HelloService) + reference.setGeneric("true") + reference.setUrl("dubbo://localhost:" + port + "/?timeout=30000") + return reference + } + + ReferenceConfig configureMiddleClient(int port) { + ReferenceConfig reference = new ReferenceConfig<>() + reference.setInterface(MiddleService) + reference.setGeneric("true") + reference.setUrl("dubbo://localhost:" + port + "/?timeout=30000") + return reference + } + + ServiceConfig configureServer() { + def registerConfig = new RegistryConfig() + registerConfig.setAddress("N/A") + ServiceConfig service = new ServiceConfig<>() + service.setInterface(HelloService) + service.setRef(new HelloServiceImpl()) + service.setRegistry(registerConfig) + return service + } + + ServiceConfig configureMiddleServer(GenericService genericService) { + def registerConfig = new RegistryConfig() + registerConfig.setAddress("N/A") + ServiceConfig service = new ServiceConfig<>() + service.setInterface(MiddleService) + service.setRef(new MiddleServiceImpl(genericService)) + service.setRegistry(registerConfig) + return service + } + + def "test apache dubbo base #dubbo"() { + setup: + def port = PortUtils.findOpenPort() + def protocolConfig = new ProtocolConfig() + protocolConfig.setPort(port) + + DubboBootstrap bootstrap = DubboBootstrap.newInstance() + bootstrap.application(new ApplicationConfig("dubbo-test-provider")) + .service(configureServer()) + .protocol(protocolConfig) + .start() + + def middlePort = PortUtils.findOpenPort() + def middleProtocolConfig = new ProtocolConfig() + middleProtocolConfig.setPort(middlePort) + + def reference = configureClient(port) + DubboBootstrap middleBootstrap = DubboBootstrap.newInstance() + middleBootstrap.application(new ApplicationConfig("dubbo-demo-middle")) + .reference(reference) + .service(configureMiddleServer(reference.get())) + .protocol(middleProtocolConfig) + .start() + + + def consumerProtocolConfig = new ProtocolConfig() + consumerProtocolConfig.setRegister(false) + + def middleReference = configureMiddleClient(middlePort) + DubboBootstrap consumerBootstrap = DubboBootstrap.newInstance() + consumerBootstrap.application(new ApplicationConfig("dubbo-demo-api-consumer")) + .reference(middleReference) + .protocol(consumerProtocolConfig) + .start() + + when: + GenericService genericService = middleReference.get() + def o = new Object[1] + o[0] = "hello" + def response = runWithSpan("parent") { + genericService.$invoke("hello", [String.getName()] as String[], o) + } + + then: + response == "hello" + assertTraces(1) { + trace(0, 5) { + span(0) { + name "parent" + kind SpanKind.INTERNAL + hasNoParent() + } + span(1) { + name "org.apache.dubbo.rpc.service.GenericService/\$invoke" + kind CLIENT + childOf span(0) + attributes { + "$SemanticAttributes.RPC_SYSTEM" "apache_dubbo" + "$SemanticAttributes.RPC_SERVICE" "org.apache.dubbo.rpc.service.GenericService" + "$SemanticAttributes.RPC_METHOD" "\$invoke" + "$SemanticAttributes.NET_PEER_NAME" "localhost" + "$SemanticAttributes.NET_PEER_PORT" Long + } + } + span(2) { + name "io.opentelemetry.instrumentation.apachedubbo.v2_7.api.MiddleService/hello" + kind SERVER + childOf span(1) + attributes { + "$SemanticAttributes.RPC_SYSTEM" "apache_dubbo" + "$SemanticAttributes.RPC_SERVICE" "io.opentelemetry.instrumentation.apachedubbo.v2_7.api.MiddleService" + "$SemanticAttributes.RPC_METHOD" "hello" + "net.sock.peer.addr" String + "net.sock.peer.port" Long + "net.sock.family" { it == "inet6" || it == null } + } + } + span(3) { + name "org.apache.dubbo.rpc.service.GenericService/\$invoke" + kind CLIENT + childOf span(2) + attributes { + "$SemanticAttributes.RPC_SYSTEM" "apache_dubbo" + "$SemanticAttributes.RPC_SERVICE" "org.apache.dubbo.rpc.service.GenericService" + "$SemanticAttributes.RPC_METHOD" "\$invoke" + "$SemanticAttributes.NET_PEER_NAME" "localhost" + "$SemanticAttributes.NET_PEER_PORT" Long + } + } + span(4) { + name "io.opentelemetry.instrumentation.apachedubbo.v2_7.api.HelloService/hello" + kind SERVER + childOf span(3) + attributes { + "$SemanticAttributes.RPC_SYSTEM" "apache_dubbo" + "$SemanticAttributes.RPC_SERVICE" "io.opentelemetry.instrumentation.apachedubbo.v2_7.api.HelloService" + "$SemanticAttributes.RPC_METHOD" "hello" + "net.sock.peer.addr" String + "net.sock.peer.port" Long + "net.sock.family" { it == "inet6" || it == null } + } + } + } + } + + cleanup: + bootstrap.destroy() + consumerBootstrap.destroy() + } +} diff --git a/instrumentation/apache-dubbo-2.7/testing/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/api/MiddleService.java b/instrumentation/apache-dubbo-2.7/testing/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/api/MiddleService.java new file mode 100644 index 000000000000..e80f1cd00438 --- /dev/null +++ b/instrumentation/apache-dubbo-2.7/testing/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/api/MiddleService.java @@ -0,0 +1,10 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.instrumentation.apachedubbo.v2_7.api; + +public interface MiddleService { + String hello(String hello); +} diff --git a/instrumentation/apache-dubbo-2.7/testing/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/impl/MiddleServiceImpl.java b/instrumentation/apache-dubbo-2.7/testing/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/impl/MiddleServiceImpl.java new file mode 100644 index 000000000000..bdc1b689828d --- /dev/null +++ b/instrumentation/apache-dubbo-2.7/testing/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/impl/MiddleServiceImpl.java @@ -0,0 +1,25 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.instrumentation.apachedubbo.v2_7.impl; + +import io.opentelemetry.instrumentation.apachedubbo.v2_7.api.MiddleService; +import org.apache.dubbo.rpc.service.GenericService; + +public class MiddleServiceImpl implements MiddleService { + + private final GenericService genericService; + + public MiddleServiceImpl(GenericService genericService) { + this.genericService = genericService; + } + + @Override + public String hello(String hello) { + return genericService + .$invoke("hello", new String[] {String.class.getName()}, new Object[] {hello}) + .toString(); + } +} From 26e8ae8a48c24c7360e5cb0eb06034b1256e2acc Mon Sep 17 00:00:00 2001 From: yingziisme Date: Thu, 22 Sep 2022 01:49:17 +0800 Subject: [PATCH 5/9] fix test bug --- .../apachedubbo/v2_7/DubboTraceChainTest.groovy | 4 ++-- .../apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/instrumentation/apache-dubbo-2.7/javaagent/src/test/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTraceChainTest.groovy b/instrumentation/apache-dubbo-2.7/javaagent/src/test/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTraceChainTest.groovy index ee0b1040dec5..432be0305633 100644 --- a/instrumentation/apache-dubbo-2.7/javaagent/src/test/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTraceChainTest.groovy +++ b/instrumentation/apache-dubbo-2.7/javaagent/src/test/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTraceChainTest.groovy @@ -5,7 +5,7 @@ package io.opentelemetry.instrumentation.apachedubbo.v2_7 -import io.opentelemetry.instrumentation.test.LibraryTestTrait +import io.opentelemetry.instrumentation.test.AgentTestTrait -class DubboTraceChainTest extends AbstractDubboTraceChainTest implements LibraryTestTrait { +class DubboTraceChainTest extends AbstractDubboTraceChainTest implements AgentTestTrait { } diff --git a/instrumentation/apache-dubbo-2.7/testing/src/main/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy b/instrumentation/apache-dubbo-2.7/testing/src/main/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy index ec3ffd54ff5b..3bde37762686 100644 --- a/instrumentation/apache-dubbo-2.7/testing/src/main/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy +++ b/instrumentation/apache-dubbo-2.7/testing/src/main/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy @@ -176,6 +176,7 @@ abstract class AbstractDubboTraceChainTest extends InstrumentationSpecification cleanup: bootstrap.destroy() + middleBootstrap.destroy() consumerBootstrap.destroy() } } From 3884f39af17bdc3e36be282d31a02d86fc81f03e Mon Sep 17 00:00:00 2001 From: yingziisme Date: Fri, 23 Sep 2022 11:54:17 +0800 Subject: [PATCH 6/9] Update instrumentation/apache-dubbo-2.7/testing/src/main/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy Co-authored-by: Mateusz Rzeszutek --- .../apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/instrumentation/apache-dubbo-2.7/testing/src/main/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy b/instrumentation/apache-dubbo-2.7/testing/src/main/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy index 3bde37762686..6f7fcd333d46 100644 --- a/instrumentation/apache-dubbo-2.7/testing/src/main/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy +++ b/instrumentation/apache-dubbo-2.7/testing/src/main/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy @@ -106,10 +106,8 @@ abstract class AbstractDubboTraceChainTest extends InstrumentationSpecification when: GenericService genericService = middleReference.get() - def o = new Object[1] - o[0] = "hello" def response = runWithSpan("parent") { - genericService.$invoke("hello", [String.getName()] as String[], o) + genericService.$invoke("hello", [String.getName()] as String[], ["hello"] as Object[]) } then: From 37a29bbeb66e27f3cb84e3d81a9150d075e4898c Mon Sep 17 00:00:00 2001 From: yingziisme Date: Fri, 23 Sep 2022 11:54:22 +0800 Subject: [PATCH 7/9] Update instrumentation/apache-dubbo-2.7/testing/src/main/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy Co-authored-by: Mateusz Rzeszutek --- .../apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/instrumentation/apache-dubbo-2.7/testing/src/main/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy b/instrumentation/apache-dubbo-2.7/testing/src/main/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy index 6f7fcd333d46..c9114e96b4ae 100644 --- a/instrumentation/apache-dubbo-2.7/testing/src/main/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy +++ b/instrumentation/apache-dubbo-2.7/testing/src/main/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy @@ -71,7 +71,8 @@ abstract class AbstractDubboTraceChainTest extends InstrumentationSpecification def "test apache dubbo base #dubbo"() { setup: - def port = PortUtils.findOpenPort() + def port = PortUtils.findOpenPorts(2) + def middlePort = port + 1 def protocolConfig = new ProtocolConfig() protocolConfig.setPort(port) From 13bc41123df72256138f4c0c7be1d01ec52cabda Mon Sep 17 00:00:00 2001 From: yingziisme Date: Fri, 23 Sep 2022 11:54:33 +0800 Subject: [PATCH 8/9] Update instrumentation/apache-dubbo-2.7/testing/src/main/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy Co-authored-by: Mateusz Rzeszutek --- .../apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/apache-dubbo-2.7/testing/src/main/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy b/instrumentation/apache-dubbo-2.7/testing/src/main/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy index c9114e96b4ae..9516107b7f0c 100644 --- a/instrumentation/apache-dubbo-2.7/testing/src/main/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy +++ b/instrumentation/apache-dubbo-2.7/testing/src/main/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy @@ -69,7 +69,7 @@ abstract class AbstractDubboTraceChainTest extends InstrumentationSpecification return service } - def "test apache dubbo base #dubbo"() { + def "test that context is propagated correctly in chained dubbo calls"() { setup: def port = PortUtils.findOpenPorts(2) def middlePort = port + 1 From 48d3eb9845637db45093514fc8ad01758e64ad61 Mon Sep 17 00:00:00 2001 From: yingziisme Date: Fri, 23 Sep 2022 15:06:18 +0800 Subject: [PATCH 9/9] Update AbstractDubboTraceChainTest.groovy fix dubbo test bug --- .../apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy | 1 - 1 file changed, 1 deletion(-) diff --git a/instrumentation/apache-dubbo-2.7/testing/src/main/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy b/instrumentation/apache-dubbo-2.7/testing/src/main/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy index 9516107b7f0c..708b6c1fd39c 100644 --- a/instrumentation/apache-dubbo-2.7/testing/src/main/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy +++ b/instrumentation/apache-dubbo-2.7/testing/src/main/groovy/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTraceChainTest.groovy @@ -82,7 +82,6 @@ abstract class AbstractDubboTraceChainTest extends InstrumentationSpecification .protocol(protocolConfig) .start() - def middlePort = PortUtils.findOpenPort() def middleProtocolConfig = new ProtocolConfig() middleProtocolConfig.setPort(middlePort)