I followed the official documentation to create an app that uses the rest-client extension to make http calls.
I also added the micrometer lib to the project, so I get metrics.
My expectation is that I can get out-of-the-box metrics about rate, latency (percentiles), errors, etc on the clients calls.
But when I execute my example (and call localhost:8080/country/name/{name}), I do not see any client related metrics, even though I can see the result of the client call on my browser.
/cc @jmartisk, @phillip-kruger
We don't currently support any metrics associated with rest clients.
There are metrics for the server side (statistics how often each REST method is called and how long it takes) if you use the SmallRye Metrics extension. It's enabled by setting quarkus.smallrye-metrics.jaxrs.enabled.
With the Micrometer extension, we support a lower-level approach of gathering metrics on the HTTP (Vert.x) layer, enabled by quarkus.micrometer.binder.vertx.enabled. But it's, again, for the server side.
/cc @ebullient
@jmartisk Do you think this should exist?
I was planning to create an interceptor (or something similar) that intercepts calls to any bean annotated with @RegisterRestClient and creates the metrics.
An Alternative would be to extend the rest-client extension to wrap the resteasy proxy with a custom object that would register the metrics. I analyzed the code and I don't know if that is feasible.
What do you think? Is any of these a viable solution?
(I am creating an interceptor. If you agree please let me know whether I should add to the rest-client or the micrometer extension)
You can certainly create a client interceptor to emit metrics as a near term (use the appropriate API for the metrics extension you're using).
We can also add support for http client metrics to the micrometer extension (which will capture outbound vert.x requests). I'll get started on that after publishing a few things today. If you'd like to help, that's cool. ;)
@ebullient I will get something started.
Ok. For the micrometer extension, I'll be emulating this for clients: https://github.com/quarkusio/quarkus/blob/master/extensions/micrometer/runtime/src/main/java/io/quarkus/micrometer/runtime/binder/vertx/VertxHttpServerMetrics.java (to emit metrics akin to what Spring actuator emits, as a reasonable baseline)
I am trying this right now, but I cannot get it called, because it seems that using the resteasy does not create an HttpClientImpl
Y. I double checked -- resteasy client goes straight out using apache http client, that's why I hadn't added the vert.x based instrumentation. So we'll want client request/response filters.. And I think we may be able to keep those in the rest-client extension in this case .. I'll probably crib from what you get working..
I just got the client filters to work, see https://github.com/oscarfh/quarkus-rest-metrics/commit/4b500e573e20fe122ebee6ffbf8b8892359385b3
I will start working on a PR to get the rest-client extension to create these filters.
ContainerRequestFilter / ContainerResponseFilter are server side?