Compare commits

..

No commits in common. 'master' and 'v1.0.0' have entirely different histories.

@ -48,11 +48,7 @@ func BeforeHandel(ctx context.Context, baseName, serviceName, serviceMethod stri
span.AddEvent(fmt.Sprintf("调用rpc服务:%s,%s,%s", baseName, serviceName, serviceMethod)) span.AddEvent(fmt.Sprintf("调用rpc服务:%s,%s,%s", baseName, serviceName, serviceMethod))
spanCtx := ctx.Value(CtxSpanCtxName).(context.Context) spanCtx := ctx.Value(CtxSpanCtxName).(context.Context)
meta := ctx.Value(share.ReqMetaDataKey) meta := ctx.Value(share.ReqMetaDataKey)
if meta == nil { spanCtx = context.WithValue(spanCtx, share.ReqMetaDataKey, meta)
spanCtx = context.WithValue(spanCtx, share.ReqMetaDataKey, map[string]string{})
} else {
spanCtx = context.WithValue(spanCtx, share.ReqMetaDataKey, meta)
}
share2.Inject(spanCtx, otel.GetTextMapPropagator()) share2.Inject(spanCtx, otel.GetTextMapPropagator())
ctx = spanCtx ctx = spanCtx
} }

Loading…
Cancel
Save