hypertrace / javaagent

Hypertrace OpenTelemetry Java agent with payload/body and headers data capture.
Apache License 2.0
30 stars 15 forks source link

GRPC Instrumentation not adding rpc.body to spans #313

Closed shashank11p closed 3 years ago

shashank11p commented 3 years ago

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.

pavolloffay commented 3 years ago

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

pavolloffay commented 3 years ago

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