-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Micrometer route gets sub router attached at the end #249
Comments
Thanks for your report @basalt79 Does the issue affect 4.5.6 as well? |
Thanks for taking care @tsegismont . |
I have added a reproducer with 4.0.0, this was the first version where the route was added to the metrics. this happens only if I use subRouter like https://github.com/basalt79/vertx-web-metrics/blob/4.0.0/src/main/java/com/noenv/georg/MainVerticle.java#L104 @tsegismont i have not adapted the unit tests, because if i dont use subRouter, the />/ part is missing anyway. since we use subRouter for the main API routes from Swagger, the behavior is on every service. |
Thank you for all these details, I'll look into your reproducer |
Hi @tsegismont , have you already got the chance to take a look at the reproducer? |
@basalt79 I was able to write a unit test for In case you haven't figured it out yourself, you could write a |
When the route label is enabled, the Vert.x Web Router can notify the metrics SPI implementation that a route handler has been invoked. For example, if you set two routes with same path: router.route("/bad").handler(RoutingContext::next);
router.route("/bad").handler(ctx -> ctx.fail(500)); You will get a metric with route tag that contains:
Similarly, if you invoke reroute: router.route("/good").handler(ctx -> ctx.reroute("/first/second/bad")); The metric route tag contains:
Back to your reproducer, when So this works as designed. Have you tried to create a |
Hi @tsegismont I will check the |
Thanks for your feedback! |
Version
vertx: 4.5.7 - 4.5.11
Context
Define a main route and add a sub route.
Calling sub route api.
on 200 -> route string in metrics looks ok
on fail() -> route string in metrics gets the sub route attached at the end of the url.
Reproducer
see: https://github.com/basalt79/vertx-web-metrics
Steps to reproduce
OR
and check afterwards the metrics result at http://localhost:7777/metrics
Extra
Since the effect of this hits metrics, i put this issue here, but maybe the root cause is located at https://github.com/vert-x3/vertx-web/
The text was updated successfully, but these errors were encountered: