opentelemetry-go-instrumentation icon indicating copy to clipboard operation
opentelemetry-go-instrumentation copied to clipboard

Question regarding changing the handler method in net/http

Open ananthcodekarma opened this issue 8 months ago • 0 comments

i see that in commit 4a90d19517927dff2becf1cc4a781666d158698b, the uprobe for the net/http server has been moved from

SEC("uprobe/HandlerFunc_ServeHTTP")

to

to SEC("uprobe/serverHandler_ServeHTTP")

I can see that the request parameters such as HTTPMethod, Path etc. was pushed into the spancontext at method entry before and after the change they have been moved to methodExit.

I understand that serverHandler_ServeHTTP gets invoked first, then the mux gets invoked and then uprobe/HandlerFunc_ServeHTTP gets invoked.

Is the change to move the execution to an even more outer level so that the span measurements can be more accurate or is there any other reason for it..

Any clear reason for the change will be helpful.

@RonFed - Tagging as Ron made the change.

PR - https://github.com/open-telemetry/opentelemetry-go-instrumentation/pull/868/commits Commit Id - 4a90d19517927dff2becf1cc4a781666d158698b

Thanks, Ananth

ananthcodekarma avatar Mar 10 '25 09:03 ananthcodekarma