From b12ba64baa4e1386a68103529dc284d94b49fa55 Mon Sep 17 00:00:00 2001 From: lindseyr Date: Thu, 19 Oct 2023 08:41:37 -0700 Subject: [PATCH] Add metrics for frames passed through userEventTriggered --- .../common/metrics/Http2MetricsChannelHandlers.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/zuul-core/src/main/java/com/netflix/netty/common/metrics/Http2MetricsChannelHandlers.java b/zuul-core/src/main/java/com/netflix/netty/common/metrics/Http2MetricsChannelHandlers.java index 1fdf1072e3..33e6eff9e3 100644 --- a/zuul-core/src/main/java/com/netflix/netty/common/metrics/Http2MetricsChannelHandlers.java +++ b/zuul-core/src/main/java/com/netflix/netty/common/metrics/Http2MetricsChannelHandlers.java @@ -93,6 +93,17 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception } } + @Override + public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { + try { + if (evt instanceof Http2Frame) { + incrementCounter(registry, frameCounterName, metricId, (Http2Frame) evt); + } + } finally { + super.userEventTriggered(ctx, evt); + } + } + @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { try {