Class HttpMetric


  • public final class HttpMetric
    extends Object
    Metrics collected by HTTP clients for HTTP/1 and HTTP/2 operations. See Http2Metric for metrics that are only available on HTTP/2 operations.
    • Field Detail

      • HTTP_CLIENT_NAME

        public static final SdkMetric<String> HTTP_CLIENT_NAME
        The name of the HTTP client.
      • MAX_CONCURRENCY

        public static final SdkMetric<Integer> MAX_CONCURRENCY
        The maximum number of concurrent requests that is supported by the HTTP client.

        For HTTP/1 operations, this is equal to the maximum number of TCP connections that can be be pooled by the HTTP client. For HTTP/2 operations, this is equal to the maximum number of streams that can be pooled by the HTTP client.

        Note: Depending on the HTTP client, this is either a value for all endpoints served by the HTTP client, or a value that applies only to the specific endpoint/host used in the request. For 'apache-http-client', this value is for the entire HTTP client. For 'netty-nio-client', this value is per-endpoint. In all cases, this value is scoped to an individual HTTP client instance, and does not include concurrency that may be available in other HTTP clients running within the same JVM.

      • AVAILABLE_CONCURRENCY

        public static final SdkMetric<Integer> AVAILABLE_CONCURRENCY
        The number of additional concurrent requests that can be supported by the HTTP client without needing to establish additional connections to the target server.

        For HTTP/1 operations, this is equal to the number of TCP connections that have been established with the service, but are currently idle/unused. For HTTP/2 operations, this is equal to the number of streams that are currently idle/unused.

        Note: Depending on the HTTP client, this is either a value for all endpoints served by the HTTP client, or a value that applies only to the specific endpoint/host used in the request. For 'apache-http-client', this value is for the entire HTTP client. For 'netty-nio-client', this value is per-endpoint. In all cases, this value is scoped to an individual HTTP client instance, and does not include concurrency that may be available in other HTTP clients running within the same JVM.

      • LEASED_CONCURRENCY

        public static final SdkMetric<Integer> LEASED_CONCURRENCY
        The number of requests that are currently being executed by the HTTP client.

        For HTTP/1 operations, this is equal to the number of TCP connections currently in active communication with the service (excluding idle connections). For HTTP/2 operations, this is equal to the number of HTTP streams currently in active communication with the service (excluding idle stream capacity).

        Note: Depending on the HTTP client, this is either a value for all endpoints served by the HTTP client, or a value that applies only to the specific endpoint/host used in the request. For 'apache-http-client', this value is for the entire HTTP client. For 'netty-nio-client', this value is per-endpoint. In all cases, this value is scoped to an individual HTTP client instance, and does not include concurrency that may be available in other HTTP clients running within the same JVM.

      • PENDING_CONCURRENCY_ACQUIRES

        public static final SdkMetric<Integer> PENDING_CONCURRENCY_ACQUIRES
        The number of requests that are awaiting concurrency to be made available from the HTTP client.

        For HTTP/1 operations, this is equal to the number of requests currently blocked, waiting for a TCP connection to be established or returned from the connection pool. For HTTP/2 operations, this is equal to the number of requests currently blocked, waiting for a new stream (and possibly a new HTTP/2 connection) from the connection pool.

        Note: Depending on the HTTP client, this is either a value for all endpoints served by the HTTP client, or a value that applies only to the specific endpoint/host used in the request. For 'apache-http-client', this value is for the entire HTTP client. For 'netty-nio-client', this value is per-endpoint. In all cases, this value is scoped to an individual HTTP client instance, and does not include concurrency that may be available in other HTTP clients running within the same JVM.

      • HTTP_STATUS_CODE

        public static final SdkMetric<Integer> HTTP_STATUS_CODE
        The status code of the HTTP response.

        This is reported by the SDK core, and should not be reported by an individual HTTP client implementation.

      • CONCURRENCY_ACQUIRE_DURATION

        public static final SdkMetric<Duration> CONCURRENCY_ACQUIRE_DURATION
        The time taken to acquire a channel from the connection pool.

        For HTTP/1 operations, a channel is equivalent to a TCP connection. For HTTP/2 operations, a channel is equivalent to an HTTP/2 stream channel. For both protocols, the time to acquire a new channel may include the following:

        1. Awaiting a concurrency permit, as restricted by the client's max concurrency configuration.
        2. The time to establish a new connection, depending on whether an existing connection is available in the pool or not.
        3. The time taken to perform a TLS handshake/negotiation, if TLS is enabled.