Package com.google.api.gax.tracing
Class CompositeTracerFactory
java.lang.Object
com.google.api.gax.tracing.BaseApiTracerFactory
com.google.api.gax.tracing.CompositeTracerFactory
- All Implemented Interfaces:
ApiTracerFactory
A composite implementation of
ApiTracerFactory that bundles multiple tracing factories
and produces a CompositeTracer out of them.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.api.gax.tracing.ApiTracerFactory
ApiTracerFactory.OperationType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether this factory requires anApiTracerContextto be injected viaApiTracerFactory.withContext(ApiTracerContext)before creating tracers.newTracer(ApiTracer parent, ApiTracerContext tracerContext) Create a newApiTracerthat will be a child of the current context.newTracer(ApiTracer parent, SpanName spanName, ApiTracerFactory.OperationType operationType) Create a newApiTracerthat will be a child of the current context.withContext(ApiTracerContext context) Returns a newApiTracerFactorythat will use the provided context to infer attributes for all tracers created by the factory.Methods inherited from class com.google.api.gax.tracing.BaseApiTracerFactory
getInstance
-
Constructor Details
-
CompositeTracerFactory
-
-
Method Details
-
newTracer
public ApiTracer newTracer(ApiTracer parent, SpanName spanName, ApiTracerFactory.OperationType operationType) Description copied from class:BaseApiTracerFactoryCreate 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
-
newTracer
Description copied from interface:ApiTracerFactoryCreate a newApiTracerthat will be a child of the current context.- Parameters:
parent- the parent of this tracertracerContext- the method-definition-specific tracer context
-
needsContext
public boolean needsContext()Description copied from interface:ApiTracerFactoryIndicates whether this factory requires anApiTracerContextto be injected viaApiTracerFactory.withContext(ApiTracerContext)before creating tracers.- Returns:
trueif anApiTracerContextshould be injected,falseotherwise.
-
withContext
Description copied from interface:ApiTracerFactoryReturns a newApiTracerFactorythat will use the provided context to infer attributes for all tracers created by the factory.- Parameters:
context- anApiTracerContextobject containing information to construct attributes
-