Skip to content

Commit bbcd3d1

Browse files
authored
Update gwt rpc span from INTERNAL to SERVER (#7342)
Now that we are allowing/support nested SERVER spans. cc @lmolkova
1 parent 91d9f1d commit bbcd3d1

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

instrumentation/gwt-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/gwt/GwtSingletons.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import io.opentelemetry.api.GlobalOpenTelemetry;
99
import io.opentelemetry.context.ContextKey;
1010
import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
11+
import io.opentelemetry.instrumentation.api.instrumenter.SpanKindExtractor;
1112
import io.opentelemetry.instrumentation.api.instrumenter.rpc.RpcServerAttributesExtractor;
1213
import io.opentelemetry.instrumentation.api.instrumenter.rpc.RpcSpanNameExtractor;
1314
import java.lang.reflect.Method;
@@ -29,9 +30,7 @@ public final class GwtSingletons {
2930
INSTRUMENTATION_NAME,
3031
RpcSpanNameExtractor.create(rpcAttributesGetter))
3132
.addAttributesExtractor(RpcServerAttributesExtractor.create(rpcAttributesGetter))
32-
// TODO(anuraaga): This should be a server span, but we currently have no way to merge
33-
// with the HTTP instrumentation's server span.
34-
.buildInstrumenter();
33+
.buildInstrumenter(SpanKindExtractor.alwaysServer());
3534
}
3635

3736
public static Instrumenter<Method, Void> instrumenter() {

instrumentation/gwt-2.0/javaagent/src/test/groovy/GwtTest.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class GwtTest extends AgentInstrumentationSpecification implements HttpServerTes
123123
serverSpan(it, 0, getContextPath() + "/greeting/greet")
124124
span(1) {
125125
name "test.gwt.shared.MessageService/sendMessage"
126-
kind SpanKind.INTERNAL
126+
kind SpanKind.SERVER
127127
childOf(span(0))
128128
attributes {
129129
"$SemanticAttributes.RPC_SYSTEM" "gwt"
@@ -147,7 +147,7 @@ class GwtTest extends AgentInstrumentationSpecification implements HttpServerTes
147147
serverSpan(it, 0, getContextPath() + "/greeting/greet")
148148
span(1) {
149149
name "test.gwt.shared.MessageService/sendMessage"
150-
kind SpanKind.INTERNAL
150+
kind SpanKind.SERVER
151151
childOf(span(0))
152152
errorEvent(IOException)
153153
attributes {

0 commit comments

Comments
 (0)