2727import io .opentelemetry .instrumentation .apachedubbo .v2_7 .api .MiddleService ;
2828import io .opentelemetry .instrumentation .apachedubbo .v2_7 .impl .HelloServiceImpl ;
2929import io .opentelemetry .instrumentation .apachedubbo .v2_7 .impl .MiddleServiceImpl ;
30+ import io .opentelemetry .instrumentation .api .internal .SemconvStability ;
3031import io .opentelemetry .instrumentation .test .utils .PortUtils ;
3132import io .opentelemetry .instrumentation .testing .internal .AutoCleanupExtension ;
3233import io .opentelemetry .instrumentation .testing .junit .InstrumentationExtension ;
@@ -313,10 +314,12 @@ void testDubboChain() throws ReflectiveOperationException {
313314 attrs .add (
314315 satisfies (
315316 SERVER_PORT , k -> k .isInstanceOf (Long .class )));
316- attrs .add (
317- satisfies (
318- NETWORK_TYPE ,
319- AbstractDubboTest ::assertNetworkType ));
317+ if (SemconvStability .emitOldRpcSemconv ()) {
318+ attrs .add (
319+ satisfies (
320+ NETWORK_TYPE ,
321+ AbstractDubboTest ::assertNetworkType ));
322+ }
320323 point .hasAttributesSatisfyingExactly (attrs );
321324 },
322325 point -> {
@@ -330,10 +333,12 @@ void testDubboChain() throws ReflectiveOperationException {
330333 attrs .add (
331334 satisfies (
332335 SERVER_PORT , k -> k .isInstanceOf (Long .class )));
333- attrs .add (
334- satisfies (
335- NETWORK_TYPE ,
336- AbstractDubboTest ::assertNetworkType ));
336+ if (SemconvStability .emitOldRpcSemconv ()) {
337+ attrs .add (
338+ satisfies (
339+ NETWORK_TYPE ,
340+ AbstractDubboTest ::assertNetworkType ));
341+ }
337342 point .hasAttributesSatisfyingExactly (attrs );
338343 }))));
339344 }
@@ -472,10 +477,12 @@ void testDubboChainInJvm() throws ReflectiveOperationException {
472477 attrs .add (
473478 satisfies (
474479 SERVER_PORT , k -> k .isInstanceOf (Long .class )));
475- attrs .add (
476- satisfies (
477- NETWORK_TYPE ,
478- AbstractDubboTest ::assertNetworkType ));
480+ if (SemconvStability .emitOldRpcSemconv ()) {
481+ attrs .add (
482+ satisfies (
483+ NETWORK_TYPE ,
484+ AbstractDubboTest ::assertNetworkType ));
485+ }
479486 point .hasAttributesSatisfyingExactly (attrs );
480487 }))));
481488 }
0 commit comments