From 1172dc5ffb9f36db21657f3c90004e90274bd37f Mon Sep 17 00:00:00 2001 From: Peter Findeisen Date: Mon, 4 Dec 2023 12:45:38 -0800 Subject: [PATCH 1/2] Issue 6037 - Wrapping "invalid" SpanContexts in Span does not preserve SpanContext --- api/all/src/main/java/io/opentelemetry/api/trace/Span.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/api/all/src/main/java/io/opentelemetry/api/trace/Span.java b/api/all/src/main/java/io/opentelemetry/api/trace/Span.java index 898e05a4e9d..ca5ce6c49b3 100644 --- a/api/all/src/main/java/io/opentelemetry/api/trace/Span.java +++ b/api/all/src/main/java/io/opentelemetry/api/trace/Span.java @@ -81,9 +81,6 @@ static Span wrap(SpanContext spanContext) { ApiUsageLogger.log("context is null"); return getInvalid(); } - if (!spanContext.isValid()) { - return getInvalid(); - } return PropagatedSpan.create(spanContext); } From de228534bce6e70777fc2d693c9947e9a2f435d4 Mon Sep 17 00:00:00 2001 From: Peter Findeisen Date: Mon, 4 Dec 2023 15:41:46 -0800 Subject: [PATCH 2/2] Updating the javadocs. --- api/all/src/main/java/io/opentelemetry/api/trace/Span.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/all/src/main/java/io/opentelemetry/api/trace/Span.java b/api/all/src/main/java/io/opentelemetry/api/trace/Span.java index ca5ce6c49b3..a54e7666c9c 100644 --- a/api/all/src/main/java/io/opentelemetry/api/trace/Span.java +++ b/api/all/src/main/java/io/opentelemetry/api/trace/Span.java @@ -74,7 +74,7 @@ static Span getInvalid() { /** * 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) {