Annotation Type WithSpan
Span.
Using this annotation on constructors is not supported by OpenTelemetry instrumentation. The
ElementType.CONSTRUCTOR target exists only for backward compatibility and is planned to
be removed in the 3.0 release.
Application developers can use this annotation to signal OpenTelemetry auto-instrumentation that a new span should be created whenever the marked method is executed.
If you are a library developer, then probably you should NOT use this annotation, because it is non-functional without some form of auto-instrumentation.
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanSpecifies whether to inherit the current context when creating a span.io.opentelemetry.api.trace.SpanKindSpecify theSpanKindof span to be created.Optional name of the created span.
-
Element Details
-
value
String valueOptional name of the created span.If not specified, an appropriate default name should be created by auto-instrumentation. E.g.
"className"."method"- Default:
""
-
kind
io.opentelemetry.api.trace.SpanKind kindSpecify theSpanKindof span to be created. Defaults toSpanKind.INTERNAL.- Default:
INTERNAL
-
inheritContext
boolean inheritContextSpecifies whether to inherit the current context when creating a span.If set to
true(default), the created span will use the current context as its parent, remaining within the same trace.If set to
false, the created span will useContext.root()as its parent, starting a new, independent trace.- Default:
true
-