Package com.google.api.gax.tracing
Class OpencensusTracerFactory
- java.lang.Object
-
- com.google.api.gax.tracing.BaseApiTracerFactory
-
- com.google.api.gax.tracing.OpencensusTracerFactory
-
- All Implemented Interfaces:
ApiTracerFactory
@InternalApi("For google-cloud-java client use only") public final class OpencensusTracerFactory extends BaseApiTracerFactory
AApiTracerFactoryto build instances ofOpencensusTracer.This class wraps the
Tracerprovided by Opencensus inTracing.getTracer(). It will be used to create new spans and wrap them inOpencensusTracerdefined in gax.This class is thread safe.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.api.gax.tracing.ApiTracerFactory
ApiTracerFactory.OperationType
-
-
Constructor Summary
Constructors Constructor Description OpencensusTracerFactory()Instantiates a new instance capturing theTracerinTracing.getTracer.OpencensusTracerFactory(Map<String,String> spanAttributes)Instantiates a new instance capturing theTracerinTracing.getTracer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)inthashCode()ApiTracernewTracer(ApiTracer parent, SpanName spanName, ApiTracerFactory.OperationType operationType)Create a newApiTracerthat will be a child of the current context.-
Methods inherited from class com.google.api.gax.tracing.BaseApiTracerFactory
getInstance
-
-
-
-
Constructor Detail
-
OpencensusTracerFactory
public OpencensusTracerFactory()
Instantiates a new instance capturing theTracerinTracing.getTracer.
-
OpencensusTracerFactory
public OpencensusTracerFactory(Map<String,String> spanAttributes)
Instantiates a new instance capturing theTracerinTracing.getTracer. It will also override the service name of the grpc stub with a custom client name. This is useful disambiguate spans created outer manual written wrappers and around generated gapic spans.- Parameters:
spanAttributes- the attributes to stamp on every span. Should include things like library version.
-
-
Method Detail
-
newTracer
public ApiTracer newTracer(ApiTracer parent, SpanName spanName, ApiTracerFactory.OperationType operationType)
Create a newApiTracerthat will be a child of the current context.- Specified by:
newTracerin interfaceApiTracerFactory- Overrides:
newTracerin classBaseApiTracerFactory- Parameters:
parent- the parent of this tracerspanName- the name of the new spanoperationType- the type of operation that the tracer will trace
-
-