From 382c7ced31a4a07b40f8f115834cab19935759ea Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Thu, 25 Mar 2021 17:51:54 +0000 Subject: [PATCH] Remove hasRemoteParent field from SDK span (#1728) Use the newly added SpanContext.IsRemote method instead. --- sdk/trace/span.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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 }