Skip to content

Commit 3728490

Browse files
committed
Optimization withParent option description
1 parent 054ddb4 commit 3728490

File tree

1 file changed

+10
-1
lines changed
  • instrumentation-annotations/src/main/java/io/opentelemetry/instrumentation/annotations

1 file changed

+10
-1
lines changed

instrumentation-annotations/src/main/java/io/opentelemetry/instrumentation/annotations/WithSpan.java

+10-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
package io.opentelemetry.instrumentation.annotations;
77

88
import io.opentelemetry.api.trace.SpanKind;
9+
import io.opentelemetry.context.Context;
910
import java.lang.annotation.ElementType;
1011
import java.lang.annotation.Retention;
1112
import java.lang.annotation.RetentionPolicy;
@@ -35,6 +36,14 @@
3536
/** Specify the {@link SpanKind} of span to be created. Defaults to {@link SpanKind#INTERNAL}. */
3637
SpanKind kind() default SpanKind.INTERNAL;
3738

38-
/** Specify whether to create a new span with parent. Defaults to {@code true}. */
39+
/**
40+
* Specifies whether to use the current context as the parent when creating a Span.
41+
*
42+
* <p>If set to {@code true} (default), the created span will inherit the existing parent context,
43+
* forming part of the same trace.
44+
*
45+
* <p>If set to {@code false}, the created span will use {@link Context#root()} and have no
46+
* parent, starting a new trace independently.
47+
*/
3948
boolean withParent() default true;
4049
}

0 commit comments

Comments
 (0)