hypertrace/javaagent

GRPC Instrumentation not adding rpc.body to spans

shashank11p opened this issue · 2 comments

The GRPC instrumentation is not able to add rpc.request.body and rpc.response.body attributes to spans as the protobuf classes are shaded in the javaagent so the instrumentation looks for shaded classes, while during runtime the actual classes are used.

So we should not shade the protobuf dependencies in javaagent. But javaagent also needs to have protobuf dependency for config. So we need to have the protobuf in javaagent to be in agentClassLoader, and do not shade it so that GRPC instrumentation works.

We should also include gRPC in our smoke tests and test the payload capture.

The best way to resolve this is to:

  1. remove shading of config dependencies (protobuf, fasterxml...)
  2. put the config dependencies into agent classloader
  3. create config interface that will be backed by the implementation in the agent classloader.
  4. load the config in the component installer