-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Do not prefix URL when URL is already absolute #45300
base: main
Are you sure you want to change the base?
Conversation
Management URLs were prefixed twice when absolute: http://localhost:9000http://localhost:9000/q/health Which was defeating the logic removing the host when collecting suppressed URIs. Fixes quarkusio#36510
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the package, is this code path for devmode only ? I was reproducing #36510 in production mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, it's used when building the application itself in this particular case (and yes, it probably shouldn't!).
I'm not a big fan of how things are handled here and I might have a look at improving how these paths are handled at some point (what is extremely problematic is that we resolve the path at build time while they can only be resolved at runtime).
I'm interested in having someone test it because I actually used the debugger and didn't set up a Prometheus. my debugging session seemed in line with what people observed though.
🎊 PR Preview f040b40 has been successfully built and deployed to https://quarkus-pr-main-45300-preview.surge.sh/version/main/guides/
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@brunobat if you could validate it indeed fixes the whole issue when you're back from PTO, that would be awesome! |
Sure, will do on Thu. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately the fix doesn't work.
I see traces for the dev UI but the application spans and the /metrics one are not collected.
Could you clarify what you see and shouldn't see or the opposite? What I was trying to fix here are the If you have other calls to clarify, let me know and I'll have a look on Monday. |
Using the otel QuickStart as an example, After the change I don't see traces for the app's We probably can have a quick chat about this. I feel we need a reproducer test for this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just read @brunobat comment - need further investigation.
FWIW, I agree the issue is broader than this particular fix but this fix actually fixes one of the issues. Let's say you configure the OpenTelemetry quickstart with:
You end up with
As you can see, all the URLs are prefixed with The thing is that if you have a look the generated spans, you will quickly understand why things are not filtered: As you can see, requests to Thus I suspect these URIs can't be properly dropped. |
Me and @gsmet meet and we agree there are 3 issues at least:
|
We agreed on me digging further and come up with a good idea of what's going on. For me, we should include what's in this PR + a fix for the span not having the correct route path. This would be backportable. And then take a step back and fix the reason why we are having absolute URL with host:port at build time as that's not something we want (especially since the port is set at runtime). But this is for later as I'm pretty sure whatever we do to fix that won't be backportable. |
I pushed two additional commits to give an idea of where the problem is. Unfortunately, it's more complex than that as we have several routes mounted at I will discuss this with @cescoffier . |
The name is used in the metrics if defined and thus we can pass a fully qualifier path for the route.
a450c7d
to
ce1d85f
Compare
In the end, I think I found a smart way to fix it. Vert.x has the notion of route name that is specifically used for metrics. So when building the route for the non application routes, I push a name with the full path. The name has precedence over the path when publishing the metrics. I'll discuss all this with @cescoffier on Monday morning but I think we are on the right path. |
Management URLs were prefixed twice when absolute: http://localhost:9000http://localhost:9000/q/health
Which was defeating the logic removing the host when collecting suppressed URIs.
Fixes #36510