Package io.opencensus.trace
Class Tracer.NoopTracer
java.lang.Object
io.opencensus.trace.Tracer
io.opencensus.trace.Tracer.NoopTracer
- Enclosing class:
Tracer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionspanBuilderWithExplicitParent
(String spanName, Span parent) Returns aSpanBuilder
to create and start a new childSpan
(or root if parent isnull
or has an invalidSpanContext
), with parent being the designatedSpan
.spanBuilderWithRemoteParent
(String spanName, SpanContext remoteParentSpanContext) Returns aSpanBuilder
to create and start a new childSpan
(or root if parent isSpanContext.INVALID
ornull
), with parent being the remoteSpan
designated by theSpanContext
.Methods inherited from class io.opencensus.trace.Tracer
getCurrentSpan, getNoopTracer, spanBuilder, withSpan, withSpan, withSpan
-
Constructor Details
-
NoopTracer
private NoopTracer()
-
-
Method Details
-
spanBuilderWithExplicitParent
Description copied from class:Tracer
Returns aSpanBuilder
to create and start a new childSpan
(or root if parent isnull
or has an invalidSpanContext
), with parent being the designatedSpan
.See
SpanBuilder
for usage examples.This must be used to create a
Span
when manual Context propagation is used OR when creating a rootSpan
with anull
parent.- Specified by:
spanBuilderWithExplicitParent
in classTracer
- Parameters:
spanName
- The name of the returned Span.parent
- The parent of the returned Span. Ifnull
theSpanBuilder
will build a rootSpan
.- Returns:
- a
SpanBuilder
to create and start a newSpan
.
-
spanBuilderWithRemoteParent
public SpanBuilder spanBuilderWithRemoteParent(String spanName, @Nullable SpanContext remoteParentSpanContext) Description copied from class:Tracer
Returns aSpanBuilder
to create and start a new childSpan
(or root if parent isSpanContext.INVALID
ornull
), with parent being the remoteSpan
designated by theSpanContext
.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 theSpanContext
on the server side, users must call this method with anull
remote parentSpanContext
.- Specified by:
spanBuilderWithRemoteParent
in classTracer
- Parameters:
spanName
- The name of the returned Span.remoteParentSpanContext
- The remote parent of the returned Span.- Returns:
- a
SpanBuilder
to create and start a newSpan
.
-