Skip to content

Commit

Permalink
fix: noOp span
Browse files Browse the repository at this point in the history
  • Loading branch information
notanatol committed Nov 4, 2023
1 parent f09c14c commit a7a61df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/api/bzz.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ func (s *Service) fileUploadHandler(
}

span.LogFields(olog.Bool("success", true))
span.SetTag("root_address", manifestReference)

if tagID != 0 {
w.Header().Set(SwarmTagHeader, fmt.Sprint(tagID))
Expand Down
7 changes: 6 additions & 1 deletion pkg/pusher/pusher.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,12 @@ func (s *Service) chunksWorker(warmupTime time.Duration, tracer *tracing.Tracer)
s.metrics.TotalToPush.Inc()
startTime := time.Now()

spanCtx := tracing.WithContext(ctx, op.Span.Context())
spanCtx := ctx
if op.Span != nil {
spanCtx = tracing.WithContext(spanCtx, op.Span.Context())
} else {
op.Span = opentracing.NoopTracer{}.StartSpan("noOp")
}

if op.Direct {
err = s.pushDirect(spanCtx, s.logger, op)
Expand Down

0 comments on commit a7a61df

Please sign in to comment.