Skip to content

Commit

Permalink
Merge #2529 into 1.1.0-RC1
Browse files Browse the repository at this point in the history
  • Loading branch information
violetagg committed Oct 6, 2022
2 parents e7f547e + 8fd5fc6 commit 9c90ff1
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.netty.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 @@ -116,7 +118,7 @@ else if (msg instanceof DatagramPacket) {
}
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 @@ -144,7 +146,7 @@ else if (msg instanceof DatagramPacket) {
}
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 @@ -160,7 +162,7 @@ public void exceptionCaught(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 @@ -389,7 +389,7 @@ else if (alloc instanceof UnpooledByteBufAllocator) {
}
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.netty.ReactorNetty.format;

/**
* @author Violeta Georgieva
* @since 1.0.8
Expand Down Expand Up @@ -96,7 +98,7 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise)
}
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 void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise)
}
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 @@ -132,7 +134,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 @@ -147,7 +149,7 @@ public void exceptionCaught(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.netty.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 @@ -130,7 +132,7 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise)
}
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 @@ -147,7 +149,7 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise)
}
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 @@ -160,7 +162,7 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise)
}
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 @@ -201,7 +203,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 @@ -221,7 +223,7 @@ public void exceptionCaught(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 9c90ff1

Please sign in to comment.