reactor / reactor-netty

TCP/HTTP/UDP/QUIC client/server with Reactor over Netty
https://projectreactor.io
Apache License 2.0
2.6k stars 645 forks source link

Expose activeStreams and potentially pendingStreams for use in ConnectionPoolMetrics in MeterRegistrar #3344

Open FlattestWhite opened 4 months ago

FlattestWhite commented 4 months ago

We use our own metrics vendor and don't use micrometer. To instrument the httpclient, we have an implementation of MeterRegistrar. There's currently no way to get access to activeStreams in ConnectionPoolMetrics. The provided micrometer metrics internally cast to an Http2Pool before calling its activeStreams method.

Motivation

To work around this, we have to keep a count of concurrent requests through a counter (increment and decrement) and report that. Would prefer to have it come through in ConnectionPoolMetrics

Desired solution

Considered alternatives

Additional context

violetagg commented 4 months ago

@FlattestWhite Would you like to create a PR? You didn't mention Reactor Netty version.

FlattestWhite commented 4 months ago

Thanks @violetagg reactor netty version is 1.1.21. Just wanted to confirm that activeStreams metric isn't available through existing interface. If that's the case, I'll look to create a PR sometime for it.

violetagg commented 4 months ago

Just wanted to confirm that activeStreams metric isn't available through existing interface. If that's the case, I'll look to create a PR sometime for it.

Yeah it is not exposed there as this is reactor-netty-core and we cannot add http related information. I think that we can provide something in reactor-netty-http that adds this information.