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
A
ApiTracerFactory to build instances of OpencensusTracer.
This class wraps the Tracer provided by Opencensus in Tracing.getTracer(). It
will be used to create new spans and wrap them in OpencensusTracer defined 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
ConstructorsConstructorDescriptionInstantiates a new instance capturing theTracerinTracing.getTracer.OpencensusTracerFactory(Map<String, String> spanAttributes) Instantiates a new instance capturing theTracerinTracing.getTracer. -
Method Summary
Methods inherited from class com.google.api.gax.tracing.BaseApiTracerFactory
getInstance
-
Constructor Details
-
OpencensusTracerFactory
public OpencensusTracerFactory()Instantiates a new instance capturing theTracerinTracing.getTracer. -
OpencensusTracerFactory
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 Details
-
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
-
equals
-
hashCode
public int hashCode()
-