@InternalApi(value="For internal use by google-cloud-java clients only")
public interface ApiTracer
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.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
ApiTracer.Scope
A context class to be used with
inScope() and a try-with-resources block. |
| Modifier and Type | Method and Description |
|---|---|
void |
attemptCancelled()
Add an annotation that the attempt was cancelled by the user.
|
void |
attemptFailed(Throwable error,
org.threeten.bp.Duration delay)
Adds an annotation that the attempt failed, but another attempt will be made after the delay.
|
void |
attemptFailedRetriesExhausted(Throwable error)
Adds an annotation that the attempt failed and that no further attempts will be made because
retry limits have been reached.
|
void |
attemptPermanentFailure(Throwable error)
Adds an annotation that the attempt failed and that no further attempts will be made because
the last error was not retryable.
|
void |
attemptStarted(int attemptNumber)
Adds an annotation that an attempt is about to start.
|
void |
attemptSucceeded()
Adds an annotation that the attempt succeeded.
|
void |
batchRequestSent(long elementCount,
long requestSize)
Adds an annotation that a batch of writes has been flushed.
|
void |
connectionSelected(String id)
Annotates the operation with selected connection id from the
ChannelPool. |
ApiTracer.Scope |
inScope()
Asks the underlying implementation to install itself as a thread local.
|
void |
lroStartFailed(Throwable error)
Signals that the initial RPC for the long running operation failed.
|
void |
lroStartSucceeded()
Signals that the initial RPC successfully started the long running operation.
|
void |
operationCancelled()
Signals that the operation was cancelled by the user.
|
void |
operationFailed(Throwable error)
Signals that the overall operation has failed and no further attempts will be made.
|
void |
operationSucceeded()
Signals that the overall operation has finished successfully.
|
void |
requestSent()
Adds an annotation that a streaming request has been sent.
|
void |
responseReceived()
Adds an annotation that a streaming response has been received.
|
ApiTracer.Scope inScope()
void operationSucceeded()
void operationCancelled()
void operationFailed(Throwable error)
error - the final error that caused the operation to fail.void connectionSelected(String id)
ChannelPool.id - the local connection identifier of the selected connection.void attemptStarted(int attemptNumber)
attemptNumber - the zero based sequential attempt number.void attemptSucceeded()
void attemptCancelled()
void attemptFailed(Throwable error, org.threeten.bp.Duration delay)
error - the transient error that caused the attempt to fail.delay - the amount of time to wait before the next attempt will start.void attemptFailedRetriesExhausted(Throwable error)
error - the last error received before retries were exhausted.void attemptPermanentFailure(Throwable error)
error - the error that caused the final attempt to fail.void lroStartFailed(Throwable error)
error - the error that caused the long running operation fail.void lroStartSucceeded()
void responseReceived()
void requestSent()
void batchRequestSent(long elementCount,
long requestSize)
elementCount - the number of elements in the batch.requestSize - the size of the batch in bytes.