-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It needs to support retrieving status codes in gRPC client versions prior to v1.40. #1225
Comments
@bittercookie thanks for reporting this and for the detailed report, can I just ask what is the behavior you're seeing when this fails? Is the span still present (just without an error/status code) or does the entire probe fail? Thanks |
otel-go-instrumentation can not work
|
You can obtain the test program from flyserver/grpc7:grpc7-v1.39.0-go-1.21-static:
Then, start the test program with /tmp/grpc7-v1.39.0-go-1.21-static and use curl to access it:
|
Thanks for the detailed response and reproducer @bittercookie, I'm working on a fix for this |
Opened #1235 to fix this. @bittercookie unfortunately we decided to take the approach of only supporting Status code reporting for >= 1.40 (the current error format at the time we added this feature) rather than add conditionals for every past version of gRPC. However this should allow you to run it without the fatal error |
In the file
/bpf/google.golang.org/grpc/client/bpf/probe.bpf.c
, theuprobe_ClientConn_Invoke_Returns
method reads the return value from the Error.s.s.Code field as the status code.However, the structure of google.golang.org/grpc/internal/status.Error varies across different versions:
For v1.30.0 - v1.39.1 (link):
For v1.29.0 - v1.29.1 (link):
The structure spb.Status is defined in google.golang.org/genproto/googleapis/rpc/status.Status.
For v1.8.0 - v1.28.1, the returned Error is actually the struct google.golang.org/grpc/status.statusError same as v1.29.0 - v1.29.1 (link):
Therefore, the logic to read the status code should be implemented according to the different structures.
In offset_results.json, add offset definitions for google.golang.org/grpc/internal/status.Error:
google.golang.org/grpc/internal/status.Error.e
google.golang.org/grpc/internal/status.Error.Code
And for google.golang.org/grpc/status.statusError:
google.golang.org/grpc/status.statusError.Code
In the uprobe_ClientConn_Invoke_Returns method, retrieve the corresponding status code by checking for non-null addresses in Error.s, Error.e, and Error.Code.
The text was updated successfully, but these errors were encountered: