Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ee68060

Browse files
committedJan 8, 2025·
server span name follow convention
1 parent a5e1a43 commit ee68060

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎instrumentation/jsonrpc4j-1.6/library/src/main/java/io/opentelemetry/instrumentation/jsonrpc4j/v1_6/JsonRpcServerSpanNameExtractor.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@
66
package io.opentelemetry.instrumentation.jsonrpc4j.v1_6;
77

88
import io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor;
9+
import java.lang.reflect.Method;
910

1011
public class JsonRpcServerSpanNameExtractor implements SpanNameExtractor<JsonRpcRequest> {
12+
// Follow https://opentelemetry.io/docs/specs/semconv/rpc/rpc-spans/#span-name
1113
@Override
1214
public String extract(JsonRpcRequest request) {
13-
return request.getMethod().getName();
15+
Method method = request.getMethod();
16+
return String.format("%s/%s", method.getDeclaringClass().getName(), method.getName());
1417
}
1518
}

0 commit comments

Comments
 (0)
Please sign in to comment.