Are there plans to introduce API for installing me...
# ktor
p
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
io.ktor.metrics.micrometer.MicrometerMetrics
which would allow tracking of outbound HTTP calls.
j
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 http://example.com/resources/982367498374, 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)
p
The question is about implementing the Ktor feature which will allow use of the underlying metrics collectors. For instance, Micrometer already provides
io.micrometer.core.instrument.binder.okhttp3.OkHttpMetricsEventListener
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.