Class MicrometerChannelMetricsRecorder

java.lang.Object
reactor.netty.channel.MicrometerChannelMetricsRecorder
All Implemented Interfaces:
ChannelMetricsRecorder
Direct Known Subclasses:
MicrometerHttpMetricsRecorder

public class MicrometerChannelMetricsRecorder extends Object implements ChannelMetricsRecorder
A ChannelMetricsRecorder implementation for integration with Micrometer.
Since:
0.9
Author:
Violeta Georgieva
  • Constructor Details

    • MicrometerChannelMetricsRecorder

      public MicrometerChannelMetricsRecorder(String name, String protocol)
    • MicrometerChannelMetricsRecorder

      public MicrometerChannelMetricsRecorder(String name, String protocol, boolean onServer)
  • Method Details

    • recordDataReceived

      public void recordDataReceived(SocketAddress remoteAddress, long bytes)
      Description copied from interface: ChannelMetricsRecorder
      Records the amount of the data that is received, in bytes.
      Specified by:
      recordDataReceived in interface ChannelMetricsRecorder
      Parameters:
      remoteAddress - The remote peer
      bytes - The amount of the data that is received, in bytes
    • recordDataReceived

      public void recordDataReceived(SocketAddress remoteAddress, SocketAddress proxyAddress, long bytes)
      Description copied from interface: ChannelMetricsRecorder
      Records the amount of the data that is received, in bytes.
      Specified by:
      recordDataReceived in interface ChannelMetricsRecorder
      Parameters:
      remoteAddress - The remote peer
      proxyAddress - The proxy address
      bytes - The amount of the data that is received, in bytes
    • recordDataSent

      public void recordDataSent(SocketAddress remoteAddress, long bytes)
      Description copied from interface: ChannelMetricsRecorder
      Records the amount of the data that is sent, in bytes.
      Specified by:
      recordDataSent in interface ChannelMetricsRecorder
      Parameters:
      remoteAddress - The remote peer
      bytes - The amount of the data that is sent, in bytes
    • recordDataSent

      public void recordDataSent(SocketAddress remoteAddress, SocketAddress proxyAddress, long bytes)
      Description copied from interface: ChannelMetricsRecorder
      Records the amount of the data that is sent, in bytes.
      Specified by:
      recordDataSent in interface ChannelMetricsRecorder
      Parameters:
      remoteAddress - The remote peer
      proxyAddress - The proxy address
      bytes - The amount of the data that is sent, in bytes
    • incrementErrorsCount

      public void incrementErrorsCount(SocketAddress remoteAddress)
      Description copied from interface: ChannelMetricsRecorder
      Increments the number of the errors that have occurred.
      Specified by:
      incrementErrorsCount in interface ChannelMetricsRecorder
      Parameters:
      remoteAddress - The remote peer
    • incrementErrorsCount

      public void incrementErrorsCount(SocketAddress remoteAddress, SocketAddress proxyAddress)
      Description copied from interface: ChannelMetricsRecorder
      Increments the number of the errors that have occurred.
      Specified by:
      incrementErrorsCount in interface ChannelMetricsRecorder
      Parameters:
      remoteAddress - The remote peer
      proxyAddress - The proxy address
    • recordTlsHandshakeTime

      public void recordTlsHandshakeTime(SocketAddress remoteAddress, Duration time, String status)
      Description copied from interface: ChannelMetricsRecorder
      Records the time that is spent for TLS handshake.
      Specified by:
      recordTlsHandshakeTime in interface ChannelMetricsRecorder
      Parameters:
      remoteAddress - The remote peer
      time - the time in nanoseconds that is spent for TLS handshake
      status - the status of the operation
    • getTlsHandshakeTimer

      @Deprecated public final @Nullable io.micrometer.core.instrument.Timer getTlsHandshakeTimer(String name, @Nullable String address, String status)
      Deprecated.
      as of 1.1.19. Prefer the getTlsHandshakeTimer(String, String, String, String). This method will be removed in version 1.3.0.
      Returns TLS handshake timer.
      Parameters:
      name - the timer name
      address - the remote address
      status - the status of the TLS handshake operation
      Returns:
      TLS handshake timer
    • recordTlsHandshakeTime

      public void recordTlsHandshakeTime(SocketAddress remoteAddress, SocketAddress proxyAddress, Duration time, String status)
      Description copied from interface: ChannelMetricsRecorder
      Records the time that is spent for TLS handshake.
      Specified by:
      recordTlsHandshakeTime in interface ChannelMetricsRecorder
      Parameters:
      remoteAddress - The remote peer
      proxyAddress - The proxy address
      time - the time in nanoseconds that is spent for TLS handshake
      status - the status of the operation
    • getTlsHandshakeTimer

      public final @Nullable io.micrometer.core.instrument.Timer getTlsHandshakeTimer(String name, @Nullable String remoteAddress, @Nullable String proxyAddress, String status)
      Returns TLS handshake timer.
      Parameters:
      name - the timer name
      remoteAddress - the remote address
      proxyAddress - the proxy address
      status - the status of the TLS handshake operation
      Returns:
      TLS handshake timer
    • recordConnectTime

      public void recordConnectTime(SocketAddress remoteAddress, Duration time, String status)
      Description copied from interface: ChannelMetricsRecorder
      Records the time that is spent for connecting to the remote address. Relevant only when on the client
      Specified by:
      recordConnectTime in interface ChannelMetricsRecorder
      Parameters:
      remoteAddress - The remote peer
      time - the time in nanoseconds that is spent for connecting to the remote address
      status - the status of the operation
    • recordConnectTime

      public void recordConnectTime(SocketAddress remoteAddress, SocketAddress proxyAddress, Duration time, String status)
      Description copied from interface: ChannelMetricsRecorder
      Records the time that is spent for connecting to the remote address. Relevant only when on the client
      Specified by:
      recordConnectTime in interface ChannelMetricsRecorder
      Parameters:
      remoteAddress - The remote peer
      proxyAddress - The proxy address
      time - the time in nanoseconds that is spent for connecting to the remote address
      status - the status of the operation
    • recordResolveAddressTime

      public void recordResolveAddressTime(SocketAddress remoteAddress, Duration time, String status)
      Description copied from interface: ChannelMetricsRecorder
      Records the time that is spent for resolving the remote address. Relevant only when on the client.
      Specified by:
      recordResolveAddressTime in interface ChannelMetricsRecorder
      Parameters:
      remoteAddress - The remote peer
      time - the time in nanoseconds that is spent for resolving to the remote address
      status - the status of the operation
    • getResolveAddressTimer

      public final @Nullable io.micrometer.core.instrument.Timer getResolveAddressTimer(String name, @Nullable String address, String status)
    • recordServerConnectionOpened

      public void recordServerConnectionOpened(SocketAddress serverAddress)
      Description copied from interface: ChannelMetricsRecorder
      Records a just accepted server connection.
      Specified by:
      recordServerConnectionOpened in interface ChannelMetricsRecorder
      Parameters:
      serverAddress - the server local address
    • recordServerConnectionClosed

      public void recordServerConnectionClosed(SocketAddress serverAddress)
      Description copied from interface: ChannelMetricsRecorder
      Records a just disconnected server connection.
      Specified by:
      recordServerConnectionClosed in interface ChannelMetricsRecorder
      Parameters:
      serverAddress - the server local address
    • filter

      protected static <M extends io.micrometer.core.instrument.Meter> @Nullable M filter(M meter)
    • name

      public String name()
    • protocol

      public String protocol()