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/http: add span.kind & component tags to WrapHandlerFunc #48

Merged

Conversation

darccio
Copy link
Member

@darccio darccio commented Oct 10, 2023

What does this PR do?

Adds missing tags span.kind and component for net/http autoinstrumentation using instrument.WrapHandlerFunc.

The root cause is that it uses httptrace.TraceAndServe under the hood, that assumes these tags are added by the caller (like httptrace.WrapHandler).

Reviewer's Checklist

  • Changed code has unit tests for its functionality.

@darccio darccio requested a review from ahmed-mez October 10, 2023 07:38
Copy link
Contributor

@ahmed-mez ahmed-mez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why we shouldn't have this logic in dd-trace-go?

@darccio
Copy link
Member Author

darccio commented Oct 10, 2023

@ahmed-mez I thought of that, but it seems that httptrace.TraceAndServe can be used directly and indirectly through httptrace.WrapHandler, that sets these tags before calling httptrace.TraceAndServe. This is why I chose to do it in Orchestrion instead.

I agree this should be in dd-trace-go but it could break expectations of current users. Maybe it's a good candidate to be included in our v2.

@darccio darccio merged commit a62387f into main Oct 10, 2023
3 checks passed
@darccio darccio deleted the dario.castane/AIT-8311/traceandserve-add-spankind-component branch October 10, 2023 08:55
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.

2 participants