-
Notifications
You must be signed in to change notification settings - Fork 2.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
Thanos rule doesn't honor --web.external-prefix #3260
Comments
Unlike Prometheus' Can you please check if you can reproduce this bug even after correctly passing the flag? |
I just switched to The results for Classic UI:
The results for New UI:
|
Thanks for the detailed report, I'll take a look at how things are handled in Ruler and hopefully a fix will land soon. |
@prmsrswt I'm facing a similar issue with --web.external-prefix' for the Query component. Using version 0.14.0, I had '--web.external-prefix=/thanos' and everything was working fine. Then, I updated to version 0.15.0 and I started to get "404 page not found". Then, I changed to '--web.external-prefix=thanos' - no slash. And, now, I have too many redirects errors. For the Ruler, I was using '--web.external-prefix=/ruler'. Then, I dropped the slash and everything worked again. Any thoughts on that? |
Okay so tried this on the latest master and this issue seems to be fixed as a side effect of #3234 Everything should work as expected with the config you specified above. But there's one thing that caught my eye is that we are handling external prefix and route prefix differently from the Querier. In Prometheus, route-prefix's default value is equal to the external-prefix specified, because that is the most general use case. This way, Prometheus and it's UI can be accessed with and without the reverse proxy. In Thanos, we were not doing this initially so if you forget to specify route-prefix the same as the external prefix, you will not be able to access the UI internally (without reverse proxy, it'll work as expected with a reverse proxy though). This was changed in the Querier some time ago and now we also do what Prometheus does. We added some documentation around it here. But we are not doing this in other components yet. I think we need to follow the same approach in all other components as well, so that it stays consistent throughout all components. @ncastrocosta If we modify this behavior in Ruler, you would have to modify your nginx config to something like
Also, even internally, the ruler would be accessible at |
@prmsrswt using v0.16.0, for the Query, no matter if I configure --web.external-prefix=/thanos or --web.external-prefix=thanos, for both cases I'm redirected to "/thanos/graph" and I get "404 page not found". The "/thanos/metrics", for example, is working fine. What happened to graph? |
I got the query and rule working like this:
When using:
I get the error There is an inconsistency between services.
|
Yup, that's what I pointed out above, rule and querier are doing things differently. |
Hello 👋 Looks like there was no activity on this issue for the last two months. |
Hello 👋 Looks like there was no activity on this issue for the last two months. |
I was also facing the same issue until I prefix |
Hello 👋 Looks like there was no activity on this issue for the last two months. |
Closing for now as promised, let us know if you need this to be reopened! 🤗 |
This is still a valid issue I guess. |
Hello 👋 Looks like there was no activity on this issue for the last two months. |
Closing for now as promised, let us know if you need this to be reopened! 🤗 |
Thanos, Prometheus and Golang version used:
What happened:
Running Thanos Rule behind Nginx, with --web.external-prefix=https://external.com/thanos/rule, so that Rule is accessible at https://external.com/thanos/rule.
The result is https://external.com/thanos/rule directs to https://external.com/thanos/rule/alerts . It opens up but it is in "text mode", style sheet (css) not loaded.
The links in the UI:
Alerts directs to https://external.com/thanos/rule//thanos/rule/alerts and getting "404 page not found"
Rules directs to https://external.com/thanos/rule//thanos/rule/rules and getting "404 page not found"
Help opens in a new tab https://thanos.io/tip/thanos/getting-started.md/ and getting to Thanos documentation
New UI opens a new tab https://external.com/thanos/rule//thanos/rule/new/ and getting "404 page not found"
Opening https://external.com/thanos/rule/rules opens the rules but again style sheet not loaded.
Opening https://external.com/thanos/rule/new/ redirects to https://external.com/thanos/rule/new/alerts and displays "Error: Error fetching Alerts: Failed to fetch", the style sheet is loaded.
Links in the new UI:
http://internal.org:19902 redirects to http://internal.org:19902/thanos/rule/alerts
http://internal.org:19902/alerts opens up but it is in text mode, style sheet (css) not loaded.
What you expected to happen:
How to reproduce it (as minimally and precisely as possible):
The text was updated successfully, but these errors were encountered: