repair tracing opentracing.HTTPHeadersCarrier panic (#714)

* fix tracing carrier panic
pull/758/head
realotz 4 years ago committed by GitHub
parent e25ebc73bc
commit db2b8bcba0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      middleware/tracing/tracing.go

@ -104,6 +104,10 @@ func Client(opts ...Option) middleware.Middleware {
if md, ok := metadata.FromOutgoingContext(ctx); ok {
carrier = opentracing.HTTPHeadersCarrier(md)
ctx = metadata.NewOutgoingContext(ctx, md)
} else {
md = metadata.Pairs()
carrier = opentracing.HTTPHeadersCarrier(md)
ctx = metadata.NewOutgoingContext(ctx, md)
}
}
span := options.tracer.StartSpan(

Loading…
Cancel
Save