pixie-io / pixie

Instant Kubernetes-Native Application Observability

Home Page:https://px.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gRPC tracing for newer versions of grpc

ysfess22 opened this issue · comments

Is your feature request related to a problem? Please describe.
Hi, I'm trying to use the grpc tracer, where uprobes are hooked to specific functions in order to intercept sent and received grpc payloads. One thing I noticed is that the offset when reading a pointer from the tracee's memory is related to the used grpc version. The supported grpc_c versions are hardcoded. I'm wondering if there are any plans to support newer grpc versions or if there is an automated way to figure the offset for a given grpc version. Using something like "offsetof" from "stddef.h" can provide some values but I noticed it's not really accurate.

Describe the solution you'd like
Either support for newer grpc versions (e.g., v1.5*.*) or a reliable and automated approach to calculate the offset.

Describe alternatives you've considered
Basically, I tried instrumenting the grpc code to figure the offset for the field "send_initial_metadata" in the "grpc_chttp2_stream" class but the values I get are different that the values in the grpc_tracer. I'm not sure my approach is the most reliable to do this, so I'm wondering how the grpc_tracer authors proceeded to calculate field offsets, especially that factors such as compiler padding might have an impact.

Thank you!