Class Tracer.NoopTracer

java.lang.Object
io.opencensus.trace.Tracer
io.opencensus.trace.Tracer.NoopTracer
Enclosing class:
Tracer

private static final class Tracer.NoopTracer extends Tracer
  • Constructor Details

    • NoopTracer

      private NoopTracer()
  • Method Details

    • spanBuilderWithExplicitParent

      public SpanBuilder spanBuilderWithExplicitParent(String spanName, @Nullable Span parent)
      Description copied from class: Tracer
      Returns a SpanBuilder to create and start a new child Span (or root if parent is null or has an invalid SpanContext), with parent being the designated Span.

      See SpanBuilder for usage examples.

      This must be used to create a Span when manual Context propagation is used OR when creating a root Span with a null parent.

      Specified by:
      spanBuilderWithExplicitParent in class Tracer
      Parameters:
      spanName - The name of the returned Span.
      parent - The parent of the returned Span. If null the SpanBuilder will build a root Span.
      Returns:
      a SpanBuilder to create and start a new Span.
    • spanBuilderWithRemoteParent

      public SpanBuilder spanBuilderWithRemoteParent(String spanName, @Nullable SpanContext remoteParentSpanContext)
      Description copied from class: Tracer
      Returns a SpanBuilder to create and start a new child Span (or root if parent is SpanContext.INVALID or null), with parent being the remote Span designated by the SpanContext.

      See SpanBuilder for usage examples.

      This must be used to create a Span when the parent is in a different process. This is only intended for use by RPC systems or similar.

      If no SpanContext OR fail to parse the SpanContext on the server side, users must call this method with a null remote parent SpanContext.

      Specified by:
      spanBuilderWithRemoteParent in class Tracer
      Parameters:
      spanName - The name of the returned Span.
      remoteParentSpanContext - The remote parent of the returned Span.
      Returns:
      a SpanBuilder to create and start a new Span.