diff --git a/swarm/network/stream/delivery.go b/swarm/network/stream/delivery.go index 02c5f222c5..b4203c3cca 100644 --- a/swarm/network/stream/delivery.go +++ b/swarm/network/stream/delivery.go @@ -29,6 +29,7 @@ import ( "github.com/ethereum/go-ethereum/swarm/storage" "github.com/ethereum/go-ethereum/swarm/tracing" opentracing "github.com/opentracing/opentracing-go" + olog "github.com/opentracing/opentracing-go/log" ) const ( @@ -146,6 +147,8 @@ func (d *Delivery) handleRetrieveRequestMsg(ctx context.Context, sp *Peer, req * ctx, "stream.handle.retrieve") + osp.LogFields(olog.String("ref", req.Addr.String())) + s, err := sp.getServer(NewStream(swarmChunkServerStreamName, "", true)) if err != nil { return err diff --git a/swarm/storage/netstore.go b/swarm/storage/netstore.go index 9e32578a8c..c926dd3da1 100644 --- a/swarm/storage/netstore.go +++ b/swarm/storage/netstore.go @@ -102,6 +102,14 @@ func (n *NetStore) Get(rctx context.Context, ref Address) (Chunk, error) { return nil, err } if chunk != nil { + // this is not measuring how long it takes to get the chunk for the localstore, but + // rather just adding a span for clarity when inspecting traces in Jaeger, in order + // to make it easier to reason which is the node that actually delivered a chunk. + _, sp := spancontext.StartSpan( + rctx, + "localstore.get") + defer sp.Finish() + return chunk, nil } return fetch(rctx)