-
Notifications
You must be signed in to change notification settings - Fork 89
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
Support google.golang.org/grpc v1.69.0 #1431
base: main
Are you sure you want to change the base?
Conversation
0149c1c
to
0018d16
Compare
1a3e07f
to
6d97cc2
Compare
internal/pkg/instrumentation/bpf/google.golang.org/grpc/server/bpf/probe.bpf.c
Outdated
Show resolved
Hide resolved
internal/pkg/instrumentation/bpf/google.golang.org/grpc/server/probe.go
Outdated
Show resolved
Hide resolved
internal/pkg/instrumentation/bpf/google.golang.org/grpc/server/bpf/probe.bpf.c
Outdated
Show resolved
Hide resolved
internal/pkg/instrumentation/bpf/google.golang.org/grpc/server/bpf/probe.bpf.c
Outdated
Show resolved
Hide resolved
Replace the Optional field with a more expressive FailureMode and the addition of PackageConstrainsts to restrict when the uprobe should be loaded.
The handleStream function supports grpc < 1.40.0. Reuse the serverStream const for all constraints.
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.
@MrAlias Do you think we should do the test we talked about yesterday to make sure the context reading is OK? (creating a child span for the gRPC server span)
This looks great to me
I was tracking that work in #1442. I was unsure if we wanted to add it here as this PR is already quite large. I can add it as a follow up, and even add it in a branch based on this branch to validate this will work. Or, I can just add it to this PR. What is your preference @RonFed? |
Resolve #1421
Resolve #1432
In
google.golang.org/grpc
v1.69.0
thehttp2Server.writeStatus
andServer.handleStream
method signatures changed:http2Server.writeStatus
v1.68.1
: https://github.com/grpc/grpc-go/blob/d6a777f952c77822f0190dff71b1fe8fe250538c/internal/transport/http2_server.go#L1049v1.69.0
: https://github.com/grpc/grpc-go/blob/317271b232677b7869576a49855b01b9f4775d67/internal/transport/http2_server.go#L1045Server.handleStream
v1.68.1
: https://github.com/grpc/grpc-go/blob/d6a777f952c77822f0190dff71b1fe8fe250538c/server.go#L1741v1.69.0
: https://github.com/grpc/grpc-go/blob/317271b232677b7869576a49855b01b9f4775d67/server.go#L1735In both cases, they are now passed
*transport.ServerStream
instead of*transport.Stream
. Thev1.69.0
version oftransport.Stream
hasn't changed, just how it is referenced. Inv1.69.0
the*Stream
is embedded inServerStream
.This PR handles this divergence and support both code paths.
Split uprobes
To reduce complexity of the uprobes by adding another
volatile
flag variable, this splits functionality of the uprobes. A newPackageConstraints
field is added to theprobe.Uprobe
to provide scope of when the probe should be loaded and the behavior when it is not loaded.This "behavior when not loaded" concept overlaps with then already existing
Optional
field of theProbe
. This is replace with a more customizableFailureMode
type that describes the behavior.The common functionality of the uprobes are abstracted to inlined functions.
Event type updates
The event type now reports if the status was set.
Go context parsing
The Go
context.Context
is held within theStream.ctx
field. This is not directly accessible via passed arguments of the instrumented methods; it is only accessable viaServerStream.Stream.ctx
, there is an added level of indirection. This added level of indirection means for the updated code paths our header file functionality is not used.google.golang.org/grpc
v1.68.1
This was manually tested against
google.golang.org/grpc
v1.68.1
by downgrading the version ofgrpc
used in our e2e tests and tested.