diff --git a/api/trace/api.go b/api/trace/api.go index d697239f4878..b6a470c14349 100644 --- a/api/trace/api.go +++ b/api/trace/api.go @@ -29,6 +29,9 @@ import ( ) type Tracer interface { + // ScopeID returns the resource scope of this tracer. + scope.Scope + Start(context.Context, string, ...SpanOption) (context.Context, Span) // WithSpan wraps the execution of the function body with a span. @@ -50,9 +53,6 @@ type Tracer interface { // Note: see https://github.com/opentracing/opentracing-go/issues/127 Inject(context.Context, Span, Injector) - - // ScopeID returns the resource scope of this tracer. - scope.Scope } type Span interface { @@ -111,6 +111,11 @@ type Reference struct { type RelationshipType int +const ( + ChildOfRelationship RelationshipType = iota + FollowsFromRelationship +) + var ( // The process global tracer could have process-wide resource // tags applied directly, or we can have a SetGlobal tracer to @@ -121,11 +126,6 @@ var ( nt = &noopTracer{} ) -const ( - ChildOfRelationship RelationshipType = iota - FollowsFromRelationship -) - // GlobalTracer return tracer registered with global registry. // If no tracer is registered then an instance of noop Tracer is returned. func GlobalTracer() Tracer { diff --git a/api/trace/noop_trace.go b/api/trace/noop_trace.go index 36711f195973..7804342d6519 100644 --- a/api/trace/noop_trace.go +++ b/api/trace/noop_trace.go @@ -27,8 +27,6 @@ type noopTracer struct { var _ Tracer = (*noopTracer)(nil) -var t = &noopTracer{} - // ScopeID returns an empty instance of ScopeID func (t *noopTracer) ScopeID() core.ScopeID { return t.resources.Scope()