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
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
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:
-
SPAN_NAME_DOC_REF_CREATE
- See Also:
-
SPAN_NAME_DOC_REF_SET
- See Also:
-
SPAN_NAME_DOC_REF_UPDATE
- See Also:
-
SPAN_NAME_DOC_REF_DELETE
- See Also:
-
SPAN_NAME_DOC_REF_GET
- See Also:
-
SPAN_NAME_DOC_REF_LIST_COLLECTIONS
- See Also:
-
SPAN_NAME_COL_REF_ADD
- See Also:
-
SPAN_NAME_COL_REF_LIST_DOCUMENTS
- See Also:
-
SPAN_NAME_QUERY_GET
- See Also:
-
SPAN_NAME_AGGREGATION_QUERY_GET
- See Also:
-
SPAN_NAME_RUN_QUERY
- See Also:
-
SPAN_NAME_RUN_AGGREGATION_QUERY
- See Also:
-
SPAN_NAME_BATCH_GET_DOCUMENTS
- See Also:
-
SPAN_NAME_TRANSACTION_RUN
- See Also:
-
SPAN_NAME_TRANSACTION_BEGIN
- See Also:
-
SPAN_NAME_TRANSACTION_GET_QUERY
- See Also:
-
SPAN_NAME_TRANSACTION_GET_AGGREGATION_QUERY
- See Also:
-
SPAN_NAME_TRANSACTION_GET_DOCUMENT
- See Also:
-
SPAN_NAME_TRANSACTION_GET_DOCUMENTS
- See Also:
-
SPAN_NAME_TRANSACTION_ROLLBACK
- See Also:
-
SPAN_NAME_BATCH_COMMIT
- See Also:
-
SPAN_NAME_TRANSACTION_COMMIT
- See Also:
-
SPAN_NAME_PARTITION_QUERY
- See Also:
-
SPAN_NAME_BULK_WRITER_COMMIT
- 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.
-