Skip to content

Commit

Permalink
Update gwt rpc span from INTERNAL to SERVER (#7342)
Browse files Browse the repository at this point in the history
Now that we are allowing/support nested SERVER spans.

cc @lmolkova
  • Loading branch information
trask authored Nov 30, 2022
1 parent 91d9f1d commit bbcd3d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 {
Expand Down

0 comments on commit bbcd3d1

Please sign in to comment.