-
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
Query: 404s from api path when using web.route-prefix in 0.12.0 #2483
Labels
Comments
I can reproduce this locally. Thanks for the report! |
From the code, seems we wrap the web route prefix twice, so the web endpoint becomes if webRoutePrefix != "/" {
router.Get("/", func(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, webRoutePrefix, http.StatusFound)
})
router = router.WithPrefix(webRoutePrefix)
}
ins := extpromhttp.NewInstrumentationMiddleware(reg)
// TODO(bplotka in PR #513 review): pass all flags, not only the flags needed by prefix rewriting.
ui.NewQueryUI(logger, reg, stores, webExternalPrefix, webPrefixHeaderName).Register(router, ins)
api := v1.NewAPI(logger, reg, engine, queryableCreator, enableAutodownsampling, enablePartialResponse, replicaLabels, instantDefaultMaxSourceResolution)
api.Register(router.WithPrefix(path.Join(webRoutePrefix, "/api/v1")), tracer, logger, ins) |
@gburek-fastly I opened a PR here #2484 It would be appreciated if you can test it in your environment |
@yeya24 confirmed in the ui and with my curl tests
|
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After an upgrade to Thanos 0.12.0, the query component only serves thanos UI, but any API requests to the
/api/
path that uses the web.route-prefix, will return a 404 error.Thanos, Prometheus and Golang version used:
What happened:
Thanos is configured with the following cli args:
Current behavior against a 0.12.0 thanos binary:
Removing the web.route-prefix from the cli and curl path restores functionality for a modified path:
In a browser, a red banner appears with the message:
Error loading available metrics!
What you expected to happen:
Expected behavior would be to match the 0.11.0 thanos behavior:
We use this functionality to host the thanos query endpoints behind an nginx reverse proxy. These curl urls appear to be sent by default on Thanos UI load and seem to be a basic test of the api path.
How to reproduce it (as minimally and precisely as possible):
Released 0.12.0 and 0.11.0 binaries, on linux or darwin, when run with
--web.route-prefix=/thanos --web.external-prefix=/thanos
will fail to resolve a simpletime()
query in the browser ui at or via curl, as above.Anything else we need to know:
#2208 appears suspicious and may be related to this regression.
The text was updated successfully, but these errors were encountered: