Package reactor.netty.channel
Class MicrometerChannelMetricsRecorder
java.lang.Object
reactor.netty.channel.MicrometerChannelMetricsRecorder
- All Implemented Interfaces:
ChannelMetricsRecorder
- Direct Known Subclasses:
MicrometerHttpMetricsRecorder
A
ChannelMetricsRecorder
implementation for integration with Micrometer.- Since:
- 0.9
- Author:
- Violeta Georgieva
-
Constructor Summary
ConstructorsConstructorDescriptionMicrometerChannelMetricsRecorder
(String name, String protocol) MicrometerChannelMetricsRecorder
(String name, String protocol, boolean onServer) -
Method Summary
Modifier and TypeMethodDescriptionprotected static <M extends io.micrometer.core.instrument.Meter>
@Nullable Mfilter
(M meter) final @Nullable io.micrometer.core.instrument.Timer
getResolveAddressTimer
(String name, @Nullable String address, String status) final @Nullable io.micrometer.core.instrument.Timer
getTlsHandshakeTimer
(String name, @Nullable String remoteAddress, @Nullable String proxyAddress, String status) Returns TLS handshake timer.final @Nullable io.micrometer.core.instrument.Timer
getTlsHandshakeTimer
(String name, @Nullable String address, String status) Deprecated.as of 1.1.19.void
incrementErrorsCount
(SocketAddress remoteAddress) Increments the number of the errors that have occurred.void
incrementErrorsCount
(SocketAddress remoteAddress, SocketAddress proxyAddress) Increments the number of the errors that have occurred.name()
protocol()
void
recordConnectTime
(SocketAddress remoteAddress, SocketAddress proxyAddress, Duration time, String status) Records the time that is spent for connecting to the remote address.void
recordConnectTime
(SocketAddress remoteAddress, Duration time, String status) Records the time that is spent for connecting to the remote address.void
recordDataReceived
(SocketAddress remoteAddress, long bytes) Records the amount of the data that is received, in bytes.void
recordDataReceived
(SocketAddress remoteAddress, SocketAddress proxyAddress, long bytes) Records the amount of the data that is received, in bytes.void
recordDataSent
(SocketAddress remoteAddress, long bytes) Records the amount of the data that is sent, in bytes.void
recordDataSent
(SocketAddress remoteAddress, SocketAddress proxyAddress, long bytes) Records the amount of the data that is sent, in bytes.void
recordResolveAddressTime
(SocketAddress remoteAddress, Duration time, String status) Records the time that is spent for resolving the remote address.void
recordServerConnectionClosed
(SocketAddress serverAddress) Records a just disconnected server connection.void
recordServerConnectionOpened
(SocketAddress serverAddress) Records a just accepted server connection.void
recordTlsHandshakeTime
(SocketAddress remoteAddress, SocketAddress proxyAddress, Duration time, String status) Records the time that is spent for TLS handshake.void
recordTlsHandshakeTime
(SocketAddress remoteAddress, Duration time, String status) Records the time that is spent for TLS handshake.
-
Constructor Details
-
MicrometerChannelMetricsRecorder
-
MicrometerChannelMetricsRecorder
-
-
Method Details
-
recordDataReceived
Description copied from interface:ChannelMetricsRecorder
Records the amount of the data that is received, in bytes.- Specified by:
recordDataReceived
in interfaceChannelMetricsRecorder
- Parameters:
remoteAddress
- The remote peerbytes
- The amount of the data that is received, in bytes
-
recordDataReceived
Description copied from interface:ChannelMetricsRecorder
Records the amount of the data that is received, in bytes.- Specified by:
recordDataReceived
in interfaceChannelMetricsRecorder
- Parameters:
remoteAddress
- The remote peerproxyAddress
- The proxy addressbytes
- The amount of the data that is received, in bytes
-
recordDataSent
Description copied from interface:ChannelMetricsRecorder
Records the amount of the data that is sent, in bytes.- Specified by:
recordDataSent
in interfaceChannelMetricsRecorder
- Parameters:
remoteAddress
- The remote peerbytes
- The amount of the data that is sent, in bytes
-
recordDataSent
Description copied from interface:ChannelMetricsRecorder
Records the amount of the data that is sent, in bytes.- Specified by:
recordDataSent
in interfaceChannelMetricsRecorder
- Parameters:
remoteAddress
- The remote peerproxyAddress
- The proxy addressbytes
- The amount of the data that is sent, in bytes
-
incrementErrorsCount
Description copied from interface:ChannelMetricsRecorder
Increments the number of the errors that have occurred.- Specified by:
incrementErrorsCount
in interfaceChannelMetricsRecorder
- Parameters:
remoteAddress
- The remote peer
-
incrementErrorsCount
Description copied from interface:ChannelMetricsRecorder
Increments the number of the errors that have occurred.- Specified by:
incrementErrorsCount
in interfaceChannelMetricsRecorder
- Parameters:
remoteAddress
- The remote peerproxyAddress
- The proxy address
-
recordTlsHandshakeTime
Description copied from interface:ChannelMetricsRecorder
Records the time that is spent for TLS handshake.- Specified by:
recordTlsHandshakeTime
in interfaceChannelMetricsRecorder
- Parameters:
remoteAddress
- The remote peertime
- the time in nanoseconds that is spent for TLS handshakestatus
- 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 thegetTlsHandshakeTimer(String, String, String, String)
. This method will be removed in version 1.3.0.Returns TLS handshake timer.- Parameters:
name
- the timer nameaddress
- the remote addressstatus
- 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 interfaceChannelMetricsRecorder
- Parameters:
remoteAddress
- The remote peerproxyAddress
- The proxy addresstime
- the time in nanoseconds that is spent for TLS handshakestatus
- 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 nameremoteAddress
- the remote addressproxyAddress
- the proxy addressstatus
- the status of the TLS handshake operation- Returns:
- TLS handshake timer
-
recordConnectTime
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 interfaceChannelMetricsRecorder
- Parameters:
remoteAddress
- The remote peertime
- the time in nanoseconds that is spent for connecting to the remote addressstatus
- 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 interfaceChannelMetricsRecorder
- Parameters:
remoteAddress
- The remote peerproxyAddress
- The proxy addresstime
- the time in nanoseconds that is spent for connecting to the remote addressstatus
- the status of the operation
-
recordResolveAddressTime
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 interfaceChannelMetricsRecorder
- Parameters:
remoteAddress
- The remote peertime
- the time in nanoseconds that is spent for resolving to the remote addressstatus
- the status of the operation
-
getResolveAddressTimer
-
recordServerConnectionOpened
Description copied from interface:ChannelMetricsRecorder
Records a just accepted server connection.- Specified by:
recordServerConnectionOpened
in interfaceChannelMetricsRecorder
- Parameters:
serverAddress
- the server local address
-
recordServerConnectionClosed
Description copied from interface:ChannelMetricsRecorder
Records a just disconnected server connection.- Specified by:
recordServerConnectionClosed
in interfaceChannelMetricsRecorder
- Parameters:
serverAddress
- the server local address
-
filter
protected static <M extends io.micrometer.core.instrument.Meter> @Nullable M filter(M meter) -
name
-
protocol
-