diff --git a/pkg/scheduler/scheduler.go b/pkg/scheduler/scheduler.go index b5ff71b9ce188..305d47b17e571 100644 --- a/pkg/scheduler/scheduler.go +++ b/pkg/scheduler/scheduler.go @@ -333,7 +333,7 @@ func (s *Scheduler) enqueueRequest(frontendContext context.Context, frontendAddr // information, since that is a long-running request. tracer := opentracing.GlobalTracer() parentSpanContext, err := lokigrpc.GetParentSpanForRequest(tracer, msg) - if err != nil { + if err != nil && err != opentracing.ErrSpanContextNotFound { return err } diff --git a/pkg/util/httpgrpc/carrier.go b/pkg/util/httpgrpc/carrier.go index b52b51ae352b2..ab1753ef6c271 100644 --- a/pkg/util/httpgrpc/carrier.go +++ b/pkg/util/httpgrpc/carrier.go @@ -39,11 +39,7 @@ func GetParentSpanForHTTPRequest(tracer opentracing.Tracer, req *weaveworks_http } carrier := (*HeadersCarrier)(req) - extracted, err := tracer.Extract(opentracing.HTTPHeaders, carrier) - if err == opentracing.ErrSpanContextNotFound { - err = nil - } - return extracted, err + return tracer.Extract(opentracing.HTTPHeaders, carrier) } func GetParentSpanForQueryRequest(tracer opentracing.Tracer, req *queryrange.QueryRequest) (opentracing.SpanContext, error) { @@ -52,11 +48,7 @@ func GetParentSpanForQueryRequest(tracer opentracing.Tracer, req *queryrange.Que } carrier := opentracing.TextMapCarrier(req.Metadata) - extracted, err := tracer.Extract(opentracing.TextMap, carrier) - if err == opentracing.ErrSpanContextNotFound { - err = nil - } - return extracted, err + return tracer.Extract(opentracing.TextMap, carrier) } func GetParentSpanForRequest(tracer opentracing.Tracer, req Request) (opentracing.SpanContext, error) {