Hello everyone, I am curious to find out if I can ...
# ktor
n
Hello everyone, I am curious to find out if I can get ktor client micrometer metrics. The ktor server has the
MicrometerMetrics
feature but I don’t see an equivalent one for the ktor client. Am I missing something?
a
MicrometerMetrics
adds route to http server to publish metrics. What do you want to do for ktor-client? How you want to publish metrics?
n
We have a microservice that is talking to an external service using ktor client. It would be nice to publish metrics about how long each http request is taking and be able to graph them so we can see if the external service is behaving abnormally.
a
You can publish something ONLY by ktor-server (or another http-server). For collecting ktor-client metrics you have to create own implementation of
MeterBinder
We have a microservice
I think that any microservice has to contains http server for monitoring purpose.
n
Perhaps I haven’t explained myself very well. We have a microservice that is a ktor server. It already has
MicrometerMetrics
installed and is configurd to publish those metrics on
/metrics
. However some of the Rest API calls that are part of our microservice call out to an external service. So I would like to add more metrics to the already published set to cover ktor client calls.
a
You have to create an implementation of 
MeterBinder
. I haven’t found this in ktor-client. PS: after this you may to do pull request into ktor :)