Skip to content

Commit

Permalink
fix: NoopSpan should be instance
Browse files Browse the repository at this point in the history
  • Loading branch information
tttoad committed May 31, 2024
1 parent cb5c7d4 commit ba28d5c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion trace/noop/noop.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ func (t Tracer) Start(ctx context.Context, _ string, _ ...trace.SpanStartOption)
span = Span{sc: sc}
} else {
// No parent, return a No-Op span with an empty span context.
span = Span{}
span = noopSpanInstance
}
return trace.ContextWithSpan(ctx, span), span
}

var noopSpanInstance trace.Span = Span{}

// Span is an OpenTelemetry No-Op Span.
type Span struct {
embedded.Span
Expand Down

0 comments on commit ba28d5c

Please sign in to comment.