vert-x3 / vertx-web

HTTP web applications for Vert.x
Apache License 2.0
1.11k stars 531 forks source link

Support route names in http client metrics #2275

Open jekkel opened 2 years ago

jekkel commented 2 years ago

With https://github.com/vert-x3/vertx-web/pull/1682, https://github.com/eclipse-vertx/vert.x/pull/3532, https://github.com/vert-x3/vertx-micrometer-metrics/pull/111 and https://github.com/vert-x3/vertx-dropwizard-metrics/pull/101 we implemented route labels for http server metrics. This is a feature lacking in http clients, too.

Use cases

web client supports uri-templates according RFC 6570 to which can be used even from open api based implementations (as open api refers to uri templating at several points). Exposing these URI templates as labels for request metrics would limit the label cardinality (an issue for several metric implementations) and group metrics for a particular operation into a single series. Right now URI labels are off by default and enabling them is not possible for even the simplest http api with a high cardinality parameter in the path.

Alternatively we could provide a general purpose name to a http client request (similar to http server request) which can be freely used from web client (transferring the uri template to it) or other libraries (open api generators) on top of core vertx.

Which strategy would you prefer? Does it sound like reasonable feature at all? Please let me know

Contribution

I contributed the http server support, maybe I can do the same here.

tsegismont commented 2 years ago

Thanks for the report.

Yes please go ahead! The same strategy as for server sounds good to me.

Le mer. 21 sept. 2022 à 15:12, Jörg Eichhorn @.***> a écrit :

With #1682 https://github.com/vert-x3/vertx-web/pull/1682, eclipse-vertx/vert.x#3532 https://github.com/eclipse-vertx/vert.x/pull/3532, vert-x3/vertx-micrometer-metrics#111 https://github.com/vert-x3/vertx-micrometer-metrics/pull/111 and vert-x3/vertx-dropwizard-metrics#101 https://github.com/vert-x3/vertx-dropwizard-metrics/pull/101 we implemented route labels for http server metrics. This is a feature lacking in http clients, too. Use cases

web client supports uri-templates according RFC 6570 https://datatracker.ietf.org/doc/html/rfc6570 to which can be used even from open api based implementations (as open api refers to uri templating at several points). Exposing these URI templates as labels for request metrics would limit the label cardinality (an issue for several metric implementations) and group metrics for a particular operation into a single series. Right now URI labels are off by default and enabling them is not possible for even the simplest http api with a high cardinality parameter in the path.

Alternatively we could provide a general purpose name to a http client request (similar to http server request) which can be freely used from web client (transferring the uri template to it) or other libraries (open api generators) on top of core vertx.

Which strategy would you prefer? Does it sound like reasonable feature at all? Please let me know Contribution

I contributed the http server support, maybe I can do the same here.

— Reply to this email directly, view it on GitHub https://github.com/vert-x3/vertx-web/issues/2275, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALOLNTLDXNTEZFKA47DWXLV7MCUJANCNFSM6AAAAAAQSB3YLQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>