-
Notifications
You must be signed in to change notification settings - Fork 77
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
Instrument gRPC server span status codes #1127
base: main
Are you sure you want to change the base?
Conversation
c273d22
to
637da87
Compare
637da87
to
0863a1e
Compare
internal/pkg/instrumentation/bpf/google.golang.org/grpc/server/bpf/probe.bpf.c
Outdated
Show resolved
Hide resolved
…/bpf/probe.bpf.c Co-authored-by: Tyler Yahn <[email protected]>
void *stream_ptr = get_argument(ctx, 2); | ||
u32 stream_id = 0; | ||
bpf_probe_read(&stream_id, sizeof(stream_id), (void *)(stream_ptr + stream_id_pos)); | ||
struct grpc_request_t *grpcReq = bpf_map_lookup_elem(&streamid_to_grpc_events, &stream_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be better to look here at the grpc_events
map.
If I understand this correctly, this probe should be called between the entry probe of handleStream
(where an entry is created for the stream in the grpc_events
map) and the return probe of handleStream
.
If we can't find an entry it means the entry probe didn't run properly or didn't run at all, hence in that case we won't have a valid start time. WDYT?
{ | ||
Sym: "google.golang.org/grpc/internal/transport.(*serverHandlerTransport).WriteStatus", | ||
EntryProbe: "uprobe_serverHandlerTransport_WriteStatus", | ||
}, | ||
{ | ||
Sym: "google.golang.org/grpc/internal/transport.(*http2Server).WriteStatus", | ||
EntryProbe: "uprobe_http2Server_WriteStatus", | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we instrumenting both of them because either of them might be used?
Ref #172