Class EnabledTraceUtil
java.lang.Object
com.google.cloud.datastore.telemetry.EnabledTraceUtil
- All Implemented Interfaces:
TraceUtil
Tracing utility implementation, used to stub out tracing instrumentation when tracing is enabled.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface com.google.cloud.datastore.telemetry.TraceUtil
ATTRIBUTE_SERVICE_PREFIX, ATTRIBUTES_KEY_DEFERRED, ATTRIBUTES_KEY_DOCUMENT_COUNT, ATTRIBUTES_KEY_MISSING, ATTRIBUTES_KEY_MORE_RESULTS, ATTRIBUTES_KEY_READ_CONSISTENCY, ATTRIBUTES_KEY_RECEIVED, ATTRIBUTES_KEY_TRANSACTION_ID, ATTRIBUTES_KEY_TRANSACTIONAL, ENABLE_TRACING_ENV_VAR, LIBRARY_NAME, SPAN_NAME_ALLOCATE_IDS, SPAN_NAME_BEGIN_TRANSACTION, SPAN_NAME_COMMIT, SPAN_NAME_LOOKUP, SPAN_NAME_RESERVE_IDS, SPAN_NAME_ROLLBACK, SPAN_NAME_RUN_AGGREGATION_QUERY, SPAN_NAME_RUN_QUERY, SPAN_NAME_TRANSACTION_COMMIT, SPAN_NAME_TRANSACTION_LOOKUP, SPAN_NAME_TRANSACTION_RUN, SPAN_NAME_TRANSACTION_RUN_AGGREGATION_QUERY, SPAN_NAME_TRANSACTION_RUN_QUERY -
Method Summary
Modifier and TypeMethodDescriptionio.opentelemetry.api.trace.SpanBuilderaddSettingsAttributesToCurrentSpan(io.opentelemetry.api.trace.SpanBuilder spanBuilder) Applies the current Datastore instance settings as attributes to the current Spancom.google.api.core.ApiFunction<io.grpc.ManagedChannelBuilder,io.grpc.ManagedChannelBuilder> Returns a channel configurator for gRPC, ornullif tracing is disabled.Returns the current Context.Returns the current span.io.opentelemetry.api.OpenTelemetryio.opentelemetry.api.trace.TracerReturns the current OpenTelemetry Tracer when OpenTelemetry SDK is provided.com.google.cloud.datastore.telemetry.EnabledTraceUtil.SpanStarts a new span with the given name, sets it as the current span, and returns it.startSpan(String spanName, TraceUtil.Span parentSpan) Starts a new span with the given name and the span represented by the parentSpan as its parent, sets it as the current span and returns it.
-
Method Details
-
getOpenTelemetry
public io.opentelemetry.api.OpenTelemetry getOpenTelemetry() -
getChannelConfigurator
@Nullable public com.google.api.core.ApiFunction<io.grpc.ManagedChannelBuilder,io.grpc.ManagedChannelBuilder> getChannelConfigurator()Description copied from interface:TraceUtilReturns a channel configurator for gRPC, ornullif tracing is disabled.- Specified by:
getChannelConfiguratorin interfaceTraceUtil
-
addSettingsAttributesToCurrentSpan
public io.opentelemetry.api.trace.SpanBuilder addSettingsAttributesToCurrentSpan(io.opentelemetry.api.trace.SpanBuilder spanBuilder) Applies the current Datastore instance settings as attributes to the current Span- Specified by:
addSettingsAttributesToCurrentSpanin interfaceTraceUtil
-
startSpan
Description copied from interface:TraceUtilStarts a new span with the given name, sets it as the current span, and returns it. -
startSpan
Description copied from interface:TraceUtilStarts a new span with the given name and the span represented by the parentSpan as its parent, sets it as the current span and returns it. -
getCurrentSpan
Description copied from interface:TraceUtilReturns the current span.- Specified by:
getCurrentSpanin interfaceTraceUtil
-
getCurrentContext
Description copied from interface:TraceUtilReturns the current Context.- Specified by:
getCurrentContextin interfaceTraceUtil
-
getTracer
public io.opentelemetry.api.trace.Tracer getTracer()Description copied from interface:TraceUtilReturns the current OpenTelemetry Tracer when OpenTelemetry SDK is provided.
-