1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-08-04 21:42:57 +02:00

Tracing: traces now correctly form a tree (#1170)

* First cut of trace

* Dial it back yo

* Defensive programming
This commit is contained in:
Janos Dobronszki
2020-02-06 17:22:16 +00:00
committed by GitHub
parent 16552620e0
commit 92571db693
3 changed files with 37 additions and 18 deletions

View File

@ -63,6 +63,9 @@ func NewContext(ctx context.Context, md Metadata) context.Context {
// MergeContext merges metadata to existing metadata, overwriting if specified
func MergeContext(ctx context.Context, patchMd Metadata, overwrite bool) context.Context {
if ctx == nil {
ctx = context.Background()
}
md, _ := ctx.Value(metaKey{}).(Metadata)
cmd := make(Metadata)
for k, v := range md {