From 2e75c4f3558dfb6d64c92f109c0aa5e5ae09f43b Mon Sep 17 00:00:00 2001 From: yeya24 Date: Mon, 20 Apr 2020 17:54:56 -0400 Subject: [PATCH 1/2] fix thanos web route prefix register twice Signed-off-by: yeya24 --- cmd/thanos/query.go | 3 +-- cmd/thanos/rule.go | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cmd/thanos/query.go b/cmd/thanos/query.go index a21565c59a..2735cd76c2 100644 --- a/cmd/thanos/query.go +++ b/cmd/thanos/query.go @@ -8,7 +8,6 @@ import ( "fmt" "math" "net/http" - "path" "strings" "time" @@ -357,7 +356,7 @@ func runQuery( api := v1.NewAPI(logger, reg, engine, queryableCreator, enableAutodownsampling, enablePartialResponse, replicaLabels, instantDefaultMaxSourceResolution) - api.Register(router.WithPrefix(path.Join(webRoutePrefix, "/api/v1")), tracer, logger, ins) + api.Register(router.WithPrefix("/api/v1"), tracer, logger, ins) srv := httpserver.New(logger, reg, comp, httpProbe, httpserver.WithListen(httpBindAddr), diff --git a/cmd/thanos/rule.go b/cmd/thanos/rule.go index 3c021dec2b..33889f7c99 100644 --- a/cmd/thanos/rule.go +++ b/cmd/thanos/rule.go @@ -8,7 +8,6 @@ import ( "math/rand" "net/http" "net/url" - "path" "path/filepath" "strconv" "strings" @@ -576,7 +575,7 @@ func runRule( ui.NewRuleUI(logger, reg, ruleMgr, alertQueryURL.String(), webExternalPrefix, webPrefixHeaderName).Register(router, ins) api := v1.NewAPI(logger, reg, ruleMgr) - api.Register(router.WithPrefix(path.Join(webRoutePrefix, "/api/v1")), tracer, logger, ins) + api.Register(router.WithPrefix("/api/v1"), tracer, logger, ins) srv := httpserver.New(logger, reg, comp, httpProbe, httpserver.WithListen(httpBindAddr), From 8b901617c7c8c72d901450cc3b05de0a0d48c01f Mon Sep 17 00:00:00 2001 From: yeya24 Date: Mon, 20 Apr 2020 23:29:10 -0400 Subject: [PATCH 2/2] add changelog Signed-off-by: yeya24 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d64e641089..53e15bc564 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ We use *breaking* word for marking changes that are not backward compatible (rel - [#2416](https://github.com/thanos-io/thanos/pull/2416) Bucket: fixes issue #2416 bug in `inspect --sort-by` doesn't work correctly in all cases - [#2411](https://github.com/thanos-io/thanos/pull/2411) Query: fix a bug where queries might not time out sometimes due to issues with one or more StoreAPIs +- [##2484](https://github.com/thanos-io/thanos/pull/2484) Query/Ruler: fix issue #2483, when web.route-prefix is set, it is added twice in http router prefix. ### Added