Skip to content

Commit

Permalink
fix: make sure to set span parent
Browse files Browse the repository at this point in the history
  • Loading branch information
w-h-a committed Oct 14, 2024
1 parent 165437d commit d905c1b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
2 changes: 1 addition & 1 deletion telemetry/tracev2/memory/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (t *memoryTrace) Start(ctx context.Context, name string) (context.Context,

t.spans[key] = span

newCtx, _ := tracev2.ContextWithSpan(ctx, span.SpanContext().SpanID())
newCtx, _ := tracev2.ContextWithSpanParent(ctx, span.SpanContext().SpanID())

return newCtx, key
}
Expand Down
17 changes: 0 additions & 17 deletions telemetry/tracev2/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,3 @@ func SpanParentFromContext(ctx context.Context) (spanparent [8]byte, found bool)

return
}

func ContextWithSpan(ctx context.Context, span [8]byte) (context.Context, error) {
return metadatautils.MergeContext(ctx, map[string]string{
spanKey: string(span[:]),
}, true), nil
}

func SpanFromContext(ctx context.Context) (span [8]byte, found bool) {
spanId, found := metadatautils.GetContext(ctx, spanKey)
if !found {
return
}

copy(span[:], spanId)

return
}

0 comments on commit d905c1b

Please sign in to comment.