swarm: tracing improvements (#19249)

This commit is contained in:
Anton Evangelatov
2019-03-11 11:45:34 +01:00
committed by GitHub
parent 9a58a9b91a
commit 1a3e25e4c1
5 changed files with 30 additions and 23 deletions

View File

@ -103,6 +103,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)