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.OptionsspanBuilderOptions
-
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 SpanBuilderspanBuilderWithExplicitParent(java.lang.String spanName, Span parent)Returns aSpanBuilderto create and start a new childSpan(or root if parent isnullor has an invalidSpanContext), with parent being the designatedSpan.SpanBuilderspanBuilderWithRemoteParent(java.lang.String spanName, SpanContext remoteParentSpanContext)Returns aSpanBuilderto create and start a new childSpan(or root if parent isSpanContext.INVALIDornull), with parent being the remoteSpandesignated 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:TracerReturns aSpanBuilderto create and start a new childSpan(or root if parent isnullor has an invalidSpanContext), with parent being the designatedSpan.See
SpanBuilderfor usage examples.This must be used to create a
Spanwhen manual Context propagation is used OR when creating a rootSpanwith anullparent.- Specified by:
spanBuilderWithExplicitParentin classTracer- Parameters:
spanName- The name of the returned Span.parent- The parent of the returned Span. IfnulltheSpanBuilderwill build a rootSpan.- Returns:
- a
SpanBuilderto create and start a newSpan.
-
spanBuilderWithRemoteParent
public SpanBuilder spanBuilderWithRemoteParent(java.lang.String spanName, @Nullable SpanContext remoteParentSpanContext)
Description copied from class:TracerReturns aSpanBuilderto create and start a new childSpan(or root if parent isSpanContext.INVALIDornull), with parent being the remoteSpandesignated by theSpanContext.See
SpanBuilderfor usage examples.This must be used to create a
Spanwhen the parent is in a different process. This is only intended for use by RPC systems or similar.If no
SpanContextOR fail to parse theSpanContexton the server side, users must call this method with anullremote parentSpanContext.- Specified by:
spanBuilderWithRemoteParentin classTracer- Parameters:
spanName- The name of the returned Span.remoteParentSpanContext- The remote parent of the returned Span.- Returns:
- a
SpanBuilderto create and start a newSpan.
-
-