We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In following example:
client := &http.Client{Transport: &nethttp.Transport{}} req, err := http.NewRequest("GET", "http://google.com", nil) if err != nil { return err } req = req.WithContext(ctx) // extend existing trace, if any req, ht := nethttp.TraceRequest(tracer, req) defer ht.Finish() res, err := client.Do(req) if err != nil { return err } res.Body.Close() return nil
nethttp.TraceRequest is extra. It is ok for people wanting greater control, but it should default to using GlobalTracer().
Similar to opencensus variant, ochttp, https://github.com/census-instrumentation/opencensus-go/tree/master/plugin/ochttp, things work out of the box. Just using their server middleware and their roundtripper plus adding parent request headers to context (via req = req.WithContext(parent.Context()))
req = req.WithContext(parent.Context())
However currently without req, ht := nethttp.TraceRequest(tracer, req) parent span isn't correlated to the child span
req, ht := nethttp.TraceRequest(tracer, req)
The text was updated successfully, but these errors were encountered:
I don't recall the full interactions here, but I think ideally everything should work with just this:
client := &http.Client{Transport: &nethttp.Transport{Tracer: tracer}}
And if instead the transport is created without a tracer, then the global one is used.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
In following example:
nethttp.TraceRequest is extra. It is ok for people wanting greater control, but it should default to using GlobalTracer().
Similar to opencensus variant, ochttp, https://github.com/census-instrumentation/opencensus-go/tree/master/plugin/ochttp, things work out of the box. Just using their server middleware and their roundtripper plus adding parent request headers to context (via
req = req.WithContext(parent.Context())
)However currently without
req, ht := nethttp.TraceRequest(tracer, req)
parent span isn't correlated to the child spanThe text was updated successfully, but these errors were encountered: