Skip to content

Commit

Permalink
create child span
Browse files Browse the repository at this point in the history
  • Loading branch information
vgonkivs committed Feb 1, 2024
1 parent 1892102 commit cd263e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions p2p/exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,12 @@ func (ex *Exchange[H]) Head(ctx context.Context, opts ...header.HeadOption[H]) (
)
for _, from := range peers {
go func(from peer.ID) {
_, newSpan := span.TracerProvider().Tracer("requesting peer").Start(
ctx, "",
_, newSpan := tracerClient.Start(
ctx, "requesting peer",
trace.WithAttributes(attribute.String("peerID", from.String())),
)
defer newSpan.End()

headers, err := ex.request(reqCtx, from, headerReq)
if err != nil {
newSpan.SetStatus(codes.Error, err.Error())
Expand Down

0 comments on commit cd263e1

Please sign in to comment.