Skip to content

Commit d486636

Browse files
committed
fix
1 parent e9d2b05 commit d486636

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ private static Attributes buildRequestAttributes(
302302
if (SemconvStability.emitOldRpcSemconv()) {
303303
builder.put(RPC_SYSTEM, system);
304304
builder.put(RPC_SERVICE, service);
305-
builder.put(RPC_METHOD, method);
305+
builder.put(SemconvStability.getOldRpcMethodAttributeKey(), method);
306306
}
307307

308308
// stable semconv wins for rpc.method

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ private static Attributes buildRequestAttributes(
307307
if (SemconvStability.emitOldRpcSemconv()) {
308308
builder.put(RPC_SYSTEM, system);
309309
builder.put(RPC_SERVICE, service);
310-
builder.put(RPC_METHOD, method);
310+
builder.put(SemconvStability.getOldRpcMethodAttributeKey(), method);
311311
}
312312

313313
// stable semconv wins for rpc.method

instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/internal/SemconvStability.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,6 @@ public static boolean emitStableRpcSemconv() {
140140
return emitStableRpcSemconv;
141141
}
142142

143-
private static boolean emitBothRpcSemconv() {
144-
return emitOldRpcSemconv && emitStableRpcSemconv;
145-
}
146-
147143
private static final Map<String, String> rpcSystemNameMap = new HashMap<>();
148144

149145
static {
@@ -157,7 +153,7 @@ public static String stableRpcSystemName(String oldRpcSystem) {
157153
}
158154

159155
public static AttributeKey<String> getOldRpcMethodAttributeKey() {
160-
if (emitBothRpcSemconv()) {
156+
if (emitStableRpcSemconv()) {
161157
// to avoid clash when both semconv are emitted
162158
return RPC_METHOD_OLD;
163159
}

0 commit comments

Comments
 (0)