Package com.google.api.gax.tracing
Interface ApiTracerFactory
- All Known Implementing Classes:
BaseApiTracerFactory,CompositeTracerFactory,LoggingTracerFactory,MetricsTracerFactory,OpencensusTracerFactory,OpenTelemetryMetricsFactory,OpenTelemetryTracingFactory
A factory to create new instances of
ApiTracers.
In general a single instance of an ApiTracer will correspond to a single logical
operation.
For internal use only. google-cloud-java libraries should extend BaseApiTracerFactory.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanIndicates whether this factory requires anApiTracerContextto be injected viawithContext(ApiTracerContext)before creating tracers.default ApiTracernewTracer(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.default ApiTracerFactorywithContext(ApiTracerContext context) Returns a newApiTracerFactorythat will use the provided context to infer attributes for all tracers created by the factory.
-
Method Details
-
newTracer
ApiTracer newTracer(ApiTracer parent, SpanName spanName, ApiTracerFactory.OperationType operationType) Create a newApiTracerthat will be a child of the current context.- Parameters:
parent- the parent of this tracerspanName- the name of the new spanoperationType- the type of operation that the tracer will trace
-
newTracer
Create a newApiTracerthat will be a child of the current context.- Parameters:
parent- the parent of this tracertracerContext- the method-definition-specific tracer context
-
needsContext
default boolean needsContext()Indicates whether this factory requires anApiTracerContextto be injected viawithContext(ApiTracerContext)before creating tracers.- Returns:
trueif anApiTracerContextshould be injected,falseotherwise.
-
withContext
Returns 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
-