From e4a486b9eba30b61802752f49f93637f17922b6c Mon Sep 17 00:00:00 2001 From: Violeta Georgieva Date: Mon, 13 Nov 2023 17:51:46 +0200 Subject: [PATCH] Add HttpServer#metrics(boolean, Function, Function) Add HttpServer#metrics(boolean, Supplier, Function, Function) --- .../AbstractHttpServerMetricsHandler.java | 11 +- .../ContextAwareHttpServerMetricsHandler.java | 8 +- .../reactor/netty/http/server/HttpServer.java | 110 ++++++++++++++++++ .../netty/http/server/HttpServerConfig.java | 49 +++++--- .../http/server/HttpServerMetricsHandler.java | 9 +- 5 files changed, 164 insertions(+), 23 deletions(-) diff --git a/reactor-netty-http/src/main/java/reactor/netty/http/server/AbstractHttpServerMetricsHandler.java b/reactor-netty-http/src/main/java/reactor/netty/http/server/AbstractHttpServerMetricsHandler.java index 8ee3ff14d2..4a8c4ff2cd 100644 --- a/reactor-netty-http/src/main/java/reactor/netty/http/server/AbstractHttpServerMetricsHandler.java +++ b/reactor-netty-http/src/main/java/reactor/netty/http/server/AbstractHttpServerMetricsHandler.java @@ -59,9 +59,13 @@ abstract class AbstractHttpServerMetricsHandler extends ChannelDuplexHandler { long dataSentTime; + final Function methodTagValue; final Function uriTagValue; - protected AbstractHttpServerMetricsHandler(@Nullable Function uriTagValue) { + protected AbstractHttpServerMetricsHandler( + @Nullable Function methodTagValue, + @Nullable Function uriTagValue) { + this.methodTagValue = methodTagValue == null ? Function.identity() : methodTagValue; this.uriTagValue = uriTagValue; } @@ -72,6 +76,7 @@ protected AbstractHttpServerMetricsHandler(AbstractHttpServerMetricsHandler copy this.dataReceivedTime = copy.dataReceivedTime; this.dataSent = copy.dataSent; this.dataSentTime = copy.dataSentTime; + this.methodTagValue = copy.methodTagValue; this.uriTagValue = copy.uriTagValue; } @@ -140,7 +145,7 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) HttpServerOperations ops = (HttpServerOperations) channelOps; try { recordWrite(ops, uriTagValue == null ? ops.path : uriTagValue.apply(ops.path), - ops.method().name(), ops.status().codeAsText().toString()); + methodTagValue.apply(ops.method().name()), ops.status().codeAsText().toString()); } catch (RuntimeException e) { // Allow request-response exchange to continue, unaffected by metrics problem @@ -191,7 +196,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) { ChannelOperations channelOps = ChannelOperations.get(ctx.channel()); if (channelOps instanceof HttpServerOperations) { HttpServerOperations ops = (HttpServerOperations) channelOps; - recordRead(ops, uriTagValue == null ? ops.path : uriTagValue.apply(ops.path), ops.method().name()); + recordRead(ops, uriTagValue == null ? ops.path : uriTagValue.apply(ops.path), methodTagValue.apply(ops.method().name())); } dataReceived = 0; diff --git a/reactor-netty-http/src/main/java/reactor/netty/http/server/ContextAwareHttpServerMetricsHandler.java b/reactor-netty-http/src/main/java/reactor/netty/http/server/ContextAwareHttpServerMetricsHandler.java index afbd5dcc7b..c18296b9f4 100644 --- a/reactor-netty-http/src/main/java/reactor/netty/http/server/ContextAwareHttpServerMetricsHandler.java +++ b/reactor-netty-http/src/main/java/reactor/netty/http/server/ContextAwareHttpServerMetricsHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 VMware, Inc. or its affiliates, All Rights Reserved. + * Copyright (c) 2021-2023 VMware, Inc. or its affiliates, All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,9 +29,11 @@ final class ContextAwareHttpServerMetricsHandler extends AbstractHttpServerMetri final ContextAwareHttpServerMetricsRecorder recorder; - ContextAwareHttpServerMetricsHandler(ContextAwareHttpServerMetricsRecorder recorder, + ContextAwareHttpServerMetricsHandler( + ContextAwareHttpServerMetricsRecorder recorder, + @Nullable Function methodTagValue, @Nullable Function uriTagValue) { - super(uriTagValue); + super(methodTagValue, uriTagValue); this.recorder = recorder; } diff --git a/reactor-netty-http/src/main/java/reactor/netty/http/server/HttpServer.java b/reactor-netty-http/src/main/java/reactor/netty/http/server/HttpServer.java index 84811121b6..84a0fa744e 100644 --- a/reactor-netty-http/src/main/java/reactor/netty/http/server/HttpServer.java +++ b/reactor-netty-http/src/main/java/reactor/netty/http/server/HttpServer.java @@ -624,6 +624,73 @@ else if (configuration().metricsRecorder() != null) { } } + /** + * Whether to enable metrics to be collected and registered in Micrometer's + * {@link io.micrometer.core.instrument.Metrics#globalRegistry globalRegistry} + * under the name {@link reactor.netty.Metrics#HTTP_SERVER_PREFIX}. + *

{@code uriTagValue} function receives the actual uri and returns the uri tag value + * that will be used for the metrics with {@link reactor.netty.Metrics#URI} tag. + * For example instead of using the actual uri {@code "/users/1"} as uri tag value, templated uri + * {@code "/users/{id}"} can be used. + *

Note: + * It is strongly recommended to provide template-like form for the URIs. Without a conversion to a template-like form, + * each distinct URI leads to the creation of a distinct tag, which takes a lot of memory for the metrics. + *

Note: + * It is strongly recommended applications to configure an upper limit for the number of the URI tags. + * For example: + *

+	 * Metrics.globalRegistry
+	 *        .config()
+	 *        .meterFilter(MeterFilter.maximumAllowableTags(HTTP_SERVER_PREFIX, URI, 100, MeterFilter.deny()));
+	 * 
+ *

{@code methodTagValue} function receives the actual method name and returns the method tag value + * that will be used for the metrics with {@link reactor.netty.Metrics#METHOD} tag. + *

By default metrics are not enabled. + * + * @param enable true enables metrics collection; false disables it + * @param uriTagValue a function that receives the actual uri and returns the uri tag value + * that will be used for the metrics with {@link reactor.netty.Metrics#URI} tag + * @param methodTagValue a function that receives the actual method name and returns the method tag value + * that will be used for the metrics with {@link reactor.netty.Metrics#METHOD} tag + * @return a new {@link HttpServer} + * @since 1.0.39 + */ + public final HttpServer metrics(boolean enable, Function uriTagValue, Function methodTagValue) { + if (enable) { + Objects.requireNonNull(methodTagValue, "methodTagValue"); + if (!Metrics.isInstrumentationAvailable()) { + throw new UnsupportedOperationException( + "To enable metrics, you must add the dependency `io.micrometer:micrometer-core`" + + " to the class path first"); + } + if (uriTagValue == Function.identity()) { + log.debug("Metrics are enabled with [uriTagValue=Function#identity]. " + + "It is strongly recommended to provide template-like form for the URIs. " + + "Without a conversion to a template-like form, each distinct URI leads " + + "to the creation of a distinct tag, which takes a lot of memory for the metrics."); + } + if (methodTagValue == Function.identity()) { + log.debug("Metrics are enabled with [methodTagValue=Function#identity]. " + + "It is strongly recommended to provide a function for transforming the method names."); + } + HttpServer dup = duplicate(); + dup.configuration().metricsRecorder(() -> configuration().defaultMetricsRecorder()); + dup.configuration().methodTagValue = methodTagValue; + dup.configuration().uriTagValue = uriTagValue; + return dup; + } + else if (configuration().metricsRecorder() != null) { + HttpServer dup = duplicate(); + dup.configuration().metricsRecorder(null); + dup.configuration().methodTagValue = null; + dup.configuration().uriTagValue = null; + return dup; + } + else { + return this; + } + } + @Override public final HttpServer metrics(boolean enable, Supplier recorder) { return super.metrics(enable, recorder); @@ -663,6 +730,49 @@ else if (configuration().metricsRecorder() != null) { } } + /** + * Specifies whether the metrics are enabled on the {@link HttpServer}. + * All generated metrics are provided to the specified recorder which is only + * instantiated if metrics are being enabled (the instantiation is not lazy, + * but happens immediately, while configuring the {@link HttpServer}). + *

{@code uriValue} function receives the actual uri and returns the uri value + * that will be used when the metrics are propagated to the recorder. + * For example instead of using the actual uri {@code "/users/1"} as uri value, templated uri + * {@code "/users/{id}"} can be used. + *

{@code methodValue} function receives the actual method name and returns the method value + * that will be used when the metrics are propagated to the recorder. + * + * @param enable true enables metrics collection; false disables it + * @param recorder a supplier for the metrics recorder that receives the collected metrics + * @param uriValue a function that receives the actual uri and returns the uri value + * that will be used when the metrics are propagated to the recorder. + * @param methodValue a function that receives the actual method name and returns the method value + * that will be used when the metrics are propagated to the recorder. + * @return a new {@link HttpServer} + * @since 1.0.39 + */ + public final HttpServer metrics(boolean enable, Supplier recorder, + Function uriValue, Function methodValue) { + if (enable) { + Objects.requireNonNull(methodValue, "methodTagValue"); + HttpServer dup = duplicate(); + dup.configuration().metricsRecorder(recorder); + dup.configuration().methodTagValue = methodValue; + dup.configuration().uriTagValue = uriValue; + return dup; + } + else if (configuration().metricsRecorder() != null) { + HttpServer dup = duplicate(); + dup.configuration().metricsRecorder(null); + dup.configuration().methodTagValue = null; + dup.configuration().uriTagValue = null; + return dup; + } + else { + return this; + } + } + /** * Removes any previously applied SSL configuration customization. * diff --git a/reactor-netty-http/src/main/java/reactor/netty/http/server/HttpServerConfig.java b/reactor-netty-http/src/main/java/reactor/netty/http/server/HttpServerConfig.java index 9fb8e8bb14..ce11861bef 100644 --- a/reactor-netty-http/src/main/java/reactor/netty/http/server/HttpServerConfig.java +++ b/reactor-netty-http/src/main/java/reactor/netty/http/server/HttpServerConfig.java @@ -272,6 +272,7 @@ public Function uriTagValue() { BiFunction, ? super Connection, ? extends Mono> mapHandle; int maxKeepAliveRequests; + Function methodTagValue; int minCompressionSize; HttpProtocol[] protocols; int _protocols; @@ -310,6 +311,7 @@ public Function uriTagValue() { this.idleTimeout = parent.idleTimeout; this.mapHandle = parent.mapHandle; this.maxKeepAliveRequests = parent.maxKeepAliveRequests; + this.methodTagValue = parent.methodTagValue; this.minCompressionSize = parent.minCompressionSize; this.protocols = parent.protocols; this._protocols = parent._protocols; @@ -414,6 +416,7 @@ static void addStreamHandlers(Channel ch, HttpMessageLogFactory httpMessageLogFactory, ConnectionObserver listener, @Nullable BiFunction, ? super Connection, ? extends Mono> mapHandle, + @Nullable Function methodTagValue, @Nullable ChannelMetricsRecorder metricsRecorder, int minCompressionSize, ChannelOperations.OnSetup opsFactory, @@ -455,8 +458,8 @@ static void addStreamHandlers(Channel ch, } else { handler = metricsRecorder instanceof ContextAwareHttpServerMetricsRecorder ? - new ContextAwareHttpServerMetricsHandler((ContextAwareHttpServerMetricsRecorder) metricsRecorder, uriTagValue) : - new HttpServerMetricsHandler((HttpServerMetricsRecorder) metricsRecorder, uriTagValue); + new ContextAwareHttpServerMetricsHandler((ContextAwareHttpServerMetricsRecorder) metricsRecorder, methodTagValue, uriTagValue) : + new HttpServerMetricsHandler((HttpServerMetricsRecorder) metricsRecorder, methodTagValue, uriTagValue); } pipeline.addBefore(NettyPipeline.ReactiveBridge, NettyPipeline.HttpMetricsHandler, handler); } @@ -513,6 +516,7 @@ static void configureH2Pipeline(ChannelPipeline p, @Nullable Duration idleTimeout, ConnectionObserver listener, @Nullable BiFunction, ? super Connection, ? extends Mono> mapHandle, + @Nullable Function methodTagValue, @Nullable ChannelMetricsRecorder metricsRecorder, int minCompressionSize, ChannelOperations.OnSetup opsFactory, @@ -549,7 +553,7 @@ static void configureH2Pipeline(ChannelPipeline p, .addLast(NettyPipeline.H2MultiplexHandler, new Http2MultiplexHandler(new H2Codec(accessLogEnabled, accessLog, compressPredicate, cookieDecoder, cookieEncoder, formDecoderProvider, forwardedHeaderHandler, httpMessageLogFactory, listener, - mapHandle, metricsRecorder, minCompressionSize, opsFactory, uriTagValue))); + mapHandle, methodTagValue, metricsRecorder, minCompressionSize, opsFactory, uriTagValue))); IdleTimeoutHandler.addIdleTimeoutHandler(p, idleTimeout); @@ -579,6 +583,7 @@ static void configureHttp11OrH2CleartextPipeline(ChannelPipeline p, ConnectionObserver listener, @Nullable BiFunction, ? super Connection, ? extends Mono> mapHandle, int maxKeepAliveRequests, + @Nullable Function methodTagValue, @Nullable ChannelMetricsRecorder metricsRecorder, int minCompressionSize, ChannelOperations.OnSetup opsFactory, @@ -590,7 +595,7 @@ static void configureHttp11OrH2CleartextPipeline(ChannelPipeline p, Http11OrH2CleartextCodec upgrader = new Http11OrH2CleartextCodec(accessLogEnabled, accessLog, compressPredicate, cookieDecoder, cookieEncoder, p.get(NettyPipeline.LoggingHandler) != null, enableGracefulShutdown, formDecoderProvider, - forwardedHeaderHandler, http2SettingsSpec, httpMessageLogFactory, listener, mapHandle, metricsRecorder, + forwardedHeaderHandler, http2SettingsSpec, httpMessageLogFactory, listener, mapHandle, methodTagValue, metricsRecorder, minCompressionSize, opsFactory, uriTagValue, decoder.validateHeaders()); ChannelHandler http2ServerHandler = new H2CleartextCodec(upgrader, http2SettingsSpec != null ? http2SettingsSpec.maxStreams() : null); @@ -619,8 +624,8 @@ static void configureHttp11OrH2CleartextPipeline(ChannelPipeline p, if (metricsRecorder != null) { if (metricsRecorder instanceof HttpServerMetricsRecorder) { ChannelHandler handler = metricsRecorder instanceof ContextAwareHttpServerMetricsRecorder ? - new ContextAwareHttpServerMetricsHandler((ContextAwareHttpServerMetricsRecorder) metricsRecorder, uriTagValue) : - new HttpServerMetricsHandler((HttpServerMetricsRecorder) metricsRecorder, uriTagValue); + new ContextAwareHttpServerMetricsHandler((ContextAwareHttpServerMetricsRecorder) metricsRecorder, methodTagValue, uriTagValue) : + new HttpServerMetricsHandler((HttpServerMetricsRecorder) metricsRecorder, methodTagValue, uriTagValue); p.addAfter(NettyPipeline.HttpTrafficHandler, NettyPipeline.HttpMetricsHandler, handler); if (metricsRecorder instanceof MicrometerHttpServerMetricsRecorder) { // For sake of performance, we can remove the ChannelMetricsHandler because the MicrometerHttpServerMetricsRecorder @@ -646,6 +651,7 @@ static void configureHttp11Pipeline(ChannelPipeline p, ConnectionObserver listener, @Nullable BiFunction, ? super Connection, ? extends Mono> mapHandle, int maxKeepAliveRequests, + @Nullable Function methodTagValue, @Nullable ChannelMetricsRecorder metricsRecorder, int minCompressionSize, @Nullable Function uriTagValue) { @@ -672,8 +678,8 @@ static void configureHttp11Pipeline(ChannelPipeline p, if (metricsRecorder != null) { if (metricsRecorder instanceof HttpServerMetricsRecorder) { AbstractHttpServerMetricsHandler handler = metricsRecorder instanceof ContextAwareHttpServerMetricsRecorder ? - new ContextAwareHttpServerMetricsHandler((ContextAwareHttpServerMetricsRecorder) metricsRecorder, uriTagValue) : - new HttpServerMetricsHandler((HttpServerMetricsRecorder) metricsRecorder, uriTagValue); + new ContextAwareHttpServerMetricsHandler((ContextAwareHttpServerMetricsRecorder) metricsRecorder, methodTagValue, uriTagValue) : + new HttpServerMetricsHandler((HttpServerMetricsRecorder) metricsRecorder, methodTagValue, uriTagValue); if (channelOpened) { handler.channelOpened = true; } @@ -837,6 +843,7 @@ static final class H2Codec extends ChannelInitializer { final ConnectionObserver listener; final BiFunction, ? super Connection, ? extends Mono> mapHandle; + final Function methodTagValue; final ChannelMetricsRecorder metricsRecorder; final int minCompressionSize; final ChannelOperations.OnSetup opsFactory; @@ -853,6 +860,7 @@ static final class H2Codec extends ChannelInitializer { HttpMessageLogFactory httpMessageLogFactory, ConnectionObserver listener, @Nullable BiFunction, ? super Connection, ? extends Mono> mapHandle, + @Nullable Function methodTagValue, @Nullable ChannelMetricsRecorder metricsRecorder, int minCompressionSize, ChannelOperations.OnSetup opsFactory, @@ -867,6 +875,7 @@ static final class H2Codec extends ChannelInitializer { this.httpMessageLogFactory = httpMessageLogFactory; this.listener = listener; this.mapHandle = mapHandle; + this.methodTagValue = methodTagValue; this.metricsRecorder = metricsRecorder; this.minCompressionSize = minCompressionSize; this.opsFactory = opsFactory; @@ -877,8 +886,8 @@ static final class H2Codec extends ChannelInitializer { protected void initChannel(Channel ch) { ch.pipeline().remove(this); addStreamHandlers(ch, accessLogEnabled, accessLog, compressPredicate, cookieDecoder, cookieEncoder, - formDecoderProvider, forwardedHeaderHandler, httpMessageLogFactory, listener, mapHandle, metricsRecorder, - minCompressionSize, opsFactory, uriTagValue); + formDecoderProvider, forwardedHeaderHandler, httpMessageLogFactory, listener, mapHandle, methodTagValue, + metricsRecorder, minCompressionSize, opsFactory, uriTagValue); } } @@ -898,6 +907,7 @@ static final class Http11OrH2CleartextCodec extends ChannelInitializer final BiFunction, ? super Connection, ? extends Mono> mapHandle; final Long maxStreams; + final Function methodTagValue; final ChannelMetricsRecorder metricsRecorder; final int minCompressionSize; final ChannelOperations.OnSetup opsFactory; @@ -917,6 +927,7 @@ static final class Http11OrH2CleartextCodec extends ChannelInitializer HttpMessageLogFactory httpMessageLogFactory, ConnectionObserver listener, @Nullable BiFunction, ? super Connection, ? extends Mono> mapHandle, + @Nullable Function methodTagValue, @Nullable ChannelMetricsRecorder metricsRecorder, int minCompressionSize, ChannelOperations.OnSetup opsFactory, @@ -954,6 +965,7 @@ static final class Http11OrH2CleartextCodec extends ChannelInitializer this.httpMessageLogFactory = httpMessageLogFactory; this.listener = listener; this.mapHandle = mapHandle; + this.methodTagValue = methodTagValue; this.metricsRecorder = metricsRecorder; this.minCompressionSize = minCompressionSize; this.opsFactory = opsFactory; @@ -967,8 +979,8 @@ static final class Http11OrH2CleartextCodec extends ChannelInitializer protected void initChannel(Channel ch) { ch.pipeline().remove(this); addStreamHandlers(ch, accessLogEnabled, accessLog, compressPredicate, cookieDecoder, cookieEncoder, - formDecoderProvider, forwardedHeaderHandler, httpMessageLogFactory, listener, mapHandle, metricsRecorder, - minCompressionSize, opsFactory, uriTagValue); + formDecoderProvider, forwardedHeaderHandler, httpMessageLogFactory, listener, mapHandle, methodTagValue, + metricsRecorder, minCompressionSize, opsFactory, uriTagValue); } @Override @@ -1024,6 +1036,7 @@ static final class H2OrHttp11Codec extends ApplicationProtocolNegotiationHandler final BiFunction, ? super Connection, ? extends Mono> mapHandle; final int maxKeepAliveRequests; + final Function methodTagValue; final ChannelMetricsRecorder metricsRecorder; final int minCompressionSize; final ChannelOperations.OnSetup opsFactory; @@ -1046,6 +1059,7 @@ static final class H2OrHttp11Codec extends ApplicationProtocolNegotiationHandler this.listener = listener; this.mapHandle = initializer.mapHandle; this.maxKeepAliveRequests = initializer.maxKeepAliveRequests; + this.methodTagValue = initializer.methodTagValue; this.metricsRecorder = initializer.metricsRecorder; this.minCompressionSize = initializer.minCompressionSize; this.opsFactory = initializer.opsFactory; @@ -1063,14 +1077,14 @@ protected void configurePipeline(ChannelHandlerContext ctx, String protocol) { if (ApplicationProtocolNames.HTTP_2.equals(protocol)) { configureH2Pipeline(p, accessLogEnabled, accessLog, compressPredicate, cookieDecoder, cookieEncoder, enableGracefulShutdown, formDecoderProvider, forwardedHeaderHandler, http2SettingsSpec, httpMessageLogFactory, idleTimeout, - listener, mapHandle, metricsRecorder, minCompressionSize, opsFactory, uriTagValue, decoder.validateHeaders()); + listener, mapHandle, methodTagValue, metricsRecorder, minCompressionSize, opsFactory, uriTagValue, decoder.validateHeaders()); return; } if (ApplicationProtocolNames.HTTP_1_1.equals(protocol)) { configureHttp11Pipeline(p, accessLogEnabled, accessLog, compressPredicate, cookieDecoder, cookieEncoder, true, decoder, formDecoderProvider, forwardedHeaderHandler, httpMessageLogFactory, idleTimeout, listener, - mapHandle, maxKeepAliveRequests, metricsRecorder, minCompressionSize, uriTagValue); + mapHandle, maxKeepAliveRequests, methodTagValue, metricsRecorder, minCompressionSize, uriTagValue); // When the server is configured with HTTP/1.1 and H2 and HTTP/1.1 is negotiated, // when channelActive event happens, this HttpTrafficHandler is still not in the pipeline, @@ -1100,6 +1114,7 @@ static final class HttpServerChannelInitializer implements ChannelPipelineConfig final BiFunction, ? super Connection, ? extends Mono> mapHandle; final int maxKeepAliveRequests; + final Function methodTagValue; final ChannelMetricsRecorder metricsRecorder; final int minCompressionSize; final ChannelOperations.OnSetup opsFactory; @@ -1124,6 +1139,7 @@ static final class HttpServerChannelInitializer implements ChannelPipelineConfig this.idleTimeout = config.idleTimeout; this.mapHandle = config.mapHandle; this.maxKeepAliveRequests = config.maxKeepAliveRequests; + this.methodTagValue = config.methodTagValue; this.metricsRecorder = config.metricsRecorderInternal(); this.minCompressionSize = config.minCompressionSize; this.opsFactory = config.channelOperationsProvider(); @@ -1173,6 +1189,7 @@ else if ((protocols & h11) == h11) { observer, mapHandle, maxKeepAliveRequests, + methodTagValue, metricsRecorder, minCompressionSize, uriTagValue); @@ -1193,6 +1210,7 @@ else if ((protocols & h2) == h2) { idleTimeout, observer, mapHandle, + methodTagValue, metricsRecorder, minCompressionSize, opsFactory, @@ -1219,6 +1237,7 @@ else if ((protocols & h2) == h2) { observer, mapHandle, maxKeepAliveRequests, + methodTagValue, metricsRecorder, minCompressionSize, opsFactory, @@ -1241,6 +1260,7 @@ else if ((protocols & h11) == h11) { observer, mapHandle, maxKeepAliveRequests, + methodTagValue, metricsRecorder, minCompressionSize, uriTagValue); @@ -1261,6 +1281,7 @@ else if ((protocols & h2c) == h2c) { idleTimeout, observer, mapHandle, + methodTagValue, metricsRecorder, minCompressionSize, opsFactory, diff --git a/reactor-netty-http/src/main/java/reactor/netty/http/server/HttpServerMetricsHandler.java b/reactor-netty-http/src/main/java/reactor/netty/http/server/HttpServerMetricsHandler.java index 41c17077ea..223a6af2d5 100644 --- a/reactor-netty-http/src/main/java/reactor/netty/http/server/HttpServerMetricsHandler.java +++ b/reactor-netty-http/src/main/java/reactor/netty/http/server/HttpServerMetricsHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022 VMware, Inc. or its affiliates, All Rights Reserved. + * Copyright (c) 2019-2023 VMware, Inc. or its affiliates, All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,8 +26,11 @@ final class HttpServerMetricsHandler extends AbstractHttpServerMetricsHandler { final HttpServerMetricsRecorder recorder; - HttpServerMetricsHandler(HttpServerMetricsRecorder recorder, @Nullable Function uriTagValue) { - super(uriTagValue); + HttpServerMetricsHandler( + HttpServerMetricsRecorder recorder, + @Nullable Function methodTagValue, + @Nullable Function uriTagValue) { + super(methodTagValue, uriTagValue); this.recorder = recorder; }