Package io.opencensus.implcore.trace
Class TracerImpl
- java.lang.Object
-
- io.opencensus.trace.Tracer
-
- io.opencensus.implcore.trace.TracerImpl
-
-
Field Summary
Fields Modifier and Type Field Description private SpanBuilderImpl.Options
spanBuilderOptions
-
Constructor Summary
Constructors Constructor Description TracerImpl(RandomHandler randomHandler, RecordEventsSpanImpl.StartEndHandler startEndHandler, Clock clock, TraceConfig traceConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SpanBuilder
spanBuilderWithExplicitParent(java.lang.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
.SpanBuilder
spanBuilderWithRemoteParent(java.lang.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, spanBuilder, withSpan, withSpan, withSpan
-
-
-
-
Field Detail
-
spanBuilderOptions
private final SpanBuilderImpl.Options spanBuilderOptions
-
-
Constructor Detail
-
TracerImpl
public TracerImpl(RandomHandler randomHandler, RecordEventsSpanImpl.StartEndHandler startEndHandler, Clock clock, TraceConfig traceConfig)
-
-
Method Detail
-
spanBuilderWithExplicitParent
public SpanBuilder spanBuilderWithExplicitParent(java.lang.String spanName, @Nullable Span parent)
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(java.lang.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
.
-
-