-
Notifications
You must be signed in to change notification settings - Fork 97
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
Switch to using per header field parsing for Go versions >= 1.24 #1636
Merged
+134
−12
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grcevski
commented
Jan 16, 2025
RonFed
reviewed
Jan 18, 2025
internal/pkg/instrumentation/bpf/net/http/server/bpf/probe.bpf.c
Outdated
Show resolved
Hide resolved
grcevski
changed the title
Switch to using per header field parsing
Switch to using per header field parsing for Go versions >= 1.24
Jan 26, 2025
@RonFed @MrAlias, do you know why I get this error in my k8s grpc test run?
|
RonFed
approved these changes
Jan 29, 2025
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.
Looks awesome, thanks!
MrAlias
reviewed
Jan 29, 2025
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.
Overall looks good, just comment and doc cleanup. 👍
MrAlias
approved these changes
Jan 30, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is changing how we parse handle the Go HTTP request headers to switch from parsing the Go map to using per header uprobe.
The existing tests should be sufficient to prove this initial version works, since we are already testing for context propagation.
In this first version of the PR I've simply switched how the parsing is done to use the new approach. This approach works regardless of the Go version used, e.g. it will work for Go < 1.24 and Go >= 1.24.
I'm looking for feedback on if we should add a load time constant for the BPF program for the Go version. If we test for the Go version in the BPF code we can choose to use the old approach and not mount the new probe.
There are few pros and cons to each approach:
Proposal 1: We don't read any Go maps until we have swiss maps support
Pros:
Cons:
Proposal 2: We use the Go version to turn this on and off
Pros:
Cons:
Consensus:
We chose Proposal 2, where we check for Go version 1.24 to apply the new parsing based approach. I tested manually by modifying the min version in the file to say 1.23.0 and watched the kernel pipe for a specific message to appear that we are using the new approach. The debug message was removed from the final code.
We discussed in the Go Auto SIG the testing story, it seemed acceptable to wait for 1.24 to build the tests and if something doesn't work we'll address it then. I'm going to try to make a test with the pre-release 1.24 and follow up with another PR.
Relates to #1318