diff --git a/sdk/trace/span.go b/sdk/trace/span.go index 1f84f94b397..4b19bd0f852 100644 --- a/sdk/trace/span.go +++ b/sdk/trace/span.go @@ -109,9 +109,6 @@ type span struct { // statusMessage represents the status of this span as a string. statusMessage string - // hasRemoteParent is true when this span has a remote parent span. - hasRemoteParent bool - // childSpanCount holds the number of child spans created for this span. childSpanCount int @@ -447,7 +444,7 @@ func (s *span) Snapshot() *export.SpanSnapshot { sd.ChildSpanCount = s.childSpanCount sd.EndTime = s.endTime - sd.HasRemoteParent = s.hasRemoteParent + sd.HasRemoteParent = s.parent.IsRemote() sd.InstrumentationLibrary = s.instrumentationLibrary sd.Name = s.name sd.ParentSpanID = s.parent.SpanID() @@ -581,14 +578,12 @@ func startSpanInternal(ctx context.Context, tr *tracer, name string, o *trace.Sp span.spanKind = trace.ValidateSpanKind(o.SpanKind) span.name = name - span.hasRemoteParent = psc.IsRemote() + span.parent = psc span.resource = provider.resource span.instrumentationLibrary = tr.instrumentationLibrary span.SetAttributes(samplingResult.Attributes...) - span.parent = psc - return span }