AWS SDK for Java 2.x: Comprehensive Metrics Reference - AWS SDK for Java 2.x

AWS SDK for Java 2.x: Comprehensive Metrics Reference

With the AWS SDK for Java 2.x, you can collect metrics from the service clients in your application and then publish (output) those metrics to Amazon CloudWatch.

These tables list the metrics that you can collect and any HTTP client usage requirement.

For more information about enabling and configuring metrics for the SDK, see Enabling SDK metrics.

Metrics collected with each request

Metric name Description Type

ApiCallDuration

The duration of the API call. This includes all call attempts made.

Duration*

ApiCallSuccessful

True if the API call succeeded, false otherwise.

Boolean

CredentialsFetchDuration

The duration of time to fetch signing credentials for the API call.

Duration*

EndpointResolveDuration The duration of time to resolve the endpoint used for the API call. Duration*

MarshallingDuration

The duration of time to marshall the SDK request to an HTTP request.

Duration*

OperationName

The name of the service operation being invoked.

String

RetryCount

The number of retries that the SDK performed in the execution of the request. 0 implies that the request worked the first time and that no retries were attempted.

For more information about configuring retry behavior, see Retry strategies.

Integer

ServiceId

The unique ID for the service.

String

ServiceEndpoint

The endpoint for the service.

URI

TokenFetchDuration

The duration of time to fetch signing credentials for the API call. Duration*

*java.time.Duration.

Metrics collected for each request attempt

Each API call might require multiple attempts before a response is received. These metrics are collected for each attempt.

Core metrics

Metric name Description Type

AwsExtendedRequestId

The extended request ID of the service request.

String

AwsRequestId

The request ID of the service request.

String

BackoffDelayDuration

The duration of time that the SDK has waited before this API call attempt. The value is based on the BackoffStrategy set on the client. See the Retry strategies section in this guide for more information.

Duration*

ErrorType

The type of error that occurred for a call attempt.

The following are possible values:

  • Throttling: The service responded with a throttling error.

  • ServerError: The service responded with an error other than throttling.

  • ConfiguredTimeout: A client timeout occurred, either at the API call level, or API call attempt level.

  • IO: An I/O error occurred.

  • Other: Catch-all for other errors that don't fall into one of categories list above.

String
ReadThroughput

The read throughput of the client, defined as NumberOfResponseBytesRead / (TTLB - TTFB). This value is in bytes per second.

Note that this metric only measures the bytes read from within the ResponseTransformer or AsyncResponseTransformer. Data that is read outside the transformer—for example when the response stream is returned as the result of the transformer—is not included in the calculation.

Double

ServiceCallDuration

The duration of time to connect to the service (or acquire a connection from the connection pool), send the serialized request and receive the initial response (for example HTTP status code and headers). This DOES NOT include the time to read the entire response from the service.

Duration*

SigningDuration

The duration of time to sign the HTTP request.

Duration*

TimeToFirstByte The duration of time from sending the HTTP request (including acquiring a connection) to the service, and receiving the first byte of the headers in the response. Duration*
TimeToLastByte

The duration of time from sending the HTTP request (including acquiring a connection) to the service, and receiving the last byte of the response.

Note that for APIs that return streaming responses, this metric spans the time until the ResponseTransformer or AsyncResponseTransformer completes.

Duration*

UnmarshallingDuration

The duration of time to unmarshall the HTTP response to an SDK response.

Note: For streaming operations, this does not include the time to read the response payload.

Duration*

*java.time.Duration.

HTTP Metrics

Metric name Description Type HTTP client required*

AvailableConcurrency

The number of additional concurrent requests that the HTTP client supports without establishing new connections to the target server.

For HTTP/1 operations, this equals the number of idle TCP connections established with the service. For HTTP/2 operations, this equals the number of idle streams.

Note: This value varies by HTTP client implementation:

  • Apache client: Value applies to the entire HTTP client

  • Netty client: Value applies per endpoint

  • AWS CRT-based client: Value applies per endpoint

The value is scoped to an individual HTTP client instance and excludes concurrency from other HTTP clients in the same JVM.

Integer

Apache, Netty, CRT

ConcurrencyAcquireDuration

The duration of time to acquire a channel from the connection pool.

For HTTP/1 operations, a channel equals a TCP connection. For HTTP/2 operations, a channel equals an HTTP/2 stream channel.

Acquiring a new channel may include time for:

  1. Awaiting a concurrency permit, as restricted by the client's max concurrency configuration.

  2. Establishing a new connection, if no existing connection is available in the pool.

  3. Performing the TLS handshake and negotiation, if TLS is enabled.

Duration*

Apache, Netty, CRT

HttpClientName

The name of the HTTP used for the request.

String

Apache, Netty, CRT

HttpStatusCode

The status code of the HTTP response.

Integer

Any

LeasedConcurrency

The number of requests that the HTTP client currently executes.

For HTTP/1 operations, this equals the number of active TCP connections with the service (excluding idle connections). For HTTP/2 operations, this equals the number of active HTTP streams with the service (excluding idle stream capacity).

Note: This value varies by HTTP client implementation:

  • Apache client: Value applies to the entire HTTP client

  • Netty client: Value applies per endpoint

  • AWS CRT-based client: Value applies per endpoint

The value is scoped to an individual HTTP client instance and excludes concurrency from other HTTP clients in the same JVM.

Integer

Apache, Netty, CRT

LocalStreamWindowSize

The local HTTP/2 window size in bytes for the stream that executes this request.

Integer

Netty

MaxConcurrency

The maximum number of concurrent requests that the HTTP client supports.

For HTTP/1 operations, this equals the maximum number of TCP connections that the HTTP client can pool. For HTTP/2 operations, this equals the maximum number of streams that the HTTP client can pool.

Note: This value varies by HTTP client implementation:

  • Apache client: Value applies to the entire HTTP client

  • Netty client: Value applies per endpoint

  • AWS CRT-based client: Value applies per endpoint

The value is scoped to an individual HTTP client instance and excludes concurrency from other HTTP clients in the same JVM.

Integer

Apache, Netty, CRT

PendingConcurrencyAcquires

The number of requests that wait for concurrency from the HTTP client.

For HTTP/1 operations, this equals the number of requests waiting for a TCP connection to establish or return from the connection pool. For HTTP/2 operations, this equals the number of requests waiting for a new stream (and possibly a new HTTP/2 connection) from the connection pool.

Note: This value varies by HTTP client implementation:

  • Apache client: Value applies to the entire HTTP client

  • Netty client: Value applies per endpoint

  • AWS CRT-based client: Value applies per endpoint

The value is scoped to an individual HTTP client instance and excludes concurrency from other HTTP clients in the same JVM.

Integer

Apache, Netty, CRT

RemoteStreamWindowSize

The remote HTTP/2 window size in bytes for the stream that executes this request.

Integer

Netty

*java.time.Duration.

The terms used in the column mean: