-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Hosting zipkin UI through a proxy #1452
Comments
assumption here is that you cannot deploy the UI assets to the proxy? ex
https://github.com/openzipkin/docker-zipkin/tree/master/zipkin-ui
…On Thu, Dec 22, 2016 at 12:48 PM, raiRaiyan ***@***.***> wrote:
The zipkin ui that is hosted when a java zipkin server is launched is
accessible only through the hostname of the machine where the ui is hosted.
Like http://localhost:9411/
If the request to the ui is proxied through a gateway, the UI becomes
inaccessible.
Like http://abcd.com/zipkin/
The problem seems to be the app.js bundle file for the ui is not
requested relatively. The request is something like
http://abcd.com/app.js/, whereas this request should also be proxied
http://abcd.com/zipkin/app.js
Looking into it, I figured that publicPath in webpack.config file is
specified as /, which makes the requests non relative.
Even after changing that, all the jquery requests that the ui makes to
retreive the data is not proxied.
Can this be changed, maybe accept a basePath property in config.json of
the ui, which will allow the ui to be proxied? Or is there already a way to
do this?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1452>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAD619tYiQpEAAJ0Fm5tugyDTqf5kjrbks5rKgE7gaJpZM4LToyx>
.
|
@adriancole The ui itself is not accessible when proxied. The index.html requests for a file |
oh right.. you are talking about proxying, and also hosting under a different path. can you please find the existing issue on this and close this as a dupe? |
Ok, here is the solution we can implement (it was discussed before) Always serve the zipkin ui under a context path, like /zipkin/. Any requests that don't start with that URL will automatically be forwarded. That means there will be no special handling when using a proxy. |
@eirslett seems right, since iirc most are asking for that specific path anyway :) We'd have to whitelist quite a few things, like the api config health checks, etc. Maybe we forward the root itself or is a whitelist ok? |
/api/ can be duplicate-served under /zipkin/api/ for a while, I guess not all http clients people use handle 302? But all browsers will. |
The problem is with crossroads, which doesn't know what to serve (which route) if it doesn't know about the context path. |
dupe of #1229 |
This moves the zipkin UI under the path /zipkin, adding a redirect for / as well. As UI assets look for the api to be relative to it, requests to /zipkin/api are forwarded to /api, too. Fixes openzipkin#1229 openzipkin#1452
This moves the zipkin UI under the path /zipkin, adding a redirect for / as well. As UI assets look for the api to be relative to it, requests to /zipkin/api are forwarded to /api, too. Fixes openzipkin#1229 openzipkin#1452
This moves the zipkin UI under the path /zipkin, adding a redirect for / as well. As UI assets look for the api to be relative to it, requests to /zipkin/api are forwarded to /api, too. Fixes openzipkin#1229 openzipkin#1452
@adriancole i ran into a similar issue recently. If I hit Zipkin host from a proxied host, e.g. http://myzipkin.tld/ it'll redirect me to Is there any chance to redirect to context w/ relative URL? |
Is there any chance to redirect to context w/ relative URL?
Possible. Can you weigh in on #1732
and open an issue about relative url if not ok. There are a few issues like
this and want to reduce any overlap complexity
Cheers!
|
I was able to make it happen with Zipkin latest version, 2.5.3, using “zipkin.ui.basepath”. I have Zipkin behind Zuul, with service discovery working like a charm. In my Zuul routes I have mapped Zipkin to “/api/trace/**”, pointing to “zipkin-service” as registered in Eureka and at Zipkin YML config, my “zipkin.ui.basepath” points to “/api/trace/zipkin”. With this settings I can run for “http://localhost:8080/api/trace/“ and all redirects works. Hope it help another people. Passed two days figuring out what to do... |
thanks so much for sharing!
|
hi@brunouska how are u accessing zipkin thru serviceid or url. |
@momentum123, I’m accessing zipkin by Zuul exposed url. Zuul uses Service id at route mapping. |
@brunouska i have tried the same but doesnt work for me tried on earlier version and 2.5.3 and on 2.7.1
accessing thru gateway https://localhost:443/api/trace getting same broken ui without any changes |
Let's go @momentum123, My Spring Boot Version for my implementation is 1.5.9.RELEASE Here's my Zuul routes config, at my YML: zuul: Here's my Zipkin Config, at my YML: eureka: zipkin: When accessing Zipkin thru Zuul, i use "http://localhost:8080/api/tracing/zipkin/", note the "/" at the end, you have to put it in order to access the UI. You can handle this with a redirection if you want it, at my needing this not a issue. Try with this settings. You can not get it working we could make a git repository only with the modules involved. I have so many other things, like rabbitmq, auth, so on... If you can not get working I put something at Git Hub for you. |
This was a little tricky for me to get working, pay attention to the minimum details at your configuration. |
sorry for the really late reply. thanx the above solution worked like a charm for me |
This moves the zipkin UI under the path /zipkin, adding a redirect for / as well. As UI assets look for the api to be relative to it, requests to /zipkin/api are forwarded to /api, too. Fixes openzipkin#1229 openzipkin#1452
The zipkin ui that is hosted when a java zipkin server is launched is accessible only through the hostname of the machine where the ui is hosted.
Like
http://localhost:9411/
If the request to the ui is proxied through a gateway, the UI becomes inaccessible.
Like
http://abcd.com/zipkin/
The problem seems to be the
app.js
bundle file for the ui is not requested relatively. The request is something likehttp://abcd.com/app.js/
, whereas this request should also be proxiedhttp://abcd.com/zipkin/app.js
Looking into it, I figured that
publicPath
inwebpack.config
file is specified as/
, which makes the requests non relative.Even after changing that, all the jquery requests that the ui makes to retreive the data is not proxied.
Can this be changed, maybe accept a
basePath
property inconfig.json
of the ui, which will allow the ui to be proxied? Or is there already a way to do this?The text was updated successfully, but these errors were encountered: