Since Netty 4.2 there is a new default allocator: AdaptiveByteBufAllocator
See release notes: https://netty.io/news/2025/04/03/4-2-0.html
That allocator does not produce metrics.
With the update to Spring Boot 4 we lost these metrics for our applications, since that includes the update to Netty 4.2.
We use reactor-netty-core and http in version 1.3.5
And netty in version 4.2.12
Expected Behavior
We should still get these metrics. As far as I can tell this new allocator still allocates direct memory, and we'd like to see how much memory is being used by reactor-netty.
Unless I'm misunderstanding how the new allocator works, and it's not necessary any longer.
Actual Behavior
Metrics are lost.
Steps to Reproduce
Enable reactor netty metrics on a Spring Boot Webflux application, and check the reported metrics on actuator endpoint. Or debug the reactor.netty.transport.TransportConfig.TransportChannelInitializer#initChannel to see that the instanceof checks fail.
Use -Dio.netty.allocator.type=pooled then the pooled allocator, which is the previous default, is picked, and the metrics are there again.
Possible Solution
Add support in reactor.netty.transport.TransportConfig.TransportChannelInitializer#initChannel for io.netty.buffer.AdaptiveByteBufAllocator
Your Environment
- Reactor version(s) used: 1.3.5
- Other relevant libraries versions (eg.
netty, ...): netty in version 4.2.12
- JVM version (
java -version): Java 25
- OS and version (eg.
uname -a): Locally for Ubuntu and in distroless container
Since Netty 4.2 there is a new default allocator: AdaptiveByteBufAllocator
See release notes: https://netty.io/news/2025/04/03/4-2-0.html
That allocator does not produce metrics.
With the update to Spring Boot 4 we lost these metrics for our applications, since that includes the update to Netty 4.2.
We use reactor-netty-core and http in version 1.3.5
And netty in version 4.2.12
Expected Behavior
We should still get these metrics. As far as I can tell this new allocator still allocates direct memory, and we'd like to see how much memory is being used by reactor-netty.
Unless I'm misunderstanding how the new allocator works, and it's not necessary any longer.
Actual Behavior
Metrics are lost.
Steps to Reproduce
Enable reactor netty metrics on a Spring Boot Webflux application, and check the reported metrics on actuator endpoint. Or debug the reactor.netty.transport.TransportConfig.TransportChannelInitializer#initChannel to see that the instanceof checks fail.
Use
-Dio.netty.allocator.type=pooledthen the pooled allocator, which is the previous default, is picked, and the metrics are there again.Possible Solution
Add support in reactor.netty.transport.TransportConfig.TransportChannelInitializer#initChannel for io.netty.buffer.AdaptiveByteBufAllocator
Your Environment
netty, ...): netty in version 4.2.12java -version): Java 25uname -a): Locally for Ubuntu and in distroless container