Class SpanTracer

java.lang.Object
com.google.api.gax.tracing.SpanTracer
All Implemented Interfaces:
ApiTracer

@BetaApi @InternalApi public class SpanTracer extends Object implements ApiTracer
An implementation of ApiTracer that uses a TraceManager to record traces. This implementation is agnostic to the specific TraceManager in order to allow extensions that interact with other backends.
  • Field Details

  • Constructor Details

    • SpanTracer

      public SpanTracer(TraceManager traceManager, ApiTracerContext apiTracerContext, String attemptSpanName)
      Creates a new instance of SpanTracer.
      Parameters:
      traceManager - the TraceManager to use for recording spans
      attemptSpanName - the name of the individual attempt spans
  • Method Details

    • attemptStarted

      public void attemptStarted(Object request, int attemptNumber)
      Description copied from interface: ApiTracer
      Adds an annotation that an attempt is about to start with additional information from the request. In general this should occur at the very start of the operation. The attemptNumber is zero based. So the initial attempt will be 0.
      Specified by:
      attemptStarted in interface ApiTracer
      Parameters:
      request - request of this attempt.
      attemptNumber - the zero based sequential attempt number.
    • attemptSucceeded

      public void attemptSucceeded()
      Description copied from interface: ApiTracer
      Adds an annotation that the attempt succeeded.
      Specified by:
      attemptSucceeded in interface ApiTracer