mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-21 20:26:41 +00:00
removed fast path in startSpan
This commit is contained in:
parent
f6289f1a46
commit
0897f08389
1 changed files with 1 additions and 10 deletions
|
|
@ -59,11 +59,6 @@ func StartServerSpan(ctx context.Context, tracer trace.Tracer, rpc RPCInfo, othe
|
||||||
trace.WithSpanKind(trace.SpanKindServer),
|
trace.WithSpanKind(trace.SpanKindServer),
|
||||||
)
|
)
|
||||||
|
|
||||||
// Fast path: noop provider or span not sampled
|
|
||||||
if !span.IsRecording() {
|
|
||||||
return ctx, func(error) { span.End() }
|
|
||||||
}
|
|
||||||
|
|
||||||
// Define required attributes
|
// Define required attributes
|
||||||
attrs := []Attribute{
|
attrs := []Attribute{
|
||||||
semconv.RPCSystemKey.String(rpc.System),
|
semconv.RPCSystemKey.String(rpc.System),
|
||||||
|
|
@ -112,11 +107,7 @@ func startSpan(
|
||||||
trace.WithSpanKind(trace.SpanKindInternal),
|
trace.WithSpanKind(trace.SpanKindInternal),
|
||||||
)
|
)
|
||||||
|
|
||||||
// Fast path
|
// Set attributes if any are provided
|
||||||
if !span.IsRecording() {
|
|
||||||
return ctx, span, func(error) { span.End() }
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(attributes) > 0 {
|
if len(attributes) > 0 {
|
||||||
span.SetAttributes(attributes...)
|
span.SetAttributes(attributes...)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue