swarm: fix relationship between spans in open tracing (#19236)

* swarm/network: propagate span with ctx

* swarm/network: try to stop stream.send.request spans on time

* swarm/storage: add chunk ref as a log to netstore.fetcher span
This commit is contained in:
Anton Evangelatov
2019-03-08 08:52:25 +01:00
committed by Viktor Trón
parent ceeb047e69
commit 2cfe0bed9f
3 changed files with 15 additions and 1 deletions

View File

@@ -160,7 +160,7 @@ func (p *Peer) Deliver(ctx context.Context, chunk storage.Chunk, priority uint8,
// SendPriority sends message to the peer using the outgoing priority queue
func (p *Peer) SendPriority(ctx context.Context, msg interface{}, priority uint8) error {
defer metrics.GetOrRegisterResettingTimer(fmt.Sprintf("peer.sendpriority_t.%d", priority), nil).UpdateSince(time.Now())
tracing.StartSaveSpan(ctx)
ctx = tracing.StartSaveSpan(ctx)
metrics.GetOrRegisterCounter(fmt.Sprintf("peer.sendpriority.%d", priority), nil).Inc(1)
wmsg := WrappedPriorityMsg{
Context: ctx,