Package com.google.api.gax.tracing (2.8.1) Stay organized with collections Save and categorize content based on your preferences.
- 2.72.2 (latest)
- 2.72.1
- 2.71.0
- 2.70.3
- 2.69.0
- 2.68.2
- 2.67.0
- 2.66.0
- 2.65.0
- 2.63.1
- 2.62.0
- 2.61.0
- 2.60.0
- 2.59.1
- 2.58.0
- 2.57.0
- 2.55.0
- 2.54.1
- 2.53.0
- 2.52.0
- 2.51.0
- 2.50.0
- 2.49.0
- 2.48.1
- 2.47.0
- 2.46.1
- 2.45.0
- 2.43.0
- 2.42.0
- 2.41.0
- 2.39.0
- 2.38.0
- 2.37.0
- 2.36.0
- 2.35.0
- 2.34.1
- 2.33.0
- 2.32.1
- 2.31.1
- 2.30.1
- 2.24.0
- 2.23.3
- 2.22.0
- 2.21.0
- 2.20.1
- 2.19.6
- 2.18.7
- 2.17.0
- 2.16.0
- 2.15.0
- 2.14.0
- 2.13.0
- 2.12.2
- 2.11.0
- 2.10.0
- 2.9.0
- 2.8.1
- 2.7.1
Classes
BaseApiTracer
A base implementation ofApiTracer that does nothing.
For internal use only.
BaseApiTracerFactory
Base factory that will buildApiTracers that do nothing.
For internal use only.
OpencensusTracer
Implementation ofApiTracer that uses OpenCensus.
This implementation wraps an OpenCensusSpan for every tracer and annotates thatSpan with various events throughout the lifecycle of the logical operation.
Each span will be namedClientName.MethodName and will have the following attributes:
attempt count- The Number of attempts sent before the logical operation completed
status- The status code of the last attempt
total response count- The number of messages received across all of the attempts. This will only be set for server streaming and bidi RPCs.
total request count- The number of messages sent across all of the attempts. This will only be set for client streaming and bidi RPCs.
batch count- For batch requests, the number of elements in the request.
batch size- For batch requests, the byte size of the request.
The spans will contain the following annotations:
Attempt cancelledwith the following attributes:attempt- Zero based sequential attempt number
attempt request count- The number of requests sent in this attempt. This will only be set for client streaming and bidi RPCs.
attempt response count- The number of responses received in this attempt. This will only be set for server streaming and bidi RPCs.
connection- The UUID of the connection which the attempt was sent.
Attempt failed, scheduling next attemptwith the following attributes:attempt- Zero based sequential attempt number
status- The status code of the failed attempt
delay- The number of milliseconds to wait before trying again
attempt request count- The number of requests sent in this attempt. This will only be set for client streaming and bidi RPCs.
attempt response count- The number of responses received in this attempt. This will only be set for server streaming and bidi RPCs.
connection- The UUID of the connection which the attempt was sent.
Attempts exhaustedwith the following attributes:attempt- Zero based sequential attempt number
status- The status code of the failed attempt
attempt request count- The number of requests sent in this attempt. This will only be set for client streaming and bidi RPCs.
attempt response count- The number of responses received in this attempt. This will only be set for server streaming and bidi RPCs.
connection- The UUID of the connection which the attempt was sent.
Attempt failed, error not retryablewith the following attributes:attempt- Zero based sequential attempt number
status- The status code of the failed attempt
attempt request count- The number of requests sent in this attempt. This will only be set for client streaming and bidi RPCs.
attempt response count- The number of responses received in this attempt. This will only be set for server streaming and bidi RPCs.
connection- The UUID of the connection which the attempt was sent.
Attempt succeededwith the following attributes:attempt- Zero based sequential attempt number
attempt request count- The number of requests sent in this attempt. This will only be set for client streaming and bidi RPCs.
attempt response count- The number of responses received in this attempt. This will only be set for server streaming and bidi RPCs.
connection- The UUID of the connection which the attempt was sent.
Long running operations, which are composed of an initial RPC to start the operation and a number of polling RPCs will be represented as a tree of spans. The top level span will be named after the initial RPC name suffixed with "Operation" and will have the following annotations:
Operation startedOperation failed to startwith the following attributes:status- The status code of why the operation failed to start
Polling was cancelledwith the following attributes:attempt- Zero based sequential poll number.
attempt request count
Scheduling next pollwith the following attributes:attempt- Zero based sequential poll number
status- OK if the poll succeeded, but the operation is still running.
delay- The number of milliseconds to wait before polling again
Polling attempts exhaustedwith the following attributes:attempt- Zero based sequential poll number
status- OK if the poll succeeded, but the operation is still running.
Polling failedwith the following attributes:attempt- Zero based sequential poll number
status- OK if the poll succeeded, but the operation is still running.
Polling completedwith the following attributes:attempt- Zero based sequential poll number
The toplevel long running operation span will also contain child spans to describe the retry attempts for the initial RPC and each poll as described in the general span section above.
This class is thread compatible. It expects callers to follow grpc's threading model: there is only one thread that invokes the operation* and attempt* methods. Please seecom.google.api.gax.rpc.ApiStreamObserver for more information.
OpencensusTracerFactory
AApiTracerFactory to build instances ofOpencensusTracer.
This class wraps theTracer provided by Opencensus inTracing.getTracer(). It will be used to create new spans and wrap them inOpencensusTracer defined in gax.
This class is thread safe.
SpanName
A value class to represent the name of the operation in anApiTracer.
TracedBatchingCallable<RequestT,ResponseT>
This callable wraps a batching callable chain in aApiTracer.
For internal use only.
TracedBidiCallable<RequestT,ResponseT>
A wrapper callable that will wrap a callable chain in a trace.
For internal use only.
TracedClientStreamingCallable<RequestT,ResponseT>
A wrapper callable that will wrap a callable chain in a trace.
This can be safely called from multiple threads. However the requestApiStreamObserver can only be used from a single thread.
For internal use only.
TracedOperationCallable<RequestT,ResponseT,MetadataT>
This callable wraps aOperationCallable in aApiTracer.
For internal use only.
TracedOperationInitialCallable<RequestT>
Traces the initial RPC of a long running operation.
It will trace it like a child unary RPC and will also contribute to the parent tracer (created byTracedOperationCallable) the result of the call.
TracedServerStreamingCallable<RequestT,ResponseT>
A wrapper callable that will wrap a callable chain in a trace.
For internal use only.
TracedUnaryCallable<RequestT,ResponseT>
This callable wraps a callable chain in aApiTracer.
For internal use only.
Interfaces
ApiTracer
Implementations 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 extendBaseApiTracer.
ApiTracer.Scope
A context class to be used with#inScope() and a try-with-resources block. Closing aScope removes any context that the underlying implementation might've set in#inScope().
ApiTracerFactory
A factory to create new instances ofApiTracers.
In general a single instance of anApiTracer will correspond to a single logical operation.
For internal use only. google-cloud-java libraries should extendBaseApiTracerFactory.
Enums
ApiTracerFactory.OperationType
The type of operation theApiTracer is tracing.
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.