Closed nothingmuch closed 7 years ago
Not sure what to do about 1.6. The context setting stuff could be split up with over two files with build tags, with gorilla/context as a fallback. This could also be done using a runtime check for
_, hasStdlibcontext := request.(interface { WithContext() *http.Request })
This looks really good, thanks for the PR! A couple of thoughts:
.travis.yml
to add Go 1.7?*http.Request
to MiddlewareConfig
SetContextSpan
looks OK, but just to be on the safe side let's confirm go-kit won't break by merging this.@basvanbeek maybe you can confirm the last two (that this won't affect go-kit)?
Go kit is currently tested with 1.5+ and we are very conservative with forcing our consumers to the latest and greatest without necessity. If I were an Appdash consumer with potential legacy code forcing me to stick with an older version of Go I would appreciate the effort of a library to remain backwards compatible where possible. I think the above mentioned build tags for a smooth migration path would be the best option.
Since the only touch points between Go kit and AppDash are initialization of the OpenTracing interface in one of our main examples, I can make it work if our CI would break because of this change.
cc @peterbourgon
Makes perfect sense. Thanks for taking the time to respond @basvanbeek ! I agree with everything you have said.
@nothingmuch could you update this PR to:
.travis.yml
Or, if you prefer, just let me know and I can pick up the work / do the above before merging :)
I would be happy to have another go at this, but I will probably need a few days more, I couldn't find the time this weekend, sorry.
Closing due to inactivity + different solution @ https://github.com/sourcegraph/appdash/pull/182#issuecomment-262049135
This PR changes the httptrace API by requiring
*http.Request
to be returned fromSetContextSpan
. To avoid breaking ani API,this change can be avoided by overwriting the fields of the request structure directly, dereferencing the shallow clone returned byWithContext
.