java.lang.Object
io.opentelemetry.instrumentation.api.instrumenter.LocalRootSpan

public final class LocalRootSpan extends Object
A local root span is a span that either does not have a parent span (it is the root span of a trace), or its parent span is a remote span (context was propagated from another application).
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static io.opentelemetry.api.trace.Span
    Returns the local root span from the current context or invalid span if there is no local root span.
    static io.opentelemetry.api.trace.Span
    fromContext(io.opentelemetry.context.Context context)
    Returns the local root span from the given context or invalid span if there is no local root span in the context.
    static io.opentelemetry.api.trace.Span
    fromContextOrNull(io.opentelemetry.context.Context context)
    Returns the local root span from the given context or null if there is no local root span in the context.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LocalRootSpan

      public LocalRootSpan()
  • Method Details

    • current

      public static io.opentelemetry.api.trace.Span current()
      Returns the local root span from the current context or invalid span if there is no local root span.
    • fromContext

      public static io.opentelemetry.api.trace.Span fromContext(io.opentelemetry.context.Context context)
      Returns the local root span from the given context or invalid span if there is no local root span in the context.
    • fromContextOrNull

      @Nullable public static io.opentelemetry.api.trace.Span fromContextOrNull(io.opentelemetry.context.Context context)
      Returns the local root span from the given context or null if there is no local root span in the context.