# ktor

Pavel Lechev

09/20/2019, 2:18 PM
Are there plans to introduce API for installing metrics registries in HTTP clients, using Ktor's feature API? I am talking about something similar to
which would allow tracking of outbound HTTP calls.

Jens Baitinger

09/29/2019, 9:31 AM
I had some idea in that direction but no time to realize it yet. Which metrics do you think woukd be helpful?
first analysis shows it would be easy ti implement a similar metrics set like in the server feature: - active: amout of currenly active requests - timer for request: difficulty would be here that twe would need to abstract the requested URIs. Example: The user requests a URI like, you dont want to have a tag value for each and every resource ID. If you would do so you would use up too many resources (on your local process to measure each and every request seperately) and on your metrics server
it would be more effort if we want insight of every (jvm-based) implementation. (e.g. utilisation of implementation specific resources), but we dont have that in the serve neither (yet)

Pavel Lechev

09/30/2019, 8:29 AM
The question is about implementing the Ktor feature which will allow use of the underlying metrics collectors. For instance, Micrometer already provides
which is responsible for tagging and collection of the metrics. Ktor needs a feature which allows installing this into the HttpClient abstractions. Granted, this must account for all different client engines and their idiomatic ways of intercepting calls, but should not need to deal with the collection of metrics itself.