Class DisabledTraceUtil

java.lang.Object
com.google.cloud.datastore.telemetry.DisabledTraceUtil
All Implemented Interfaces:
TraceUtil

@InternalApi public class DisabledTraceUtil extends Object implements TraceUtil
Tracing utility implementation, used to stub out tracing instrumentation when tracing is disabled.
  • Constructor Details

    • DisabledTraceUtil

      public DisabledTraceUtil()
  • Method Details

    • getChannelConfigurator

      @Nullable public com.google.api.core.ApiFunction<io.grpc.ManagedChannelBuilder,io.grpc.ManagedChannelBuilder> getChannelConfigurator()
      Description copied from interface: TraceUtil
      Returns a channel configurator for gRPC, or null if tracing is disabled.
      Specified by:
      getChannelConfigurator in interface TraceUtil
    • startSpan

      public com.google.cloud.datastore.telemetry.DisabledTraceUtil.Span startSpan(String spanName)
      Description copied from interface: TraceUtil
      Starts a new span with the given name, sets it as the current span, and returns it.
      Specified by:
      startSpan in interface TraceUtil
    • startSpan

      public TraceUtil.Span startSpan(String spanName, TraceUtil.Span parentSpan)
      Description copied from interface: TraceUtil
      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.
      Specified by:
      startSpan in interface TraceUtil
    • addSettingsAttributesToCurrentSpan

      public io.opentelemetry.api.trace.SpanBuilder addSettingsAttributesToCurrentSpan(io.opentelemetry.api.trace.SpanBuilder spanBuilder)
      Description copied from interface: TraceUtil
      Adds common SpanAttributes to the current span, useful when hand-creating a new Span without using the TraceUtil.Span interface.
      Specified by:
      addSettingsAttributesToCurrentSpan in interface TraceUtil
    • getCurrentSpan

      @Nonnull public TraceUtil.Span getCurrentSpan()
      Description copied from interface: TraceUtil
      Returns the current span.
      Specified by:
      getCurrentSpan in interface TraceUtil
    • getCurrentContext

      @Nonnull public TraceUtil.Context getCurrentContext()
      Description copied from interface: TraceUtil
      Returns the current Context.
      Specified by:
      getCurrentContext in interface TraceUtil
    • getTracer

      public io.opentelemetry.api.trace.Tracer getTracer()
      Description copied from interface: TraceUtil
      Returns the current OpenTelemetry Tracer when OpenTelemetry SDK is provided.
      Specified by:
      getTracer in interface TraceUtil