Class TracerImpl
java.lang.Object
io.opencensus.trace.Tracer
io.opencensus.implcore.trace.TracerImpl
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTracerImpl(RandomHandler randomHandler, RecordEventsSpanImpl.StartEndHandler startEndHandler, Clock clock, TraceConfig traceConfig) -
Method Summary
Modifier and TypeMethodDescriptionspanBuilderWithExplicitParent(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.spanBuilderWithRemoteParent(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 Tracer
getCurrentSpan, spanBuilder, withSpan, withSpan, withSpan
-
Field Details
-
spanBuilderOptions
-
-
Constructor Details
-
TracerImpl
public TracerImpl(RandomHandler randomHandler, RecordEventsSpanImpl.StartEndHandler startEndHandler, Clock clock, TraceConfig traceConfig)
-
-
Method Details
-
spanBuilderWithExplicitParent
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(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.
-