thanos-io / thanos

Highly available Prometheus setup with long term storage capabilities. A CNCF Incubating project.
https://thanos.io
Apache License 2.0
12.75k stars 2.04k forks source link

Thanos Compactor args --web.route-prefix doesn't work #6255

Open suxiaoxiaomm opened 1 year ago

suxiaoxiaomm commented 1 year ago

We are trying to utilize the sub-path for compactor UI(compactor version: 0.29.0-scratch-r0). While what we define args as below:

- '--web.external-prefix=/thanos-compactor'
- '--web.route-prefix=/thanos-compactor'

While with port-forward to the deployment service(we are using kubernetes ), If I visit the url(e.g.: localhost:9092) without sub-path, I can see the top bar is loaded, but main body shows 404, Page not Found! image

If I visit the sub-paths, (e.g.: localhost:9092/thanos-compactor/loaded), I directly get 404 page not found

While with basically same setting for Qurier or Ruler, they works fine.

While checking the code for setting Compactor web router, I didn't see it actually ulitized the args "web.route-prefix", I am wondering whether this is the cause.

Appreciate the help and suggestions.

davidkim83 commented 1 month ago

I was trying to do the same thing and got stuck here.

I can use the Ingress Path Prefix just fine with Thanos Query and Thanos Bucket Web, but couldn't get the Compactor to load. The only way I could use this was without the web.external-prefix, and access directly through NodePort.

I'm not sure if they're related, but the bucket, rule and query seem to try and handle the route prefix, while the compactor doesn't. Hope it helps. (from another troubled user)

https://github.com/thanos-io/thanos/blob/main/cmd/thanos/tools_bucket.go#L607 https://github.com/thanos-io/thanos/blob/main/cmd/thanos/rule.go#L780 https://github.com/thanos-io/thanos/blob/main/cmd/thanos/query.go#L693

https://github.com/thanos-io/thanos/blob/main/cmd/thanos/compact.go#L567