Class EnabledTraceUtil

java.lang.Object
com.google.cloud.firestore.telemetry.EnabledTraceUtil
All Implemented Interfaces:
TraceUtil

@InternalApi public class EnabledTraceUtil extends Object implements TraceUtil
A utility class that uses OpenTelemetry for trace collection. `FirestoreOpenTelemetryOptions` in `FirestoreOptions` can be used to configure its behavior.
  • 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: TraceUtil
      Returns a channel configurator for gRPC, or null if tracing is disabled.
      Specified by:
      getChannelConfigurator in interface TraceUtil
    • startSpan

      public com.google.cloud.firestore.telemetry.EnabledTraceUtil.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.Context parent)
      Description copied from interface: TraceUtil
      Starts a new span with the given name and the given context as its parent, sets it as the current span, and returns it.
      Specified by:
      startSpan in interface TraceUtil
    • currentSpan

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

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