Package reactor.netty

Class Metrics

java.lang.Object
reactor.netty.Metrics

public class Metrics extends Object
Constants and utilities around metrics.
Since:
0.9
Author:
Violeta Georgieva
  • Field Details

    • REGISTRY

      public static final MeterRegistry REGISTRY
    • OBSERVATION_KEY

      public static final String OBSERVATION_KEY
      See Also:
    • OBSERVATION_REGISTRY

      public static io.micrometer.observation.ObservationRegistry OBSERVATION_REGISTRY
    • HTTP_SERVER_PREFIX

      public static final String HTTP_SERVER_PREFIX
      Name prefix that will be used for the HTTP server's metrics registered in Micrometer's global registry.
      See Also:
    • HTTP_CLIENT_PREFIX

      public static final String HTTP_CLIENT_PREFIX
      Name prefix that will be used for the HTTP client's metrics registered in Micrometer's global registry.
      See Also:
    • TCP_SERVER_PREFIX

      public static final String TCP_SERVER_PREFIX
      Name prefix that will be used for the TCP server's metrics registered in Micrometer's global registry.
      See Also:
    • TCP_CLIENT_PREFIX

      public static final String TCP_CLIENT_PREFIX
      Name prefix that will be used for the TCP client's metrics registered in Micrometer's global registry.
      See Also:
    • UDP_SERVER_PREFIX

      public static final String UDP_SERVER_PREFIX
      Name prefix that will be used for the UDP server's metrics registered in Micrometer's global registry.
      See Also:
    • UDP_CLIENT_PREFIX

      public static final String UDP_CLIENT_PREFIX
      Name prefix that will be used for the UDP client's metrics registered in Micrometer's global registry.
      See Also:
    • EVENT_LOOP_PREFIX

      public static final String EVENT_LOOP_PREFIX
      Name prefix that will be used for Event Loop Group metrics registered in Micrometer's global registry.
      See Also:
    • CONNECTION_PROVIDER_PREFIX

      public static final String CONNECTION_PROVIDER_PREFIX
      Name prefix that will be used for the PooledConnectionProvider's metrics registered in Micrometer's global registry.
      See Also:
    • BYTE_BUF_ALLOCATOR_PREFIX

      public static final String BYTE_BUF_ALLOCATOR_PREFIX
      Name prefix that will be used for the ByteBufAllocator's metrics registered in Micrometer's global registry.
      See Also:
    • DATA_RECEIVED

      public static final String DATA_RECEIVED
      Amount of the data received, in bytes.
      See Also:
    • DATA_SENT

      public static final String DATA_SENT
      Amount of the data sent, in bytes.
      See Also:
    • ERRORS

      public static final String ERRORS
      Number of errors that occurred.
      See Also:
    • TLS_HANDSHAKE_TIME

      public static final String TLS_HANDSHAKE_TIME
      Time spent for TLS handshake.
      See Also:
    • CONNECT_TIME

      public static final String CONNECT_TIME
      Time spent for connecting to the remote address.
      See Also:
    • DATA_RECEIVED_TIME

      public static final String DATA_RECEIVED_TIME
      Time spent in consuming incoming data.
      See Also:
    • DATA_SENT_TIME

      public static final String DATA_SENT_TIME
      Time spent in sending outgoing data.
      See Also:
    • RESPONSE_TIME

      public static final String RESPONSE_TIME
      Total time for the request/response.
      See Also:
    • CONNECTIONS_TOTAL

      public static final String CONNECTIONS_TOTAL
      The number of all connections, whether they are active or idle.
      See Also:
    • CONNECTIONS_ACTIVE

      public static final String CONNECTIONS_ACTIVE
      The number of connections that are currently in use.
      See Also:
    • ADDRESS_RESOLVER

      public static final String ADDRESS_RESOLVER
      Time spent for resolving the address.
      See Also:
    • TOTAL_CONNECTIONS

      public static final String TOTAL_CONNECTIONS
      The number of all connections, active or idle.
      See Also:
    • ACTIVE_CONNECTIONS

      public static final String ACTIVE_CONNECTIONS
      The number of the connections that have been successfully acquired and are in active use.
      See Also:
    • MAX_CONNECTIONS

      public static final String MAX_CONNECTIONS
      The maximum number of active connections that are allowed.
      See Also:
    • IDLE_CONNECTIONS

      public static final String IDLE_CONNECTIONS
      The number of the idle connections.
      See Also:
    • PENDING_CONNECTIONS

      public static final String PENDING_CONNECTIONS
      The number of requests that are waiting for a connection.
      See Also:
    • MAX_PENDING_CONNECTIONS

      public static final String MAX_PENDING_CONNECTIONS
      The maximum number of requests that will be queued while waiting for a ready connection.
      See Also:
    • ACTIVE_STREAMS

      public static final String ACTIVE_STREAMS
      The number of the active HTTP/2 streams.
      See Also:
    • PENDING_STREAMS

      public static final String PENDING_STREAMS
      The number of requests that are waiting for opening HTTP/2 stream.
      See Also:
    • USED_HEAP_MEMORY

      public static final String USED_HEAP_MEMORY
      The number of bytes reserved by heap buffer allocator.
      See Also:
    • USED_DIRECT_MEMORY

      public static final String USED_DIRECT_MEMORY
      The number of bytes reserved by direct buffer allocator.
      See Also:
    • ACTIVE_HEAP_MEMORY

      public static final String ACTIVE_HEAP_MEMORY
      The actual bytes consumed by in-use buffers allocated from heap buffer pools.
      See Also:
    • ACTIVE_DIRECT_MEMORY

      public static final String ACTIVE_DIRECT_MEMORY
      The actual bytes consumed by in-use buffers allocated from direct buffer pools.
      See Also:
    • HEAP_ARENAS

      public static final String HEAP_ARENAS
      The number of heap arenas.
      See Also:
    • DIRECT_ARENAS

      public static final String DIRECT_ARENAS
      The number of direct arenas.
      See Also:
    • THREAD_LOCAL_CACHES

      public static final String THREAD_LOCAL_CACHES
      The number of thread local caches.
      See Also:
    • SMALL_CACHE_SIZE

      public static final String SMALL_CACHE_SIZE
      The size of the small cache.
      See Also:
    • NORMAL_CACHE_SIZE

      public static final String NORMAL_CACHE_SIZE
      The size of the normal cache.
      See Also:
    • CHUNK_SIZE

      public static final String CHUNK_SIZE
      The chunk size for an arena.
      See Also:
    • PENDING_TASKS

      public static final String PENDING_TASKS
      The number of tasks that are pending for processing on an event loop.
      See Also:
    • STREAMS_ACTIVE

      public static final String STREAMS_ACTIVE
      The number of active HTTP/2 streams.
      See Also:
    • LOCAL_ADDRESS

      public static final String LOCAL_ADDRESS
      See Also:
    • PROXY_ADDRESS

      public static final String PROXY_ADDRESS
      See Also:
    • REMOTE_ADDRESS

      public static final String REMOTE_ADDRESS
      See Also:
    • URI

      public static final String URI
      See Also:
    • STATUS

      public static final String STATUS
      See Also:
    • METHOD

      public static final String METHOD
      See Also:
    • ID

      public static final String ID
      See Also:
    • NAME

      public static final String NAME
      See Also:
    • TYPE

      public static final String TYPE
      See Also:
    • SUCCESS

      public static final String SUCCESS
      See Also:
    • ERROR

      public static final String ERROR
      See Also:
    • UNKNOWN

      public static final String UNKNOWN
      See Also:
    • NA

      public static final String NA
      See Also:
  • Constructor Details

    • Metrics

      public Metrics()
  • Method Details

    • currentObservation

      @Nullable public static io.micrometer.observation.Observation currentObservation(ContextView contextView)
    • formatSocketAddress

      @Nullable public static String formatSocketAddress(@Nullable SocketAddress socketAddress)
    • observationRegistry

      public static io.micrometer.observation.ObservationRegistry observationRegistry(io.micrometer.observation.ObservationRegistry observationRegistry)
      Set the ObservationRegistry to use in Reactor Netty for tracing related purposes.
      Returns:
      the previously configured registry.
      Since:
      1.1.6
    • updateContext

      public static Context updateContext(Context context, Object observation)
    • updateChannelContext

      @Nullable public static ContextView updateChannelContext(Channel channel, io.micrometer.observation.Observation observation)
      Updates the ContextView in the channel attributes with this Observation. When there is already Observation in the ContextView, then is will be set as a parent to this Observation.
      Parameters:
      channel - the channel
      observation - the Observation
      Returns:
      the previous Observation when exists otherwise null
      Since:
      1.1.1