Skip to content

Commit 2ede454

Browse files
committed
rename
1 parent 6066182 commit 2ede454

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/rpc/RpcAttributesGetter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ default String getRpcMethod(REQUEST request) {
5555
}
5656

5757
/**
58-
* Returns whether the RPC method is a well-known method.
58+
* Returns whether the RPC method is a predefined method at the start of the RPC framework.
5959
*
6060
* <p>This is used to determine whether to set the {@code rpc.method} attribute to the actual
6161
* method name, or to set it to {@code "_OTHER"} and store the actual method name in {@code
6262
* rpc.method_original}.
6363
*/
64-
default boolean isWellKnownMethod(REQUEST request) {
64+
default boolean isPredefined(REQUEST request) {
6565
return false;
6666
}
6767
}

instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/rpc/RpcCommonAttributesExtractor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public final void onStart(AttributesBuilder attributes, Context parentContext, R
4949
RPC_SYSTEM_NAME,
5050
system == null ? null : SemconvStability.stableRpcSystemName(system));
5151
String method = getter.getRpcMethod(request);
52-
if (getter.isWellKnownMethod(request)) {
52+
if (getter.isPredefined(request)) {
5353
internalSet(attributes, RPC_METHOD, method);
5454
} else {
5555
internalSet(attributes, RPC_METHOD_ORIGINAL, method);

instrumentation-api-incubator/src/test/java/io/opentelemetry/instrumentation/api/incubator/semconv/rpc/RpcAttributesExtractorTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ class RpcAttributesExtractorTest {
2626

2727
private static class TestGetter implements RpcAttributesGetter<Map<String, String>> {
2828

29-
private final boolean wellKnownMethod;
29+
private final boolean predefined;
3030

31-
private TestGetter(boolean wellKnownMethod) {
32-
this.wellKnownMethod = wellKnownMethod;
31+
private TestGetter(boolean predefined) {
32+
this.predefined = predefined;
3333
}
3434

3535
@Override
@@ -60,8 +60,8 @@ public String getRpcMethod(Map<String, String> request) {
6060
}
6161

6262
@Override
63-
public boolean isWellKnownMethod(Map<String, String> stringStringMap) {
64-
return wellKnownMethod;
63+
public boolean isPredefined(Map<String, String> stringStringMap) {
64+
return predefined;
6565
}
6666
}
6767

@@ -71,7 +71,7 @@ void server() {
7171
}
7272

7373
@Test
74-
void serverWellKnown() {
74+
void serverPredefined() {
7575
testExtractor(RpcServerAttributesExtractor.create(new TestGetter(true)), null);
7676
}
7777

@@ -81,7 +81,7 @@ void client() {
8181
}
8282

8383
@Test
84-
void clientWellKnown() {
84+
void clientPredefined() {
8585
testExtractor(RpcClientAttributesExtractor.create(new TestGetter(true)), null);
8686
}
8787

0 commit comments

Comments
 (0)