removed fast path in startSpan

This commit is contained in:
jonny rhea 2026-01-07 18:36:53 -06:00
parent f6289f1a46
commit 0897f08389

View file

@ -59,11 +59,6 @@ func StartServerSpan(ctx context.Context, tracer trace.Tracer, rpc RPCInfo, othe
trace.WithSpanKind(trace.SpanKindServer),
)
// Fast path: noop provider or span not sampled
if !span.IsRecording() {
return ctx, func(error) { span.End() }
}
// Define required attributes
attrs := []Attribute{
semconv.RPCSystemKey.String(rpc.System),
@ -112,11 +107,7 @@ func startSpan(
trace.WithSpanKind(trace.SpanKindInternal),
)
// Fast path
if !span.IsRecording() {
return ctx, span, func(error) { span.End() }
}
// Set attributes if any are provided
if len(attributes) > 0 {
span.SetAttributes(attributes...)
}