Update gwt rpc span from INTERNAL to SERVER
Now that we are allowing/support nested SERVER spans.
cc
MODIFY
instrumentation/gwt-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/gwt/GwtSingletons.java
instrumentation/gwt-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/gwt/GwtSingletons.java
@@ -8,6 +8,7 @@ package io.opentelemetry.javaagent.instrumentation.gwt;
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<Method, Void> instrumenter() {

MODIFY
instrumentation/gwt-2.0/javaagent/src/test/groovy/GwtTest.groovy
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 {

Update gwt rpc span from INTERNAL to SERVER (#7342)

Now that we are allowing/support nested SERVER spans.

cc @lmolkova