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:
@ -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 {
|
||||
|
Reference in New Issue
Block a user