Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

damemi
Copy link
Contributor

@damemi damemi commented Sep 25, 2024

Ref #172

@damemi damemi requested a review from a team as a code owner September 25, 2024 14:37
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);
Copy link
Contributor

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?

Comment on lines +86 to +93
{
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",
},
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants