Interface TraceUtil
- All Known Implementing Classes:
DisabledTraceUtil,EnabledTraceUtil
public interface TraceUtil
A utility interface for trace collection. Classes that implement this interface may make their
own design choices for how they approach trace collection. For instance, they may be no-op, or
they may use a particular tracing framework such as OpenTelemetry.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceRepresents a trace context.static interfaceRepresents a trace scope.static interfaceRepresents a trace span. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionReturns the current Context.Returns the current span.com.google.api.core.ApiFunction<io.grpc.ManagedChannelBuilder,io.grpc.ManagedChannelBuilder> Returns a channel configurator for gRPC, ornullif tracing is disabled.static TraceUtilgetInstance(FirestoreOptions firestoreOptions) Creates and returns an instance of the TraceUtil class.Starts a new span with the given name, sets it as the current span, and returns it.startSpan(String spanName, TraceUtil.Context parent) Starts a new span with the given name and the given context as its parent, sets it as the current span, and returns it.
-
Field Details
-
ATTRIBUTE_SERVICE_PREFIX
- See Also:
-
ATTRIBUTE_KEY_ATTEMPT
- See Also:
-
ATTRIBUTE_KEY_DOC_COUNT
- See Also:
-
ATTRIBUTE_KEY_IS_TRANSACTIONAL
- See Also:
-
ATTRIBUTE_KEY_NUM_RESPONSES
- See Also:
-
ATTRIBUTE_KEY_IS_RETRY_WITH_CURSOR
- See Also:
-
ATTRIBUTE_KEY_TRANSACTION_TYPE
- See Also:
-
ATTRIBUTE_KEY_ATTEMPTS_ALLOWED
- See Also:
-
ATTRIBUTE_KEY_ATTEMPTS_REMAINING
- See Also:
-
ENABLE_TRACING_ENV_VAR
- See Also:
-
LIBRARY_NAME
- See Also:
-
-
Method Details
-
getInstance
Creates and returns an instance of the TraceUtil class.- Parameters:
firestoreOptions- The FirestoreOptions object that is requesting an instance of TraceUtil.- Returns:
- An instance of the TraceUtil class.
-
getChannelConfigurator
@Nullable com.google.api.core.ApiFunction<io.grpc.ManagedChannelBuilder,io.grpc.ManagedChannelBuilder> getChannelConfigurator()Returns a channel configurator for gRPC, ornullif tracing is disabled. -
startSpan
Starts a new span with the given name, sets it as the current span, and returns it. -
startSpan
Starts a new span with the given name and the given context as its parent, sets it as the current span, and returns it. -
currentSpan
Returns the current span. -
currentContext
Returns the current Context.
-