Interface ApiTracer (2.72.2)

publicinterfaceApiTracer

Methods

attemptCancelled()

publicdefaultvoidattemptCancelled()

Add an annotation that the attempt was cancelled by the user.

attemptFailed(Throwable error, Duration delay)

publicdefaultvoidattemptFailed(Throwableerror,Durationdelay)
Parameters
NameDescription
errorThrowable
delayorg.threeten.bp.Duration

attemptFailedDuration(Throwable error, Duration delay)

publicdefaultvoidattemptFailedDuration(Throwableerror,Durationdelay)

Adds an annotation that the attempt failed, but another attempt will be made after the delay.

Parameters
NameDescription
errorThrowable

the transient error that caused the attempt to fail.

delayDuration

the amount of time to wait before the next attempt will start.

attemptFailedRetriesExhausted(Throwable error)

publicdefaultvoidattemptFailedRetriesExhausted(Throwableerror)

Adds an annotation that the attempt failed and that no further attempts will be made because retry limits have been reached.

Parameter
NameDescription
errorThrowable

the last error received before retries were exhausted.

attemptPermanentFailure(Throwable error)

publicdefaultvoidattemptPermanentFailure(Throwableerror)

Adds an annotation that the attempt failed and that no further attempts will be made because the last error was not retryable.

Parameter
NameDescription
errorThrowable

the error that caused the final attempt to fail.

attemptStarted(int attemptNumber) (deprecated)

publicdefaultvoidattemptStarted(intattemptNumber)

Deprecated.Please use#attemptStarted(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.

Parameter
NameDescription
attemptNumberint

the zero based sequential attempt number.

attemptStarted(Object request, int attemptNumber)

publicdefaultvoidattemptStarted(Objectrequest,intattemptNumber)

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
NameDescription
requestObject

request of this attempt.

attemptNumberint

the zero based sequential attempt number.

attemptSucceeded()

publicdefaultvoidattemptSucceeded()

Adds an annotation that the attempt succeeded.

batchRequestSent(long elementCount, long requestSize)

publicdefaultvoidbatchRequestSent(longelementCount,longrequestSize)

Adds an annotation that a batch of writes has been flushed.

Parameters
NameDescription
elementCountlong

the number of elements in the batch.

requestSizelong

the size of the batch in bytes.

connectionSelected(String id)

publicdefaultvoidconnectionSelected(Stringid)

Annotates the operation with selected connection id from theChannelPool.

Parameter
NameDescription
idString

the local connection identifier of the selected connection.

inScope()

publicdefaultApiTracer.ScopeinScope()

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.

Returns
TypeDescription
ApiTracer.Scope

lroStartFailed(Throwable error)

publicdefaultvoidlroStartFailed(Throwableerror)

Signals that the initial RPC for the long running operation failed.

Parameter
NameDescription
errorThrowable

the error that caused the long running operation fail.

lroStartSucceeded()

publicdefaultvoidlroStartSucceeded()

Signals that the initial RPC successfully started the long running operation. The long running operation will now be polled for completion.

operationCancelled()

publicdefaultvoidoperationCancelled()

Signals that the operation was cancelled by the user. The tracer is now considered closed and should no longer be used.

operationFailed(Throwable error)

publicdefaultvoidoperationFailed(Throwableerror)

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.

Parameter
NameDescription
errorThrowable

the final error that caused the operation to fail.

operationSucceeded()

publicdefaultvoidoperationSucceeded()

Signals that the overall operation has finished successfully. The tracer is now considered closed and should no longer be used.

requestSent()

publicdefaultvoidrequestSent()

Adds an annotation that a streaming request has been sent.

responseReceived()

publicdefaultvoidresponseReceived()

Adds an annotation that a streaming response has been received.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-17 UTC.