File tree Expand file tree Collapse file tree
instrumentation-api-incubator/src/test/java/io/opentelemetry/instrumentation/api/incubator/semconv/rpc Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,18 +43,26 @@ void collectsMetrics() {
4343
4444 OperationListener listener = RpcClientMetrics .get ().create (meterProvider .get ("test" ));
4545
46- Attributes requestAttributes2 =
46+ Attributes requestAttributes1 =
4747 Attributes .builder ()
48+ .put (RPC_SYSTEM_NAME , emitStableRpcSemconv () ? "grpc" : null )
4849 .put (RPC_SYSTEM , emitOldRpcSemconv () ? "grpc" : null )
4950 .put (RPC_SERVICE , emitOldRpcSemconv () ? "myservice.EchoService" : null )
5051 .put (
5152 RPC_METHOD ,
5253 emitStableRpcSemconv () ? "myservice.EchoService/exampleMethod" : "exampleMethod" )
53- .put (RPC_SYSTEM_NAME , emitStableRpcSemconv () ? "grpc" : null )
54+ .put (RpcSizeAttributesExtractor . RPC_REQUEST_SIZE , 10 )
5455 .build ();
5556
56- Attributes requestAttributes1 =
57- requestAttributes2 .toBuilder ().put (RpcSizeAttributesExtractor .RPC_REQUEST_SIZE , 10 ).build ();
57+ Attributes requestAttributes2 =
58+ Attributes .builder ()
59+ .put (RPC_SYSTEM_NAME , emitStableRpcSemconv () ? "grpc" : null )
60+ .put (RPC_SYSTEM , emitOldRpcSemconv () ? "grpc" : null )
61+ .put (RPC_SERVICE , emitOldRpcSemconv () ? "myservice.EchoService" : null )
62+ .put (
63+ RPC_METHOD ,
64+ emitStableRpcSemconv () ? "myservice.EchoService/exampleMethod" : "exampleMethod" )
65+ .build ();
5866
5967 Attributes responseAttributes1 =
6068 Attributes .builder ()
Original file line number Diff line number Diff line change @@ -44,18 +44,26 @@ void collectsMetrics() {
4444
4545 OperationListener listener = RpcServerMetrics .get ().create (meterProvider .get ("test" ));
4646
47- Attributes requestAttributes2 =
47+ Attributes requestAttributes1 =
4848 Attributes .builder ()
4949 .put (RPC_SYSTEM , emitOldRpcSemconv () ? "grpc" : null )
5050 .put (RPC_SERVICE , emitOldRpcSemconv () ? "myservice.EchoService" : null )
5151 .put (
5252 RPC_METHOD ,
5353 emitStableRpcSemconv () ? "myservice.EchoService/exampleMethod" : "exampleMethod" )
5454 .put (RPC_SYSTEM_NAME , emitStableRpcSemconv () ? "grpc" : null )
55+ .put (RpcSizeAttributesExtractor .RPC_REQUEST_SIZE , 10 )
5556 .build ();
5657
57- Attributes requestAttributes1 =
58- requestAttributes2 .toBuilder ().put (RpcSizeAttributesExtractor .RPC_REQUEST_SIZE , 10 ).build ();
58+ Attributes requestAttributes2 =
59+ Attributes .builder ()
60+ .put (RPC_SYSTEM , emitOldRpcSemconv () ? "grpc" : null )
61+ .put (RPC_SERVICE , emitOldRpcSemconv () ? "myservice.EchoService" : null )
62+ .put (
63+ RPC_METHOD ,
64+ emitStableRpcSemconv () ? "myservice.EchoService/exampleMethod" : "exampleMethod" )
65+ .put (RPC_SYSTEM_NAME , emitStableRpcSemconv () ? "grpc" : null )
66+ .build ();
5967
6068 Attributes responseAttributes1 =
6169 Attributes .builder ()
You can’t perform that action at this time.
0 commit comments