diff --git a/instrumentation/gwt-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/gwt/GwtSingletons.java b/instrumentation/gwt-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/gwt/GwtSingletons.java index 5bfeb789917d..b13de9f52ce0 100644 --- a/instrumentation/gwt-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/gwt/GwtSingletons.java +++ b/instrumentation/gwt-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/gwt/GwtSingletons.java @@ -8,6 +8,7 @@ import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.context.ContextKey; import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter; +import io.opentelemetry.instrumentation.api.instrumenter.SpanKindExtractor; import io.opentelemetry.instrumentation.api.instrumenter.rpc.RpcServerAttributesExtractor; import io.opentelemetry.instrumentation.api.instrumenter.rpc.RpcSpanNameExtractor; import java.lang.reflect.Method; @@ -29,9 +30,7 @@ public final class GwtSingletons { INSTRUMENTATION_NAME, RpcSpanNameExtractor.create(rpcAttributesGetter)) .addAttributesExtractor(RpcServerAttributesExtractor.create(rpcAttributesGetter)) - // TODO(anuraaga): This should be a server span, but we currently have no way to merge - // with the HTTP instrumentation's server span. - .buildInstrumenter(); + .buildInstrumenter(SpanKindExtractor.alwaysServer()); } public static Instrumenter instrumenter() { diff --git a/instrumentation/gwt-2.0/javaagent/src/test/groovy/GwtTest.groovy b/instrumentation/gwt-2.0/javaagent/src/test/groovy/GwtTest.groovy index 62a6ccc1e9f0..7754172e5aa3 100644 --- a/instrumentation/gwt-2.0/javaagent/src/test/groovy/GwtTest.groovy +++ b/instrumentation/gwt-2.0/javaagent/src/test/groovy/GwtTest.groovy @@ -123,7 +123,7 @@ class GwtTest extends AgentInstrumentationSpecification implements HttpServerTes serverSpan(it, 0, getContextPath() + "/greeting/greet") span(1) { name "test.gwt.shared.MessageService/sendMessage" - kind SpanKind.INTERNAL + kind SpanKind.SERVER childOf(span(0)) attributes { "$SemanticAttributes.RPC_SYSTEM" "gwt" @@ -147,7 +147,7 @@ class GwtTest extends AgentInstrumentationSpecification implements HttpServerTes serverSpan(it, 0, getContextPath() + "/greeting/greet") span(1) { name "test.gwt.shared.MessageService/sendMessage" - kind SpanKind.INTERNAL + kind SpanKind.SERVER childOf(span(0)) errorEvent(IOException) attributes {