-
Notifications
You must be signed in to change notification settings - Fork 45
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
net/http
instrumentation (eBPF probe) is not working
#45
Comments
Thank you for the detailed explanation! void* httpReq_ptr = find_context_in_map(ctx_iface, &context_to_http_events); The method Please let me know if this fix works, I'll be happy to merge a fix. |
Thanks for your reply. Sure, I'll look into that and once I get something working I send a PR. |
@edeNFed Is there any new progress on this issue, I have encountered the same problem. |
Hi @hnhbwlp this fix will be released in the next version (probably next week) |
I tried the approach from the PR #48 and it didn't succeed in my case. How |
This fix in the homonymous repo worked for me: open-telemetry/opentelemetry-go-instrumentation#34 |
Expected Behavior
I deployed the
emojivoto
example in my local Kubernetes cluster. The emojivoto services, which uses gRPC, are reporting traces in Jaeger backend. This indicates to me, at least at first view, that the gRPC instrumentation inopentelemetry-go-instrumentation
is working correctlyBut when I deploy my own demo web server, running with default
net/http
package, I expectopentelemetry-go-instrumentation
to detect the request's path and method and to send a trace to the Otel collector.Actual Behavior
But none of that happens. I do not see any traces in Jaeger.
I can confirm that my demo webserver, called
hello
, is working properly since I am able to communicate with it withcurl
commands. Also, the logs are showing that thehello
server is indeed working.Here is a copy of my own demo server's
Deployment
I can also confirm that the instrumentation sidecar is able to discover my hello server's process because the logs says so:
Further more, every time I send a request to my
hello
server, the the toolopentelemetry-go-instrumentation
is detecting the request and writing a log to the console, but in the logs the request's path and method are empty, as we can see in the logs here:After some digging, I have found that the eBPF probe for
net/http
seems broken. When debugging with the eBPF trace pipe, I can see that in the uprobeuprobe_ServerMux_ServeHTTP_Returns
, the*httpRequest
object, which is fetched from CPU registerrdi
at the end of the function, does not yield any valid*httpRequest
pointer.In other words, when using
bpf_printk()
, I can print the request's method inuprobe_ServerMux_ServeHTTP
and it works.But when adding some code in the return probe (
uprobe_ServerMux_ServeHTTP_Returns
) to test the same thing, the method is an empty string. Same for the request's path.Also, there seems to be an issue with the switch to context's address as eBPF map keys instead of goroutine IDs. In both entry and return probe, the context address is different. This might be because the idiomatic way to modify the context of a request in Go is to create a new context instead. This changes the location of the context in memory, and so its own memory address. It seems that the current implementation does not take that into account.
I would gladly work on that and submit a PR if I can have more details as to why the
net/http
instrumentation is failing. Is it suppose to fail? Is it not fully implemented yet (but it works a few months ago when thegoroutine
instrumentation was in place if I remember correctly)?Let me know and I can lend a hand.
Steps to Reproduce the Problem
net/http
libraryopen telemetry-go-instrumentation
as explained in thedocs/getting-started
guideAdditional Info
Kubernetes version: v1.24.0
Output of
kubectl version
:operation-system/kernel version:
Output of
awk -F '=' '/PRETTY_NAME/ { print $2 }' /etc/os-release
: Ubuntu 22.04 LTSOutput of
uname -r
: 5.15.0-53-genericThe text was updated successfully, but these errors were encountered: