You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the .Start method of the noop tracer looks like this
// Start carries forward a non-recording Span, if one is present in the context, otherwise it// creates a no-op Span.func (tnoopTracer) Start(ctx context.Context, namestring, _...SpanStartOption) (context.Context, Span) {
span:=SpanFromContext(ctx)
if_, ok:=span.(nonRecordingSpan); !ok {
// span is likely already a noopSpan, but let's be surespan=noopSpanInstance
}
returnContextWithSpan(ctx, span), span
}
Which throws a panic if a nil context is provided
Comparing it to the .Start method of the SDK tracer
API methods MUST NOT throw unhandled exceptions when used incorrectly by end users. The API and SDK SHOULD provide safe defaults for missing or invalid arguments. For instance, a name like empty may be used if the user passes in null as the span name argument during Span construction.
Description
Currently the
.Start
method of the noop tracer looks like thisWhich throws a panic if a
nil
context is providedComparing it to the
.Start
method of the SDK tracerWe can see that there's a safeguard for a
nil
context as agreed hereExpected behavior
Do not throw panic
The text was updated successfully, but these errors were encountered: