Top Description Inners Fields Constructors Methods
reactor.netty5.channel

public final Class MicrometerChannelMetricsHandler

extends AbstractChannelMetricsHandler
Class Inheritance
Imports
io.micrometer.common.KeyValues, io.micrometer.core.instrument.Timer, io.micrometer.observation.Observation, io.netty5.channel.ChannelHandler, .ChannelHandlerContext, io.netty5.handler.ssl.SslHandler, io.netty5.util.AttributeKey, io.netty5.util.concurrent.Future, reactor.netty5.observability.ReactorNettyHandlerContext, reactor.util.annotation.Nullable, reactor.util.context.ContextView, java.net.InetSocketAddress, .SocketAddress, java.util.function.Supplier

ChannelHandler for collecting metrics on protocol level. This class is based on ChannelMetricsHandler, but it utilizes Micrometer's Observation.
Authors
Marcin Grzejszczak, Violeta Georgieva
Since
1.1.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv static final AttributeKey<ContextView>
pack-priv final MicrometerChannelMetricsRecorder
Inherited from reactor.netty5.channel.AbstractChannelMetricsHandler:
onServerremoteAddress

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public ChannelHandler
public MicrometerChannelMetricsRecorder
public ChannelHandler
Inherited from reactor.netty5.channel.AbstractChannelMetricsHandler:
channelActivechannelExceptionCaughtchannelInactivechannelReadchannelRegisteredrecordExceptionrecordReadrecordWritewrite

Field Detail

CONTEXT_VIEWback to summary
pack-priv static final AttributeKey<ContextView> CONTEXT_VIEW
recorderback to summary
pack-priv final MicrometerChannelMetricsRecorder recorder

Constructor Detail

MicrometerChannelMetricsHandlerback to summary
pack-priv MicrometerChannelMetricsHandler(MicrometerChannelMetricsRecorder recorder, SocketAddress remoteAddress, boolean onServer)

Method Detail

connectMetricsHandlerback to summary
public ChannelHandler connectMetricsHandler()

Implements abstract reactor.netty5.channel.AbstractChannelMetricsHandler.connectMetricsHandler.

Annotations
@Override
recorderback to summary
public MicrometerChannelMetricsRecorder recorder()

Implements abstract reactor.netty5.channel.AbstractChannelMetricsHandler.recorder.

Annotations
@Override
tlsMetricsHandlerback to summary
public ChannelHandler tlsMetricsHandler()

Implements abstract reactor.netty5.channel.AbstractChannelMetricsHandler.tlsMetricsHandler.

Annotations
@Override
reactor.netty5.channel back to summary

pack-priv final Class MicrometerChannelMetricsHandler.ConnectMetricsHandler

extends Context
implements ReactorNettyHandlerContext, ChannelHandler, Supplier<Observation.Context>
Class Inheritance
All Implemented Interfaces
java.util.function.Supplier, io.netty5.channel.ChannelHandler, reactor.netty5.observability.ReactorNettyHandlerContext

Field Summary

Modifier and TypeField and Description
pack-priv static final String
pack-priv String
pack-priv String
pack-priv final MicrometerChannelMetricsRecorder
pack-priv String
pack-priv static final String

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Future<Void>
connect(ChannelHandlerContext
the ChannelHandlerContext for which the connect operation is made
ctx
,
SocketAddress
the SocketAddress to which it should connect
remoteAddress
,
SocketAddress
the SocketAddress which is used as source on connect
localAddress
)

Overrides default io.netty5.channel.ChannelHandler.connect.

Called once a connect operation is made.
public Observation.Context
get()

Implements java.util.function.Supplier.get.

Gets a result.
public String
public KeyValues
public KeyValues
public io.micrometer.core.instrument.Timer
getTimer()

Implements reactor.netty5.observability.ReactorNettyHandlerContext.getTimer.

Obtain the timer associated to this reactor netty context.
Inherited from io.micrometer.observation.Observation.Context:
addHighCardinalityKeyValueaddHighCardinalityKeyValuesaddLowCardinalityKeyValueaddLowCardinalityKeyValuesclearcomputeIfAbsentcontainsKeygetgetAllKeyValuesgetErrorgetHighCardinalityKeyValuegetLowCardinalityKeyValuegetNamegetOrDefaultgetParentObservationgetRequiredputremoveremoveHighCardinalityKeyValueremoveHighCardinalityKeyValuesremoveLowCardinalityKeyValueremoveLowCardinalityKeyValuessetContextualNamesetErrorsetNamesetParentObservationtoString

Field Detail

CONTEXTUAL_NAMEback to summary
pack-priv static final String CONTEXTUAL_NAME
netPeerNameback to summary
pack-priv String netPeerName
netPeerPortback to summary
pack-priv String netPeerPort
recorderback to summary
pack-priv final MicrometerChannelMetricsRecorder recorder
statusback to summary
pack-priv String status
TYPEback to summary
pack-priv static final String TYPE

Constructor Detail

ConnectMetricsHandlerback to summary
pack-priv ConnectMetricsHandler(MicrometerChannelMetricsRecorder recorder)

Method Detail

connectback to summary
public Future<Void> connect(ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress)

Overrides default io.netty5.channel.ChannelHandler.connect.

Doc from io.netty5.channel.ChannelHandler.connect.

Called once a connect operation is made.

Parameters
ctx:ChannelHandlerContext

the ChannelHandlerContext for which the connect operation is made

remoteAddress:SocketAddress

the SocketAddress to which it should connect

localAddress:SocketAddress

the SocketAddress which is used as source on connect

Returns:Future<Void>

the Future which will be notified once the operation completes.

Annotations
@Override
@SuppressWarnings:try
getback to summary
public Observation.Context get()

Implements java.util.function.Supplier.get.

Doc from java.util.function.Supplier.get.

Gets a result.

Returns:Observation.Context

a result

Annotations
@Override
getContextualNameback to summary
public String getContextualName()

Overrides io.micrometer.observation.Observation.Context.getContextualName.

Implements io.micrometer.observation.Observation.ContextView.getContextualName.

Doc from io.micrometer.observation.Observation.Context.getContextualName.

Returns the contextual name. The name that makes sense within the current context (e.g. name derived from HTTP request).

Returns:String

contextual name

Annotations
@Override
getHighCardinalityKeyValuesback to summary
public KeyValues getHighCardinalityKeyValues()

Overrides io.micrometer.observation.Observation.Context.getHighCardinalityKeyValues.

Implements io.micrometer.observation.Observation.ContextView.getHighCardinalityKeyValues.

Doc from io.micrometer.observation.Observation.ContextView.getHighCardinalityKeyValues.

Returns high cardinality key values.

Returns:KeyValues

high cardinality key values

Annotations
@Override
getLowCardinalityKeyValuesback to summary
public KeyValues getLowCardinalityKeyValues()

Overrides io.micrometer.observation.Observation.Context.getLowCardinalityKeyValues.

Implements io.micrometer.observation.Observation.ContextView.getLowCardinalityKeyValues.

Doc from io.micrometer.observation.Observation.ContextView.getLowCardinalityKeyValues.

Returns low cardinality key values.

Returns:KeyValues

low cardinality key values

Annotations
@Override
getTimerback to summary
public io.micrometer.core.instrument.Timer getTimer()

Implements reactor.netty5.observability.ReactorNettyHandlerContext.getTimer.

Doc from reactor.netty5.observability.ReactorNettyHandlerContext.getTimer.

Obtain the timer associated to this reactor netty context.

Returns:io.micrometer.core.instrument.Timer

the current reactor netty handler context timer

Annotations
@Override
reactor.netty5.channel back to summary

pack-priv final Class MicrometerChannelMetricsHandler.TlsMetricsHandler

extends Context
implements ReactorNettyHandlerContext, ChannelHandler, Supplier<Observation.Context>
Class Inheritance
All Implemented Interfaces
java.util.function.Supplier, io.netty5.channel.ChannelHandler, reactor.netty5.observability.ReactorNettyHandlerContext

Field Summary

Modifier and TypeField and Description
pack-priv static final String
pack-priv String
pack-priv String
pack-priv Observation
pack-priv final MicrometerChannelMetricsRecorder
pack-priv String
pack-priv final String
pack-priv static final String
pack-priv static final String

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
public Observation.Context
get()

Implements java.util.function.Supplier.get.

Gets a result.
public String
public KeyValues
public KeyValues
public io.micrometer.core.instrument.Timer
getTimer()

Implements reactor.netty5.observability.ReactorNettyHandlerContext.getTimer.

Obtain the timer associated to this reactor netty context.
Inherited from io.micrometer.observation.Observation.Context:
addHighCardinalityKeyValueaddHighCardinalityKeyValuesaddLowCardinalityKeyValueaddLowCardinalityKeyValuesclearcomputeIfAbsentcontainsKeygetgetAllKeyValuesgetErrorgetHighCardinalityKeyValuegetLowCardinalityKeyValuegetNamegetOrDefaultgetParentObservationgetRequiredputremoveremoveHighCardinalityKeyValueremoveHighCardinalityKeyValuesremoveLowCardinalityKeyValueremoveLowCardinalityKeyValuessetContextualNamesetErrorsetNamesetParentObservationtoString

Field Detail

CONTEXTUAL_NAMEback to summary
pack-priv static final String CONTEXTUAL_NAME
netPeerNameback to summary
pack-priv String netPeerName
netPeerPortback to summary
pack-priv String netPeerPort
observationback to summary
pack-priv Observation observation
recorderback to summary
pack-priv final MicrometerChannelMetricsRecorder recorder
statusback to summary
pack-priv String status
typeback to summary
pack-priv final String type
TYPE_CLIENTback to summary
pack-priv static final String TYPE_CLIENT
TYPE_SERVERback to summary
pack-priv static final String TYPE_SERVER

Constructor Detail

TlsMetricsHandlerback to summary
pack-priv TlsMetricsHandler(MicrometerChannelMetricsRecorder recorder, boolean onServer)

Method Detail

channelActiveback to summary
public void channelActive(ChannelHandlerContext ctx)

Overrides default io.netty5.channel.ChannelHandler.channelActive.

Doc from io.netty5.channel.ChannelHandler.channelActive.

The Channel of the ChannelHandlerContext is now active

Annotations
@Override
@SuppressWarnings:try
getback to summary
public Observation.Context get()

Implements java.util.function.Supplier.get.

Doc from java.util.function.Supplier.get.

Gets a result.

Returns:Observation.Context

a result

Annotations
@Override
getContextualNameback to summary
public String getContextualName()

Overrides io.micrometer.observation.Observation.Context.getContextualName.

Implements io.micrometer.observation.Observation.ContextView.getContextualName.

Doc from io.micrometer.observation.Observation.Context.getContextualName.

Returns the contextual name. The name that makes sense within the current context (e.g. name derived from HTTP request).

Returns:String

contextual name

Annotations
@Override
getHighCardinalityKeyValuesback to summary
public KeyValues getHighCardinalityKeyValues()

Overrides io.micrometer.observation.Observation.Context.getHighCardinalityKeyValues.

Implements io.micrometer.observation.Observation.ContextView.getHighCardinalityKeyValues.

Doc from io.micrometer.observation.Observation.ContextView.getHighCardinalityKeyValues.

Returns high cardinality key values.

Returns:KeyValues

high cardinality key values

Annotations
@Override
getLowCardinalityKeyValuesback to summary
public KeyValues getLowCardinalityKeyValues()

Overrides io.micrometer.observation.Observation.Context.getLowCardinalityKeyValues.

Implements io.micrometer.observation.Observation.ContextView.getLowCardinalityKeyValues.

Doc from io.micrometer.observation.Observation.ContextView.getLowCardinalityKeyValues.

Returns low cardinality key values.

Returns:KeyValues

low cardinality key values

Annotations
@Override
getTimerback to summary
public io.micrometer.core.instrument.Timer getTimer()

Implements reactor.netty5.observability.ReactorNettyHandlerContext.getTimer.

Doc from reactor.netty5.observability.ReactorNettyHandlerContext.getTimer.

Obtain the timer associated to this reactor netty context.

Returns:io.micrometer.core.instrument.Timer

the current reactor netty handler context timer

Annotations
@Override