micronaut-micrometer icon indicating copy to clipboard operation
micronaut-micrometer copied to clipboard

Feature Request: Http Client Channel Pool Metrics

Open dthoffdev opened this issue 5 years ago • 6 comments

It would be nice to have visibility into what is happening in the channel pools of http clients. For example the number of channels checked out, pending acquires, rate/number of new connections created, timings on how long it took to open a new connection, etc.

dthoffdev avatar Jun 14 '19 15:06 dthoffdev

Yes, this functionality is very much needed. We are seeing performance issues related to connection pooling

eutkin avatar Sep 02 '21 07:09 eutkin

@graemerocher I realize this issue is quite old, do you know if an implementation of this would be relatively straightforward for someone to contribute it? I'd be happy to try and take this on but I'm a bit worried the HTTP connection pooling code is too complex for someone outside the Micronaut core team.

Our main use case is we would like to understand better if we are maxing out our HTTP connection pools or not but as far as I know there's no way to know that currently.

jjathman-ch avatar Sep 03 '24 17:09 jjathman-ch

@yawkat would know more

graemerocher avatar Sep 03 '24 17:09 graemerocher

Depends on the metrics. imo ConnectionManager is fairly clean nowadays, and I think the "state" metrics (e.g. number of open connections) should be fairly easy with access to PoolResizer. Timing metrics may be more difficult because the code is very asynchronous

yawkat avatar Sep 03 '24 17:09 yawkat

@yawkat thank you. Do you think updating the state of the metrics within the PoolResizer#doSomeWork method would be a reasonable approach? I think just these metrics would be enough for me:

pendingRequestCount
pendingConnectionCount 
http1ConnectionCount
http2ConnectionCount

jjathman-ch avatar Sep 03 '24 18:09 jjathman-ch

sure

yawkat avatar Sep 03 '24 19:09 yawkat