Skip to content
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

Open
basalt79 opened this issue Dec 16, 2024 · 5 comments
Open

Micrometer route gets sub router attached at the end #249

basalt79 opened this issue Dec 16, 2024 · 5 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@basalt79
Copy link

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

  1. Launch MainVerticleTest
  2. see failing tests

OR

  1. Launch MainVerticle
  2. navigate to
http://localhost:7777/good
http://localhost:7777/bad
http://localhost:7777/notfound
http://localhost:7777/first/good
http://localhost:7777/first/bad
http://localhost:7777/first/notfound
http://localhost:7777/first/second/good
http://localhost:7777/first/second/bad
http://localhost:7777/first/second/notfound

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/

@basalt79 basalt79 added the bug Something isn't working label Dec 16, 2024
@tsegismont tsegismont self-assigned this Jan 2, 2025
@tsegismont tsegismont added this to the 4.5.12 milestone Jan 2, 2025
@tsegismont
Copy link
Contributor

Thanks for your report @basalt79

Does the issue affect 4.5.6 as well?

@basalt79
Copy link
Author

basalt79 commented Jan 2, 2025

Thanks for taking care @tsegismont .
Yes, with 4.5.6, 4.5.5, 4.5.3 its the same behavior. I created a branch for this version, see https://github.com/basalt79/vertx-web-metrics/tree/4.5.6

@basalt79
Copy link
Author

basalt79 commented Jan 2, 2025

I have added a reproducer with 4.0.0, this was the first version where the route was added to the metrics.
https://github.com/basalt79/vertx-web-metrics/tree/4.0.0

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
If I define each route dedicated, its working https://github.com/basalt79/vertx-web-metrics/blob/4.0.0/src/main/java/com/noenv/georg/MainVerticle.java#L81

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.

@tsegismont
Copy link
Contributor

Thank you for all these details, I'll look into your reproducer

@vietj vietj modified the milestones: 4.5.12, 4.5.13 Jan 23, 2025
@vietj vietj modified the milestones: 4.5.13, 4.5.14 Feb 10, 2025
@basalt79
Copy link
Author

Hi @tsegismont , have you already got the chance to take a look at the reproducer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

3 participants