You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When i used nethttp,create span twice,I don't think it makes sense
req, ht := nethttp.TraceRequest(c.Tracer, req, nethttp.OperationName("HTTP GET: "+endpoint))
defer ht.Finish()
Then I look at the source code
func (h *Tracer) start(req *http.Request) opentracing.Span {
if h.root == nil {
parent := opentracing.SpanFromContext(req.Context())
var spanctx opentracing.SpanContext
if parent != nil {
spanctx = parent.Context()
}
operationName := h.opts.operationName
if operationName == "" {
operationName = "HTTP Client"
}
root := h.tr.StartSpan(operationName, opentracing.ChildOf(spanctx))
h.root = root
}
When i used nethttp,create span twice,I don't think it makes sense
req, ht := nethttp.TraceRequest(c.Tracer, req, nethttp.OperationName("HTTP GET: "+endpoint))
defer ht.Finish()
Then I look at the source code
func (h *Tracer) start(req *http.Request) opentracing.Span {
if h.root == nil {
parent := opentracing.SpanFromContext(req.Context())
var spanctx opentracing.SpanContext
if parent != nil {
spanctx = parent.Context()
}
operationName := h.opts.operationName
if operationName == "" {
operationName = "HTTP Client"
}
root := h.tr.StartSpan(operationName, opentracing.ChildOf(spanctx))
h.root = root
}
}
I don't understand why span h.sp is created
The text was updated successfully, but these errors were encountered: