dd-trace-java
dd-trace-java copied to clipboard
gRpc service root span resource name overwritten when making JaxRs.request client call
I've been observing some odd behavior in APM where gRpc server requests (operation:grpc.server
) are not showing up under the expected resource name (e.g. foo.package.Service/Method
), and instead appear with the resource name associated with on outgoing client call made while handling the gRpc request (e.g. operation:jax_rs.request
, GET /some/path
).
After running the service/agent locally and debugging the service, it appears that the root span's resource name gets overwritten as part of the JaxRsAnnotationsDecorator.onJaxRsSpan
processing here. It appears to be setting the resource name on the local root span, which seems incorrect.
It does look like the resource name overwrite behavior of HttpResourceDecorator.withRoute
code is configurable via dd.http.server.route-based-naming
, and this code seems to be the only reader of that config. Setting the config value to false
seems to correct the behavior, but as I couldn't find clear documentation on the purpose of the flag, I figured I'd raise the issue here. It's not clear to me that things are functioning as expected, and I'm not sure what the implications of turning that configuration off might be.