Package com.google.api.gax.tracing
Interface ApiTracer
-
- All Known Implementing Classes:
BaseApiTracer,OpencensusTracer
@InternalApi public interface ApiTracerImplementations of this class trace the logical flow of a google cloud client.A single instance of a tracer represents a logical operation that can be annotated throughout its lifecycle. Constructing an instance of a subclass will implicitly signal the start of a new operation.
For internal use only. google-cloud-java libraries should extend
BaseApiTracer.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceApiTracer.ScopeA context class to be used withinScope()and a try-with-resources block.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidattemptCancelled()Add an annotation that the attempt was cancelled by the user.voidattemptFailed(java.lang.Throwable error, org.threeten.bp.Duration delay)Adds an annotation that the attempt failed, but another attempt will be made after the delay.voidattemptFailedRetriesExhausted(java.lang.Throwable error)Adds an annotation that the attempt failed and that no further attempts will be made because retry limits have been reached.voidattemptPermanentFailure(java.lang.Throwable error)Adds an annotation that the attempt failed and that no further attempts will be made because the last error was not retryable.voidattemptStarted(int attemptNumber)Deprecated.Please useattemptStarted(Object, int)instead.voidattemptStarted(java.lang.Object request, int attemptNumber)Adds an annotation that an attempt is about to start with additional information from the request.voidattemptSucceeded()Adds an annotation that the attempt succeeded.voidbatchRequestSent(long elementCount, long requestSize)Adds an annotation that a batch of writes has been flushed.voidconnectionSelected(java.lang.String id)Annotates the operation with selected connection id from theChannelPool.ApiTracer.ScopeinScope()Asks the underlying implementation to install itself as a thread local.voidlroStartFailed(java.lang.Throwable error)Signals that the initial RPC for the long running operation failed.voidlroStartSucceeded()Signals that the initial RPC successfully started the long running operation.voidoperationCancelled()Signals that the operation was cancelled by the user.voidoperationFailed(java.lang.Throwable error)Signals that the overall operation has failed and no further attempts will be made.voidoperationSucceeded()Signals that the overall operation has finished successfully.voidrequestSent()Adds an annotation that a streaming request has been sent.voidresponseReceived()Adds an annotation that a streaming response has been received.
-
-
-
Method Detail
-
inScope
ApiTracer.Scope inScope()
Asks the underlying implementation to install itself as a thread local. This allows for interop between clients using gax and external resources to share the same implementation of the tracing. For example OpenCensus will install a thread local that can read by the GRPC.
-
operationSucceeded
void operationSucceeded()
Signals that the overall operation has finished successfully. The tracer is now considered closed and should no longer be used.
-
operationCancelled
void operationCancelled()
Signals that the operation was cancelled by the user. The tracer is now considered closed and should no longer be used.
-
operationFailed
void operationFailed(java.lang.Throwable error)
Signals that the overall operation has failed and no further attempts will be made. The tracer is now considered closed and should no longer be used.- Parameters:
error- the final error that caused the operation to fail.
-
connectionSelected
void connectionSelected(java.lang.String id)
Annotates the operation with selected connection id from theChannelPool.- Parameters:
id- the local connection identifier of the selected connection.
-
attemptStarted
@Deprecated void attemptStarted(int attemptNumber)
Deprecated.Please useattemptStarted(Object, int)instead.Adds an annotation that an attempt is about to start. In general this should occur at the very start of the operation. The attemptNumber is zero based. So the initial attempt will be 0.- Parameters:
attemptNumber- the zero based sequential attempt number.
-
attemptStarted
void attemptStarted(java.lang.Object request, int attemptNumber)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.- Parameters:
attemptNumber- the zero based sequential attempt number.request- request of this attempt.
-
attemptSucceeded
void attemptSucceeded()
Adds an annotation that the attempt succeeded.
-
attemptCancelled
void attemptCancelled()
Add an annotation that the attempt was cancelled by the user.
-
attemptFailed
void attemptFailed(java.lang.Throwable error, org.threeten.bp.Duration delay)Adds an annotation that the attempt failed, but another attempt will be made after the delay.- Parameters:
error- the transient error that caused the attempt to fail.delay- the amount of time to wait before the next attempt will start.
-
attemptFailedRetriesExhausted
void attemptFailedRetriesExhausted(java.lang.Throwable error)
Adds an annotation that the attempt failed and that no further attempts will be made because retry limits have been reached.- Parameters:
error- the last error received before retries were exhausted.
-
attemptPermanentFailure
void attemptPermanentFailure(java.lang.Throwable error)
Adds an annotation that the attempt failed and that no further attempts will be made because the last error was not retryable.- Parameters:
error- the error that caused the final attempt to fail.
-
lroStartFailed
void lroStartFailed(java.lang.Throwable error)
Signals that the initial RPC for the long running operation failed.- Parameters:
error- the error that caused the long running operation fail.
-
lroStartSucceeded
void lroStartSucceeded()
Signals that the initial RPC successfully started the long running operation. The long running operation will now be polled for completion.
-
responseReceived
void responseReceived()
Adds an annotation that a streaming response has been received.
-
requestSent
void requestSent()
Adds an annotation that a streaming request has been sent.
-
batchRequestSent
void batchRequestSent(long elementCount, long requestSize)Adds an annotation that a batch of writes has been flushed.- Parameters:
elementCount- the number of elements in the batch.requestSize- the size of the batch in bytes.
-
-