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

Update client.go: set peer.address tag from req.URL.Host; log hostPort in getConn() #58

Merged
merged 3 commits into from Dec 17, 2020

Conversation

krantideep95
Copy link
Contributor

@krantideep95 krantideep95 commented Dec 17, 2020

while creating spans for outbound requests,
http.url tag is set In RoundTripper here:

ext.HTTPUrl.Set(tracer.sp, tracer.opts.urlTagFunc(req.URL))

but, if clientTrace is enabled, this http.url is overriden in getConn() with host:port. This leaves span with poorer data with just host:port instead of complete (sanitised, if URLTagFunc was passed) url.
Some tools like https://www.hypertrace.org/ depend on http.url tag to determine backends of a service, for which they require a complete url.

Edit: based on conversation in #3 (comment), made changes to set peer.address tag & log hostPort in getConn()

krantideep95 added 3 commits December 17, 2020 22:45
@krantideep95 krantideep95 changed the title Update client.go: removes overriding of ext.HTTPUrl in getConn() Update client.go: set peer.address tag from req.URL.Host; log hostPort in getConn() Dec 17, 2020
Copy link
Collaborator

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

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

lgtm, thanks

@yurishkuro yurishkuro merged commit 08d136d into opentracing-contrib:master Dec 17, 2020
@krantideep95 krantideep95 deleted the patch-1 branch December 17, 2020 19:05
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.

None yet

2 participants