-
Notifications
You must be signed in to change notification settings - Fork 217
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
fix: serve everything under path prefix when set #3186
Conversation
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.
LGTM
I feel like this was this way for a reason before. I think the way it was intended to be used is to have a rewrite rule by any proxy in front of parca. |
if pathPrefix != "" { | ||
internalMux.Mount(pathPrefix+"/api", grpcWebMux) | ||
} | ||
internalMux.Mount("/api", grpcWebMux) |
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.
We could use a rewrite rule, but what's the purpose of this then? It feels like the other paths were overlooked. Otherwise, I'd remove this if-block and we do not change anything in the router when pathPrefix
is set. WDYT?
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.
I guess the idea was that because the API is part of our public API the prefix would be adjusted, whereas the internal APIs would stay the same. It would be more clear if those routers where served on different ports, but we have it on the same one.
Given we have it on the same port and use the same router in the end, I can see how being consistent with the prefix makes sense. 👍
562942d
to
6f9d76b
Compare
Ah ok yes I think in the past we played around with separate ports. Lgtm then |
Serve everything under path prefix when
--path-prefix
is set, including/metrics
and/debug/pprof
, and nothing directly from/