Issue 6037 - Wrapping "invalid" SpanContexts in Span does not preserve SpanContext (#6044)
This commit is contained in:
parent
3bb221fb5d
commit
9f3456fd5d
|
@ -74,16 +74,13 @@ public interface Span extends ImplicitContextKeyed {
|
|||
/**
|
||||
* Returns a non-recording {@link Span} that holds the provided {@link SpanContext} but has no
|
||||
* functionality. It will not be exported and all tracing operations are no-op, but it can be used
|
||||
* to propagate a valid {@link SpanContext} downstream.
|
||||
* to propagate a {@link SpanContext} downstream.
|
||||
*/
|
||||
static Span wrap(SpanContext spanContext) {
|
||||
if (spanContext == null) {
|
||||
ApiUsageLogger.log("context is null");
|
||||
return getInvalid();
|
||||
}
|
||||
if (!spanContext.isValid()) {
|
||||
return getInvalid();
|
||||
}
|
||||
return PropagatedSpan.create(spanContext);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue