diff --git a/pkg/server/node.go b/pkg/server/node.go index 59a8ebe8b51b..a480a5c164ec 100644 --- a/pkg/server/node.go +++ b/pkg/server/node.go @@ -1315,8 +1315,11 @@ func (n *Node) batchInternal( // the request was doing at the time it noticed the cancellation. if pErr != nil && ctx.Err() != nil { if sp := tracing.SpanFromContext(ctx); sp != nil && !sp.IsNoop() { - log.Infof(ctx, "batch request %s failed with error: %s\ntrace:\n%s", args.String(), - pErr.GoError().Error(), sp.GetConfiguredRecording().String()) + recording := sp.GetConfiguredRecording() + if recording.Len() != 0 { + log.Infof(ctx, "batch request %s failed with error: %s\ntrace:\n%s", args.String(), + pErr.GoError().Error(), recording.String()) + } } }