Skip to content

Commit

Permalink
Merge #2529 into 2.0.0-M2
Browse files Browse the repository at this point in the history
  • Loading branch information
violetagg committed Oct 6, 2022
2 parents 3f212bf + 9c90ff1 commit 40273dc
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 17 deletions.
Expand Up @@ -28,6 +28,8 @@

import java.net.SocketAddress;

import static reactor.netty5.ReactorNetty.format;

/**
* Base {@link ChannelHandler} for collecting metrics on protocol level.
*
Expand Down Expand Up @@ -55,7 +57,7 @@ public void channelActive(ChannelHandlerContext ctx) {
}
catch (RuntimeException e) {
if (log.isWarnEnabled()) {
log.warn("Exception caught while recording metrics.", e);
log.warn(format(ctx.channel(), "Exception caught while recording metrics."), e);
}
// Allow request-response exchange to continue, unaffected by metrics problem
}
Expand All @@ -71,7 +73,7 @@ public void channelInactive(ChannelHandlerContext ctx) {
}
catch (RuntimeException e) {
if (log.isWarnEnabled()) {
log.warn("Exception caught while recording metrics.", e);
log.warn(format(ctx.channel(), "Exception caught while recording metrics."), e);
}
// Allow request-response exchange to continue, unaffected by metrics problem
}
Expand Down Expand Up @@ -114,7 +116,7 @@ else if (msg instanceof DatagramPacket p) {
}
catch (RuntimeException e) {
if (log.isWarnEnabled()) {
log.warn("Exception caught while recording metrics.", e);
log.warn(format(ctx.channel(), "Exception caught while recording metrics."), e);
}
// Allow request-response exchange to continue, unaffected by metrics problem
}
Expand All @@ -139,7 +141,7 @@ else if (msg instanceof DatagramPacket p) {
}
catch (RuntimeException e) {
if (log.isWarnEnabled()) {
log.warn("Exception caught while recording metrics.", e);
log.warn(format(ctx.channel(), "Exception caught while recording metrics."), e);
}
// Allow request-response exchange to continue, unaffected by metrics problem
}
Expand All @@ -154,7 +156,7 @@ public void channelExceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
}
catch (RuntimeException e) {
if (log.isWarnEnabled()) {
log.warn("Exception caught while recording metrics.", e);
log.warn(format(ctx.channel(), "Exception caught while recording metrics."), e);
}
// Allow request-response exchange to continue, unaffected by metrics problem
}
Expand Down
Expand Up @@ -420,7 +420,7 @@ protected void initChannel(Channel channel) {
}
catch (RuntimeException e) {
if (log.isWarnEnabled()) {
log.warn("Exception caught while recording metrics.", e);
log.warn(format(channel, "Exception caught while recording metrics."), e);
}
// Allow request-response exchange to continue, unaffected by metrics problem
}
Expand Down
Expand Up @@ -34,6 +34,8 @@
import java.time.Duration;
import java.util.function.Function;

import static reactor.netty5.ReactorNetty.format;

/**
* @author Violeta Georgieva
* @since 1.0.8
Expand Down Expand Up @@ -96,7 +98,7 @@ public Future<Void> write(ChannelHandlerContext ctx, Object msg) {
}
catch (RuntimeException e) {
if (log.isWarnEnabled()) {
log.warn("Exception caught while recording metrics.", e);
log.warn(format(ctx.channel(), "Exception caught while recording metrics."), e);
}
// Allow request-response exchange to continue, unaffected by metrics problem
}
Expand All @@ -105,7 +107,7 @@ public Future<Void> write(ChannelHandlerContext ctx, Object msg) {
}
catch (RuntimeException e) {
if (log.isWarnEnabled()) {
log.warn("Exception caught while recording metrics.", e);
log.warn(format(ctx.channel(), "Exception caught while recording metrics."), e);
}
// Allow request-response exchange to continue, unaffected by metrics problem
}
Expand All @@ -131,7 +133,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) {
}
catch (RuntimeException e) {
if (log.isWarnEnabled()) {
log.warn("Exception caught while recording metrics.", e);
log.warn(format(ctx.channel(), "Exception caught while recording metrics."), e);
}
// Allow request-response exchange to continue, unaffected by metrics problem
}
Expand All @@ -146,7 +148,7 @@ public void channelExceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
}
catch (RuntimeException e) {
if (log.isWarnEnabled()) {
log.warn("Exception caught while recording metrics.", e);
log.warn(format(ctx.channel(), "Exception caught while recording metrics."), e);
}
// Allow request-response exchange to continue, unaffected by metrics problem
}
Expand Down
Expand Up @@ -33,6 +33,8 @@
import java.time.Duration;
import java.util.function.Function;

import static reactor.netty5.ReactorNetty.format;

/**
* @author Violeta Georgieva
* @since 1.0.8
Expand Down Expand Up @@ -74,7 +76,7 @@ public void channelActive(ChannelHandlerContext ctx) {
}
catch (RuntimeException e) {
if (log.isWarnEnabled()) {
log.warn("Exception caught while recording metrics.", e);
log.warn(format(ctx.channel(), "Exception caught while recording metrics."), e);
}
// Allow request-response exchange to continue, unaffected by metrics problem
}
Expand All @@ -90,7 +92,7 @@ public void channelInactive(ChannelHandlerContext ctx) {
}
catch (RuntimeException e) {
if (log.isWarnEnabled()) {
log.warn("Exception caught while recording metrics.", e);
log.warn(format(ctx.channel(), "Exception caught while recording metrics."), e);
}
// Allow request-response exchange to continue, unaffected by metrics problem
}
Expand Down Expand Up @@ -129,7 +131,7 @@ public Future<Void> write(ChannelHandlerContext ctx, Object msg) {
}
catch (RuntimeException e) {
if (log.isWarnEnabled()) {
log.warn("Exception caught while recording metrics.", e);
log.warn(format(ctx.channel(), "Exception caught while recording metrics."), e);
}
// Allow request-response exchange to continue, unaffected by metrics problem
}
Expand All @@ -146,7 +148,7 @@ public Future<Void> write(ChannelHandlerContext ctx, Object msg) {
}
catch (RuntimeException e) {
if (log.isWarnEnabled()) {
log.warn("Exception caught while recording metrics.", e);
log.warn(format(ctx.channel(), "Exception caught while recording metrics."), e);
}
// Allow request-response exchange to continue, unaffected by metrics problem
}
Expand All @@ -159,7 +161,7 @@ public Future<Void> write(ChannelHandlerContext ctx, Object msg) {
}
catch (RuntimeException e) {
if (log.isWarnEnabled()) {
log.warn("Exception caught while recording metrics.", e);
log.warn(format(ctx.channel(), "Exception caught while recording metrics."), e);
}
// Allow request-response exchange to continue, unaffected by metrics problem
}
Expand Down Expand Up @@ -195,7 +197,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) {
}
catch (RuntimeException e) {
if (log.isWarnEnabled()) {
log.warn("Exception caught while recording metrics.", e);
log.warn(format(ctx.channel(), "Exception caught while recording metrics."), e);
}
// Allow request-response exchange to continue, unaffected by metrics problem
}
Expand All @@ -214,7 +216,7 @@ public void channelExceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
}
catch (RuntimeException e) {
if (log.isWarnEnabled()) {
log.warn("Exception caught while recording metrics.", e);
log.warn(format(ctx.channel(), "Exception caught while recording metrics."), e);
}
// Allow request-response exchange to continue, unaffected by metrics problem
}
Expand Down

0 comments on commit 40273dc

Please sign in to comment.